Package: gtracks
gtracksPlot genome track data from bigWig and bedGraph files. Powered bypyGenomeTracks.Installationpipinstallgtracksorpipinstall--usergtracksIn condacondacreate-ngtracks-cconda-forge-cbiocondadeeptoolsseabornpybedtoolsgff2bed
condaactivategtracks
mambainstall-cconda-forge-cbiocondapygenometracks
pipinstallgtracksExamplesAn example bigwig file with ATAC-seq data from the insulin region is included.
You can generate a test plot like this:gtracksINS-IGF2test.pngYou can plot your own tracks over other genomic regions by providing more
positional arguments: a region or gene name and paths to one or more bigWig
files. The file type of the plot will be determined by the
output file extension.gtrackschr11:2150341-2182439track1.bwtrack2.bwoutput.pdf
gtracksINStrack1.bwtrack2.bwoutput.svgModifying the gene annotations trackGRCh37/hg19 gene annotations are used by default, but you can plot GRCh38/hg38
genes by adding--genes GRCh38or--genes hg38. You can use your own gene
annotations file (BED or BED12 format) by providing--genes <path/to/genes.bed.gz>.You may want to add more rows to the genes track. You can do this using
the--genes-heightand--gene-rowsoptions.gtracksINStest-genes.png--genes-height6--gene-rows6Coordinate parsingBy default,gtracksparses input coordinates according to the following regular expression:([Cc]hr)?[0-9XYZWM]+:[0-9]+-[0-9]+$Inputs not matching this expression are interpreted as gene names. This can cause errors
if e.g. your contig names do not match the format. To change how coordinates are parsed,
you can supply an alternative regular expression using the--coord-regexoption. For example, the following expression
allows arbitrary contig names:--coord-regex '[\s\S]+:[0-9]+-[0-9]+$'Changing the color paletteYou can change the color palette for bigWig tracks using the--color-paletteoption.gtracksINStrack1.bwtrack2.bwtrack3.bwoutput.pdf--color-palette"#color1""#color2""#color3"Setting y-axis heightBy default, tracks have different y-axis heights depending on signal height.
You can set a uniform y-axis height for all tracks using the--maxoption.gtracksINStrack1.bwtrack2.bwtrack3.bwoutput.pdf--max400For more command-line options, see the usage page below.Example with non-human data and BED trackThis example command uses data fromS. polyrhizaand includes a BED track.gtracks--genesSp95127:6975000-6989000sp9512_frond_example.bwsp9512_turion_example.bwsp9512_frond_turion_dmr.bedtest-non-human.pngEnvironment variablesIf you want to use your own bigWig files but don't want to write out their
paths every time you rungtracks, you can set your own default tracks using
the environment variableGTRACKS_TRACKS.exportGTRACKS_TRACKS=track1.bw,track2.bw,track3.bw
gtracksoutput.pdfYou can also change the default gene annotations file and color palette using
environment variablesGTRACKS_GENES_PATHandGTRACKS_COLOR_PALETTE.exportGTRACKS_GENES_PATH=path/to/genes.bed.gzexportGTRACKS_COLOR_PALETTE="#color1,#color2,#color3"gtracksoutput.pdfShould your genomic coordinates take a different form from the included default
regex, you may set a different default regex usingGTRACKS_COORD_REGEX:exportGTRACKS_COORD_REGEX='[\s\S]+:[0-9]+-[0-9]+$'Usageusage: gtracks [-h] [--genes <{path/to/genes.bed.gz,GRCh37,GRCh38,hg19,hg38,Sp9512}>]
               [--color-palette <#color> [<#color> ...]] [--max <float>] [--tmp-dir <temp/file/dir>] [--width <int>]
               [--genes-height <int>] [--gene-rows <int>] [--x-axis {top,bottom,none}]
               [--vlines-bed <path/to/vlines.bed>] [--bed-labels]
               <{chr:start-end,GENE}> [<track.{bw,bed}> [<track.{bw,bed}> ...]] <path/to/output.{pdf,png,svg}>

Plot bigWig, bedGraph, and BED signal tracks with gene annotations in a genomic region

positional arguments:
  <{chr:start-end,GENE}>
                        coordinates or gene name to plot
  <track.{bw,bdg,bed}>      bigWig, bedGraph, or bed files containing tracks
  <path/to/output.{pdf,png,svg}>
                        path to output file

optional arguments:
  -h, --help            show this help message and exit
  --genes <{path/to/genes.bed.gz,GRCh37,GRCh38,hg19,hg38,Sp9512}>
                        compressed 6-column BED file or 12-column BED12 file containing gene annotations. Alternatively,
                        providing a genome identifier will use one of the included gene tracks. (default: GRCh37)
  --flank <int>         add flanks to the plotting region
  --color-palette <#color> [<#color> ...]
                        color pallete for tracks
  --max <float>         max value of y-axis
  --tmp-dir <temp/file/dir>
                        directory for temporary files
  --width <int>         width of plot in cm (default: 40)
  --genes-height <int>  height of genes track (default: 2)
  --gene-rows <int>     number of gene rows (default: 1)
  --x-axis {top,bottom,none}
                        where to draw the x-axis (default: top)
  --vlines-bed <path/to/vlines.bed>
                        BED file defining vertical lines
  --bed-labels          include labels on BED tracks
  --coord-regex <regex>
                        regular expression indicating the format for coordinates (default: ([Cc]hr)?[0-9XY]+:[0-9]+-[0-9]+$)