Skip to content

simple scripts to generate and annotate IGV plots for trios

Notifications You must be signed in to change notification settings

criss-924/IGVeasy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

IGVeasy

Scripts to easily deal with IGV when looking at trio data

IGVplotter.py

IGVplotter is a script that takes a tab file of variants of interest with the corresponding sample path file along with othe BAMS of interest (eg parents) that can be either BAM or CRAM. When given CRAMs it will extract the regions of interest into BAMs in the same directory as the CRAMS for each sample, these will not be deleted automatically. Command to get IGV plots will be submitted as an LSF job.

Requires igv_plotter https://github.com/macarthur-lab/igv_utils/tree/master/igv_plotter

Will need to change global variables to own paths for reference genome and IGV path.

REF_FILE = '/nfs/users/nfs_j/jk18/igv/genomes/hs37d5.genome'
IGV_PATH = '/software/hgi/pkglocal/IGV-2.3.90/bin/lib/igv.jar' 

USAGE:

cd DIRECTORY_FOR_PLOTS
python IGVplotter.py --tabfile REGIONS.tab [--window 50] [--header] [--iscram] [--makebam]

arguments:
--tabfile This is a a tab delimited file that has the following columnns: ID, PATH_TO_BAMFILE , CHR, POS sorted wrt to ID then creates IGV plots for each given variant. PATH_TO_BAMFILE can be multiple BAM paths separated by ',' eg CHILD_BAM,FATHER_BAM,MOTHER_BAM if you would like them to appear in the same IGV plot
--window This is the region in BP that look around variant of interest, default is 50bp
--header Whether or not the tabfile has a header
--iscram If the column PATH_TO_BAMFILE is actually a cram file and so will have to use created bamfile
--makebam Whether to create BAM file for regions in tabfile extracted from CRAMfile

IMPORTANT: BAM files will only be created if have both --iscram and --makebam flag. If you have previously made the regions can use just --iscram dont need to change the paths in the tab file

Plots will be saved as PNGs in DIRECTORY_FOR_PLOTS

IGVviewer.py

Script that takes all IGV plots (or actually any images) in a given directory and displays them one by one allowing for user comment whether the variant looks real. Standard usage will allow response y/yes n/no and m/maybe, using the allowcomment flag will allow user to annotate with any words but is more vulnerable to mistyping also will not enforce categories in output file. Output is a tabfile with columns FILENAME, COMMENT. If the image files have been generated by IGVplotter.py and are in format IDNUMsNUM__chrCHROM_START_END.png then with flag --filenameinfo the columns of the output file will be FILENAME, COMMENT, ID, CHRM, POS

USAGE:

usage: IGVviewer.py [-h] --dir DIR [--ext EXT] [--start START] [--filenameinfo]

USAGE: 
To annotate plot type: y/n/m 
To go forwards or back a plot type: f/b 
To get which filenumber we are at: c/count
To exit program before end of files type: q

optional arguments:
  -h, --help      show this help message and exit
  --dir DIR       directory for IGV images
  --ext EXT       file extension, default is .png
  --start START   file number to start from (integer), default is 0
  --filenameinfo  bool whether the filename info can be parsed for more info
                  eg in format DDDP103048s118__chr6_27416026_27416126.png
  --allowcomments bool to allow any comment not just y/n/m or yes/no/maybe

About

simple scripts to generate and annotate IGV plots for trios

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%