Mercurial > repos > mvdbeek > igv_take_screenshots
comparison igv_make_screenshots.xml @ 13:1100d5a77c4d draft
planemo upload for repository https://github.com/bardin-lab/readtagger/tree/master/galaxy commit 1ddb87e95baeea2a4ee9b95930da6e0927fb7ff7-dirty
author | mvdbeek |
---|---|
date | Fri, 28 Jul 2017 12:47:05 -0400 |
parents | 9dca6aa224a2 |
children | 9663fa8b9c0b |
comparison
equal
deleted
inserted
replaced
12:9dca6aa224a2 | 13:1100d5a77c4d |
---|---|
1 <tool id="igv_make_screenshots" name="IGV_screenshots" version="0.1.0"> | 1 <tool id="igv_make_screenshots" name="IGV_screenshots" version="0.1.0"> |
2 <requirements> | 2 <requirements> |
3 <requirement type="package" version="0.2.9">xvfbwrapper</requirement> | 3 <requirement type="package" version="0.2.9">xvfbwrapper</requirement> |
4 <requirement type="package" version="2.3.93">igv</requirement> | |
4 </requirements> | 5 </requirements> |
5 <command detect_errors="exit_code"><![CDATA[ | 6 <command detect_errors="exit_code"><![CDATA[ |
6 #for $inputsection in $inputfiles | 7 ln -s '$genome_source.genome' genome.fa && |
7 #set $path="%s.%s" % ($inputsection.input.element_identifier, $inputsection.input.extension) | 8 samtools faidx genome.fa && |
8 sed -i.bak -e "s|$path|\$PWD/$path|g" '$igv_session' && | 9 sed -i.bak -e "s|\"genome.fa\"|\"\$PWD/genome.fa\"|g" '$igv_session' && |
10 #for $i, $inputsection in enumerate($inputfiles): | |
11 #set $path="%s.%s.%s" % ($i, $inputsection.input.element_identifier, $inputsection.input.extension) | |
12 sed -i.bak -e "s|\"$path\"|\"\$PWD/$path\"|g" '$igv_session' && | |
9 ln -fs '$inputsection.input' '$path' && | 13 ln -fs '$inputsection.input' '$path' && |
10 #if $inputsection.input.is_of_type('bam') | 14 #if $inputsection.input.is_of_type('bam') |
11 ln -fs $inputsection.input.metadata.bam_index '$path'.bai && | 15 ln -fs $inputsection.input.metadata.bam_index '$path'.bai && |
12 #end if | 16 #end if |
13 #end for | 17 #end for |
14 ln -fs $igv_session igv_session.xml && | 18 ln -fs $igv_session igv_session.xml && |
15 cat '$load_session' > load_session.txt && | 19 cat '$load_session' > load_session.txt && |
16 echo snapshotDirectory "\$PWD" >> load_session.txt && | 20 echo snapshotDirectory "\$PWD" >> load_session.txt && |
17 cat load_session.txt '$script_file' '$exit_session' > igv_script.txt && | 21 cat load_session.txt '$script_file' '$exit_session' > igv_script.txt && |
18 ## gives the cluster a bit of time to actually create the symlinks ... ughs | 22 cp '$igv_session' '$igv_session_out' && |
19 sleep 10s && | |
20 python $__tool_directory__/xvfb_igv.py igv_script.txt '$igv_preferences' $width,$height && | 23 python $__tool_directory__/xvfb_igv.py igv_script.txt '$igv_preferences' $width,$height && |
21 cp '$igv_session' '$igv_session_out' && | |
22 zip screenshots.zip *.png && | 24 zip screenshots.zip *.png && |
23 cp screenshots.zip '$screenshots_out' | 25 cp screenshots.zip '$screenshots_out' |
24 ]]></command> | 26 ]]></command> |
25 <configfiles> | 27 <configfiles> |
26 <configfile name="igv_session"><![CDATA[#set $genome=$inputfiles[0].input.metadata.dbkey | 28 <configfile name="igv_session"><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
27 <?xml version="1.0" encoding="UTF-8" standalone="no"?> | 29 <Session genome="genome.fa" hasGeneTrack="false" hasSequenceTrack="true" version="8"> |
28 <Session genome="${genome}" hasGeneTrack="true" hasSequenceTrack="true" version="8"> | |
29 <Resources> | 30 <Resources> |
30 #for $inputsection in $inputfiles | 31 #for $i, $inputsection in enumerate($inputfiles): |
31 #set $path="%s.%s" % ($inputsection.input.element_identifier, $inputsection.input.extension) | 32 #set $path="%s.%s.%s" % ($i, $inputsection.input.element_identifier, $inputsection.input.extension) |
32 #set $coverage_id="%s_coverage" % $path | 33 #set $coverage_id="%s_coverage" % $path |
33 <Resource path="$path"/> | 34 <Resource path="$path"/> |
34 #end for | 35 #end for |
35 </Resources> | 36 </Resources> |
36 #for $inputsection in $inputfiles | 37 #for $i, $inputsection in enumerate($inputfiles): |
37 #if $inputsection.input.is_of_type('bam') | 38 #if $inputsection.input.is_of_type('bam') |
38 #set $label=str($inputsection.label) if str($inputsection.label) else str($inputsection.input.element_identifier) | 39 #set $label=str($inputsection.label) if str($inputsection.label) else str($inputsection.input.element_identifier) |
39 #set $path="%s.%s" % ($inputsection.input.element_identifier, $inputsection.input.extension) | 40 #set $path="%s.%s.%s" % ($i, $inputsection.input.element_identifier, $inputsection.input.extension) |
40 <Panel height="$inputsection.section_height" name="Panel${label}" width="$width"> | 41 <Panel height="$inputsection.section_height" name="Panel${label}" width="$width"> |
41 ## First track is the coverage | 42 ## First track is the coverage |
42 <Track altColor="0,0,178" autoScale="true" color="175,175,175" colorScale="ContinuousColorScale;0.0;10.0;255,255,255;175,175,175" displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" id="$coverage_id" name="$label Coverage" showReference="false" snpThreshold="0.2" sortable="true" visible="true"> | 43 <Track altColor="0,0,178" autoScale="true" color="175,175,175" colorScale="ContinuousColorScale;0.0;10.0;255,255,255;175,175,175" displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" id="$coverage_id" name="$label Coverage" showReference="false" snpThreshold="0.2" sortable="true" visible="true"> |
43 <DataRange baseline="0.0" drawBaseline="true" flipAxis="false" maximum="10.0" minimum="0.0" type="LINEAR"/> | 44 <DataRange baseline="0.0" drawBaseline="true" flipAxis="false" maximum="10.0" minimum="0.0" type="LINEAR"/> |
44 </Track> | 45 </Track> |
49 </Panel> | 50 </Panel> |
50 #end if | 51 #end if |
51 #end for | 52 #end for |
52 <Panel height="186" name="FeaturePanel" width="$width"> | 53 <Panel height="186" name="FeaturePanel" width="$width"> |
53 <Track altColor="0,0,178" autoScale="false" color="0,0,178" displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" id="Reference sequence" name="Reference sequence" sortable="false" visible="true"/> | 54 <Track altColor="0,0,178" autoScale="false" color="0,0,178" displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" id="Reference sequence" name="Reference sequence" sortable="false" visible="true"/> |
54 <Track altColor="0,0,178" autoScale="false" clazz="org.broad.igv.track.FeatureTrack" color="0,0,178" colorScale="ContinuousColorScale;0.0;817.0;255,255,255;0,0,178" displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" height="35" id="${genome}_genes" name="Gene" renderer="BASIC_FEATURE" sortable="false" visible="true" windowFunction="count"> | 55 #for $i, $inputsection in enumerate($inputfiles): |
55 <DataRange baseline="0.0" drawBaseline="true" flipAxis="false" maximum="817.0" minimum="0.0" type="LINEAR"/> | |
56 </Track> | |
57 #for $inputsection in $inputfiles | |
58 #if not $inputsection.input.is_of_type('bam') | 56 #if not $inputsection.input.is_of_type('bam') |
59 #set $label=str($inputsection.label) if str($inputsection.label) else str($inputsection.input.element_identifier) | 57 #set $label=str($inputsection.label) if str($inputsection.label) else str($inputsection.input.element_identifier) |
60 #set $path="%s.%s" % ($inputsection.input.element_identifier, $inputsection.input.extension) | 58 #set $path="%s.%s.%s" % ($i, $inputsection.input.element_identifier, $inputsection.input.extension) |
61 <Track altColor="0,0,178" autoScale="false" clazz="org.broad.igv.track.FeatureTrack" color="0,0,178" displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" id="$path" name="$label" renderer="BASIC_FEATURE" sortable="false" visible="true" windowFunction="count"/> | 59 <Track altColor="0,0,178" autoScale="false" clazz="org.broad.igv.track.FeatureTrack" color="0,0,178" displayMode="COLLAPSED" featureVisibilityWindow="-1" fontSize="10" id="$path" name="$label" renderer="BASIC_FEATURE" sortable="false" visible="true" windowFunction="count"/> |
62 #end if | 60 #end if |
63 #end for | 61 #end for |
64 </Panel> | 62 </Panel> |
65 <PanelLayout dividerFractions="0.004995836802664446,0.12905911740216486,0.2681099084096586,0.5512073272273106,0.8409658617818485"/> | 63 <PanelLayout dividerFractions="0.004995836802664446,0.12905911740216486,0.2681099084096586,0.5512073272273106,0.8409658617818485"/> |
74 <configfile name="igv_preferences"> | 72 <configfile name="igv_preferences"> |
75 SAM.SHOW_SOFT_CLIPPED=$show_softclippped | 73 SAM.SHOW_SOFT_CLIPPED=$show_softclippped |
76 </configfile> | 74 </configfile> |
77 </configfiles> | 75 </configfiles> |
78 <inputs> | 76 <inputs> |
77 <conditional name="genome_source"> | |
78 <param name="input_type_selector" type="select" label="Choose the genome source"> | |
79 <option value="cached" selected="True">Built-in references</option> | |
80 <option value="history">Select a fasta file from your history</option> | |
81 </param> | |
82 <when value="cached"> | |
83 <param name="genome" type="select" label="Select a genome"> | |
84 <options from_data_table="fasta_indexes" /> | |
85 </param> | |
86 </when> | |
87 <when value="history"> | |
88 <param name="genome" type="data" format="fasta" label="Select a fasta file as reference genome"/> | |
89 </when> | |
90 </conditional> | |
79 <repeat name="inputfiles" min="1" title="Add tracks"> | 91 <repeat name="inputfiles" min="1" title="Add tracks"> |
80 <param name="input" type="data" format="bam,gff,gtf,bed,vcf" label="Choose an input file"> | 92 <param name="input" type="data" format="bam,gff,gff3,gtf,bed,vcf" label="Choose an input file"/> |
81 <validator type="unspecified_build" /> | |
82 </param> | |
83 <param name="label" type="text" label="Enter a label for this file. If no label is entered the history name will be used"/> | 93 <param name="label" type="text" label="Enter a label for this file. If no label is entered the history name will be used"/> |
84 <param name="section_height" type="integer" value="300" label="Height for this track"/> | 94 <param name="section_height" type="integer" value="300" label="Height for this track"/> |
85 <param name="color_by_tag" type="text" value="CD" label="Enter a BAM/SAM tag that should detrmine the color of a read"> | 95 <param name="color_by_tag" type="text" value="CD" label="Enter a BAM/SAM tag that should detrmine the color of a read"> |
86 <sanitizer invalid_char=""> | 96 <sanitizer invalid_char=""> |
87 <valid initial="string.letters,string.digits"><add value="_" /> </valid> | 97 <valid initial="string.letters,string.digits"><add value="_" /> </valid> |
95 </inputs> | 105 </inputs> |
96 <outputs> | 106 <outputs> |
97 <data name="igv_session_out" format="xml"/> | 107 <data name="igv_session_out" format="xml"/> |
98 <data name="screenshots_out" format="zip"/> | 108 <data name="screenshots_out" format="zip"/> |
99 </outputs> | 109 </outputs> |
110 <tests> | |
111 <test> | |
112 <param name="genome_source|input_type_selector" value="history"/> | |
113 <param name="genome_source|genome" value="rover_reference.fa"/> | |
114 <repeat name="inputfiles"> | |
115 <param name="input" value="rover_corrected.bam"/> | |
116 </repeat> | |
117 <output name="igv_session_out" file="igv_session.xml" lines_diff="6"/> | |
118 </test> | |
119 </tests> | |
100 <help><![CDATA[ | 120 <help><![CDATA[ |
101 TODO: Fill in help. | 121 This tool can automate taking screenshots using IGV. |
122 It takes as input a reference genome, an IGV script file (bedtools igv can produce such a file) | |
123 and a variable number of BAM,GFF,GTF,BED or VCF files, and produces a zip file containing screenshots for each genomic region in the IGV script file. | |
102 ]]></help> | 124 ]]></help> |
125 <citations> | |
126 <citation type="doi">10.1093/bib/bbs017</citation> | |
127 </citations> | |
103 </tool> | 128 </tool> |