### Install pygenometracks from Source Source: https://pygenometracks.readthedocs.io/en/latest/content/installation Installs pyGenomeTracks from its source code. This involves cloning the repository, downloading a specific release, and then installing using `setup.py`. It allows specifying an installation prefix. ```bash $ git clone https://github.com/deeptools/pyGenomeTracks.git ``` ```bash $ wget https://github.com/deeptools/pyGenomeTracks/archive/3.1.tar.gz $ tar -xzvf ``` ```bash $ python setup.py install --prefix /User/Tools/pyGenomeTracks3.1 ``` -------------------------------- ### Install pygenometracks via Galaxy API Source: https://pygenometracks.readthedocs.io/en/latest/content/installation Installs pyGenomeTracks into a Galaxy server using the Galaxy API. This method requires an API key and specifies repository details, including dependencies and panel section. ```bash $ python ./scripts/api/install_tool_shed_repositories.py \ --api YOUR_API_KEY -l http://localhost/ \ --url http://toolshed.g2.bx.psu.edu/ \ -o iuc -r --name pygenometracks \ --tool-deps --repository-deps --panel-section-name plots ``` -------------------------------- ### Run PyGenomeTracks with Transparency Overlay Example Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This command executes PyGenomeTracks using a configuration file demonstrating complex overlays with transparency for bigwig tracks. ```bash $ pyGenomeTracks --tracks alpha.ini --region X:2700000-3100000 --trackLabelFraction 0.2 --dpi 130 -o master_alpha.png ``` -------------------------------- ### Run PyGenomeTracks Demo Example 1 Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This command runs PyGenomeTracks with the 'demo.ini' configuration file to visualize a relatively large genomic region. ```bash $ pyGenomeTracks --tracks demo.ini --region chrX:3000000-3500000 -o demo.png ``` -------------------------------- ### Run PyGenomeTracks Demo Example 2 Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This command executes PyGenomeTracks with the 'demo2.ini' configuration file, which includes vertical lines and highlights for a smaller genomic region. ```bash $ pyGenomeTracks --tracks demo2.ini --region chrX:3320000-3370000 -o demo2.png ``` -------------------------------- ### Install pygenometracks with Pip Source: https://pygenometracks.readthedocs.io/en/latest/content/installation Installs pyGenomeTracks using pip. This method automatically installs Python requirements but requires manual installation of BEDTools. It also shows how to specify an installation prefix. ```bash $ pip install pyGenomeTracks ``` ```bash $ pip install --install-option="--prefix=/MyPath/Tools/pyGenomeTracks" git+https://github.com/deeptools/pyGenomeTracks.git ``` -------------------------------- ### PyGenomeTracks: Configuration for BED tracks with arrowhead options Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This configuration demonstrates how to display BED files with options for arrowhead placement. It shows examples with default arrowhead behavior and when the arrowhead is included inside the interval using 'arrowhead_included = true'. ```ini [x-axis] where = top title = where =top [spacer] height = 0.05 [genes 2] file = dm3_genes.bed.gz height = 3 title = genes (bed12) style = UCSC; fontsize = 10 style = UCSC fontsize = 10 [genes 2bis] file = dm3_genes.bed.gz height = 3 title = genes (bed12) style = UCSC; arrow_interval=10; fontsize = 10 style = UCSC arrow_interval = 10 fontsize = 10 [spacer] height = 1 [test bed6] file = dm3_genes.bed6.gz height = 3 title = bed6 border_color = black; fontsize=8; color=red fontsize = 8 file_type = bed color = red border_color = black [spacer] height = 1 [test bed6 arrowhead_included] file = dm3_genes.bed6.gz height = 3 title = bed6 border_color = black; fontsize=8; color=red; arrowhead_included = true fontsize = 8 file_type = bed color = red border_color = black arrowhead_included = true [spacer] height = 1 [test bed4] file = dm3_genes.bed4.gz height = 3 title = bed4 fontsize = 10; line_width = 1.5 fontsize = 10 file_type = bed line_width = 1.5 [spacer] height = 1 [test bed] file = dm3_subset_BDGP5.78_asbed_sorted.bed.gz height = 8 title = gtf from ensembl in bed12 fontsize = 12 file_type = bed [spacer] height = 1 [test bed] file = dm3_subset_BDGP5.78_asbed_sorted.bed.gz height = 8 title = gtf from ensembl in bed12; arrowhead_included = true fontsize = 12 file_type = bed arrowhead_included = true [spacer] height = 1 [x-axis] fontsize = 30 title = fontsize = 30 [vlines] type = vlines file = dm3_genes.bed4.gz line_style = dotted [second_vlines] type = vlines file = dm3_genes_end.bed line_width = 1 color = orange zorder = -100 ``` -------------------------------- ### Run pyGenomeTracks for Hi-C Visualization with Overlays Source: https://pygenometracks.readthedocs.io/en/latest/content/examples Command-line execution of pyGenomeTracks for visualizing Hi-C data with overlaid tracks. Configures region, label fraction, width, DPI, and output file. ```bash $ pyGenomeTracks --tracks browser_tracks_hic.ini --region X:2500000-3500000 --trackLabelFraction 0.23 --width 38 --dpi 130 -o master_plot_hic.png ``` -------------------------------- ### Basic BigWig Track Configuration Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This configuration defines a single bigwig track with optional height, title, and value range settings. It's a minimal setup for visualizing bigwig data. ```ini [bigwig file test] file = bigwig.bw # height of the track in cm (optional value) height = 4 title = bigwig min_value = 0 max_value = 30 ``` -------------------------------- ### Run pyGenomeTracks for Hi-C Matrix Visualization Source: https://pygenometracks.readthedocs.io/en/latest/content/examples Command-line execution of pyGenomeTracks to generate a Hi-C matrix plot. Requires a configuration file for tracks and specifies the region and output file. ```bash $ pyGenomeTracks --tracks hic_track.ini -o hic_track.png --region chrX:2500000-3500000 ``` -------------------------------- ### Overlaying BigWig Tracks with Transparency Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This configuration demonstrates overlaying multiple bigwig tracks with varying transparency (alpha values) and summary methods (max, mean). ```ini [test bigwig] file = bigwig2_X_2.5e6_3.5e6.bw color = blue height = 7 title = No alpha: (bigwig color=blue 2000 bins) overlaid with (bigwig color = (0.6, 0, 0) max over 300 bins) overlaid with (bigwig mean color = green 200 bins) number_of_bins = 2000 min_value = 0 max_value = 30 [test bigwig max] file = bigwig2_X_2.5e6_3.5e6.bw color = (0.6, 0, 0) summary_method = max number_of_bins = 300 overlay_previous = share-y [test bigwig mean] file = bigwig2_X_2.5e6_3.5e6.bw color = green type = fill number_of_bins = 200 overlay_previous = share-y [spacer] [test bigwig] file = bigwig2_X_2.5e6_3.5e6.bw color = blue height = 7 title = alpha (bigwig color = blue 2000 bins) overlaid with (bigwig color = (0.6, 0, 0) alpha = 0.5 max over 300 bins) overlaid with (bigwig mean color = green alpha = 0.5 200 bins) number_of_bins = 2000 min_value = 0 max_value = 30 [test bigwig max] file = bigwig2_X_2.5e6_3.5e6.bw color = (0.6, 0, 0) alpha = 0.5 summary_method = max number_of_bins = 300 overlay_previous = share-y [test bigwig mean] file = bigwig2_X_2.5e6_3.5e6.bw color = green alpha = 0.5 type = fill number_of_bins = 200 overlay_previous = share-y [spacer] [test bigwig] file = bigwig2_X_2.5e6_3.5e6.bw height = 7 title = alpha for lines/points: (bigwig color=(0.6, 0, 0) alpha = 0.5 max) overlaid with (bigwig mean color = green alpha = 0.5 line:2) overlaid with (bigwig min color = blue alpha = 0.5 points:3) color = (0.6, 0, 0) alpha = 0.5 summary_method = max number_of_bins = 300 min_value = 0 max_value = 30 [test bigwig mean] file = bigwig2_X_2.5e6_3.5e6.bw color = green type = line:2 alpha = 0.5 summary_method = mean number_of_bins = 300 overlay_previous = share-y [test bigwig min] file = bigwig2_X_2.5e6_3.5e6.bw color = blue summary_method = min number_of_bins = 1000 type = points:3 alpha = 0.5 overlay_previous = share-y [x-axis] ``` -------------------------------- ### Run PyGenomeTracks with BigWig and Genes Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This command runs PyGenomeTracks with a configuration file that includes both a bigwig track and gene annotations, specifying a region and output file. ```bash $ pyGenomeTracks --tracks bigwig_with_genes.ini --region X:2,800,000-3,100,000 -o bigwig_with_genes.png ``` -------------------------------- ### Generate Zooms from BED file with pyGenomeTracks Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This example demonstrates how to generate genomic visualization zooms using a BED file with pyGenomeTracks. The BED file defines specific regions to be plotted. The command line specifies the track configuration and the BED file containing the regions of interest. ```bash $ pyGenomeTracks --tracks bedgraph_useMid.ini --BED regions_imbricated_chr2.bed --trackLabelFraction 0.2 --width 38 --dpi 130 -o master_bedgraph_useMid.png ``` ```bed track type=bed name=regions_to_plot chr2 73800000 75744000 chr2 74000000 74800000 ``` -------------------------------- ### Configure Hi-C Matrix with Overlaid TADs and Links Source: https://pygenometracks.readthedocs.io/en/latest/content/examples INI file configuration for pyGenomeTracks, demonstrating overlaying TADs and links on a Hi-C matrix. Includes settings for track titles, colormaps, transformations, and overlay behavior. ```ini [hic matrix] file = Li_et_al_2015.h5 title = depth = 200000; transform = log1p; min_value = 5 depth = 200000 min_value = 5 transform = log1p file_type = hic_matrix show_masked_bins = false [hic matrix] file = Li_et_al_2015.h5 title = depth = 250000; orientation = inverted; customized colormap; min_value = 5; max_value = 70 min_value = 5 max_value = 70 depth = 250000 colormap = ['white', (1, 0.88, .66), (1, 0.74, 0.25), (1, 0.5, 0), (1, 0.19, 0), (0.74, 0, 0), (0.35, 0, 0)] file_type = hic_matrix show_masked_bins = false orientation = inverted [spacer] height = 0.5 [hic matrix] file = Li_et_al_2015.h5 title = depth = 300000; transform = log1p; colormap Blues (TADs: overlay_previous = share-y; line_width = 1.5) colormap = Blues min_value = 10 max_value = 150 depth = 300000 transform = log1p file_type = hic_matrix [tads] file = tad_classification.bed #title = TADs color = none; border_color = black file_type = domains border_color = black color = none height = 5 line_width = 1.5 overlay_previous = share-y show_data_range = false [spacer] height = 0.5 [hic matrix] file = Li_et_al_2015.h5 title = depth = 250000; transform = log1p; colormap = bone_r (links: overlay_previous = share-y; links_type = triangles; color = darkred; line_style = dashed, bigwig: color = red) colormap = bone_r min_value = 15 max_value = 200 depth = 250000 transform = log1p file_type = hic_matrix show_masked_bins = false [test arcs] file = links2.links title = links_type = triangles line_style = dashed overlay_previous = share-y line_width = 0.8 color = darkred show_data_range = false [test bigwig] file = bigwig2_X_2.5e6_3.5e6.bw color = red height = 4 title = overlay_previous = yes min_value = 0 max_value = 50 show_data_range = false [spacer] height = 0.5 [hic matrix] file = Li_et_al_2015.h5 title = depth = 200000; show_masked_bins = true; colormap = ['blue', 'yellow', 'red']; max_value = 150 depth = 200000 colormap = ['blue', 'yellow', 'red'] max_value = 150 file_type = hic_matrix show_masked_bins = true [spacer] height = 0.1 [x-axis] ``` -------------------------------- ### Run PyGenomeTracks with BigWig, Genes, and Vlines Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This command executes PyGenomeTracks with a configuration including bigwig, genes, and vertical lines, specifying a region and output file. ```bash $ pyGenomeTracks --tracks bigwig_with_genes_and_vlines.ini --region X:2,800,000-3,100,000 -o bigwig_with_genes_and_vlines.png ``` -------------------------------- ### Run pyGenomeTracks for Epilogos Visualization Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This command executes pyGenomeTracks to generate a PNG image of the epilogos track. It takes a track configuration file, a genomic region, and an output file name as input. ```bash pyGenomeTracks --tracks epilogos_track.ini --region X:3100000-3150000 -o epilogos_track.png ``` -------------------------------- ### Run PyGenomeTracks with Basic BigWig Track Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This command executes PyGenomeTracks using a configuration file for a bigwig track, specifying a genomic region and an output file name. ```bash $ pyGenomeTracks --tracks bigwig_track.ini --region X:2,500,000-3,000,000 -o bigwig.png ``` -------------------------------- ### Install pygenometracks with Mamba Source: https://pygenometracks.readthedocs.io/en/latest/content/installation Installs pyGenomeTracks using mamba for faster installations. It first creates a conda environment with mamba, then installs pygenometracks within that activated environment. Specific versions can also be installed. ```bash $ conda create -n pygenometracks -c bioconda -c conda-forge mamba python=3.9 $ conda activate pygenometracks $ mamba install -c conda-forge -c bioconda pygenometracks ``` ```bash $ conda create -n pygenometracks -c bioconda -c conda-forge mamba python=3.7 $ conda activate pygenometracks $ mamba install -c conda-forge -c bioconda pygenometracks=3.5 ``` -------------------------------- ### Run pyGenomeTracks with Rasterization and Height Settings Source: https://pygenometracks.readthedocs.io/en/latest/content/examples Command-line execution of pyGenomeTracks using a configuration file that includes rasterization and height settings for Hi-C tracks. Specifies region, label fraction, width, DPI, and output file. ```bash $ pyGenomeTracks --tracks browser_tracks_hic_rasterize_height.ini --region X:2500000-2600000 --trackLabelFraction 0.23 --width 38 --dpi 10 -o master_plot_hic_rasterize_height.pdf ``` -------------------------------- ### Install pygenometracks with Conda Source: https://pygenometracks.readthedocs.io/en/latest/content/installation Installs pyGenomeTracks and its dependencies using conda. It creates a new conda environment named 'pygenometracks'. You can specify a particular version of pygenometracks and python. ```bash $ conda create -n pygenometracks -c bioconda -c conda-forge pygenometracks ``` ```bash $ conda create -n pygenometracks -c bioconda -c conda-forge pygenometracks=3.5 python=3.7 ``` -------------------------------- ### Plot MACS2 NarrowPeak Files with pyGenomeTracks Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This example illustrates plotting peaks from MACS2 narrowPeak format using pyGenomeTracks. Various configuration options are shown, including height, max_value, line_width, show_labels, show_data_range, color, use_summit, and width_adjust. The output file visualizes peak start, end, summit, and height. ```bash $ pyGenomeTracks --tracks narrow_peak2.ini --region X:2760000-2802000 --trackLabelFraction 0.2 --dpi 130 -o master_narrowPeak2.png ``` ```ini [narrow] file = test2.narrowPeak height = 4 max_value = 40 line_width = 0.1 title = max_value = 40;line_width = 0.1 [narrow 2] file = test2.narrowPeak height = 2 show_labels = false show_data_range = false color = #00FF0080 use_summit = false title = show_labels = false; show_data_range = false; use_summit = false; color = #00FF0080 [spacer] [narrow 3] file = test2.narrowPeak height = 2 show_labels = false color = #0000FF80 use_summit = false width_adjust = 4 title = show_labels = false; use_summit = false; width_adjust = 4 [spacer] [narrow 4] file = test2.narrowPeak height = 3 type = box color = blue line_width = 2 title = type = box; color = blue; line_width = 2 [spacer] [narrow 5] file = test2.narrowPeak height = 3 type = box color = blue use_summit = false title = type = box; color = blue; use_summit = false [x-axis] ``` -------------------------------- ### BigWig Track with Gene Annotations and Vertical Lines Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This configuration adds vertical lines from a BED file to the previous setup of bigwig and gene tracks. The 'type = vlines' setting enables vertical lines. ```ini [bigwig file test] file = bigwig.bw # height of the track in cm (optional value) height = 4 title = bigwig min_value = 0 max_value = 30 [spacer] # this simply adds an small space between the two tracks. [genes] file = genes.bed.gz height = 7 title = genes fontsize = 10 file_type = bed gene_rows = 10 [x-axis] fontsize=10 [vlines] file = domains.bed type = vlines ``` -------------------------------- ### pyGenomeTracks Bed Track Configuration Example Source: https://pygenometracks.readthedocs.io/en/latest/content/tracks/bed This configuration snippet demonstrates how to set up a 'bed' track in pyGenomeTracks. It includes essential parameters like 'title', 'height', and 'color', along with commented-out options for advanced customization such as 'orientation', 'overlay_previous', and color mapping based on BED file columns. ```text # title of track (plotted on the right side) title = # height of track in cm (ignored if the track is overlay on top the previous track) height = 2 # if you want to plot the track upside-down: # orientation = inverted # if you want to plot the track on top of the previous track. Options are 'yes' or 'share-y'. # For the 'share-y' option the y axis values is shared between this plot and the overlay plot. # Otherwise, each plot use its own scale #overlay_previous = yes # If the bed file contains a column for color (column 9), then this color can be used by # setting: #color = bed_rgb # if color is a valid colormap name (like RbBlGn), then the score (column 5) is mapped # to the colormap. # In this case, the the min_value and max_value for the score can be provided, otherwise # the maximum score and minimum score found are used. #color = RdYlBu #min_value=0 #max_value=100 # If the color is simply a color name, then this color is used and the score is not considered. color = darkblue # optional: line_width #line_width = 0.5 # optional: border_color # default is black. # To remove the border, simply set 'border_color' to none # Not used in tssarrow style #border_color = black # the display parameter defines how the bed file is plotted. # Default is 'stacked' where regions are plotted on different lines so # we can see all regions and all labels. # The other options are ['collapsed', 'interleaved', 'triangles', 'squares', 'deletions', 'inversions'] # These 2 options assume that the regions do not overlap: # `collapsed`: The bed regions are plotted one after the other in one line. ``` -------------------------------- ### MAF Track Configuration in pyGenomeTracks Source: https://pygenometracks.readthedocs.io/en/latest/content/tracks/maf This snippet shows how to configure a MAF track in pyGenomeTracks. It includes necessary parameters like 'file' and 'reference', and various optional parameters for customization such as title, height, colors, and species ordering. The example demonstrates a typical setup for visualizing multiple sequence alignments. ```python # title of track (plotted on the right side) title = # height of track in cm (ignored if the track is overlay on top the previous track) height = 2 # if you want to plot the track upside-down: # orientation = inverted # if you want to plot the track on top of the previous track. Options are 'yes' or 'share-y'. # For the 'share-y' option the y axis values is shared between this plot and the overlay plot. # Otherwise, each plot use its own scale #overlay_previous = yes # In addition to the maf file the reference genome is required: # For example #reference = mm10 # To speed the access to specific region # The maf file needs an index. # The default is the file # followed by '.index'. Alternatively another # file can be specified. # If it does not exists it will be created: #file_index = # Set colors #color_identical = black #color_mismatch = grey #color_gap = lightgrey # Set line_width #line_width = 0.5 # optional: the species order #species_order = hg18 panTro2 # optional if species_order is specified (don't use space in names) #species_labels = human chimpanzee # optional if species_order is specified and they are the only one you want: #species_order_only = true # optional if you want to see the DNA sequence of the ref #display_ref_seq = true # You can choose to rasterize the block part of the maf by using: #rasterize = true # optional: If not given is guessed from the file ending. file_type = maf ``` -------------------------------- ### PyGenomeTracks: Command to generate BED tracks visualization with arrowheads Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This command runs PyGenomeTracks using a configuration file focused on BED tracks and their arrowhead display options. It specifies the region, track label fraction, image dimensions, and output file. ```bash $ pyGenomeTracks --tracks bed_arrow_tracks.ini --region X:3130000-3140000 --trackLabelFraction 0.2 --width 38 --dpi 130 -o master_bed_arrow_zoom.png ``` -------------------------------- ### Configure Epilogos Track with pyGenomeTracks Source: https://pygenometracks.readthedocs.io/en/latest/content/examples This configuration defines an epilogos track for pyGenomeTracks. It requires a qcat file and can optionally include a title and categories file for custom coloring. The output is an image file showing the epilogos visualization. ```ini [epilogos] file = epilog.qcat.bgz height = 5 title = height=5; categories_file=epilog_cats.json [x-axis] ```