Skip to content

Instantly share code, notes, and snippets.

@MatthewRalston
Created July 15, 2015 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MatthewRalston/07c5c78bb50c9ec351f6 to your computer and use it in GitHub Desktop.
Save MatthewRalston/07c5c78bb50c9ec351f6 to your computer and use it in GitHub Desktop.
Galaxy tool for summarizing fastqc information
<tool name="Summarize FastQC" id="summarizeFastQCMetrics" version="0.0.1">
<description>summarizes data from FastQC</description>
<command>
#def pairfunc($theList)
#set $left = []
#set $right = []
#for $file1, $file2 in $theList
#$left.append(str($file1))
#$right.append(str($file2))
#end for
#return $left, $right
#end def
#def singlefunc($theList)
#set $single = []
#for $file in $theList
#$single.append(str($file))
#end for
#return $single
#end def
#set $single = []
#set $left = []
#set $right = []
#if str( $single_vs_paired.single_vs_paired_selector ) == "list_of_paired_files"
#set $l, $r = $pairfunc($single_vs_paired.paired_fastqc_results)
#set $left += $l
#set $right += $r
#elif str( $single_vs_paired.single_vs_paired_selector ) == "list_of_files"
#set $single += $singlefunc($single_vs_paired.list_fastqc_results)
#elif str( $single_vs_paired.single_vs_paired_selector ) == "single_files"
#set $single += $singlefunc($single_vs_paired.single_fastqc_results)
#else
exit 1
#end if
#set $files = ",".join($left + $right + $single)
summarizeFastQCMetrics.rb $files > $outFile
</command>
<inputs>
<conditional name="single_vs_paired">
<param name="single_vs_paired_selector" type="select" label="What type of FastQC results do you have?">
<option value="list_of_paired_files">Paired TXT results from FastQC on paired-end fastq files</option>
<option value="list_of_files">List of TXT results from FastQC.</option>
<option value="single_files">TXT results from FastQC on single fastq files.</option>
</param>
<when value="list_of_paired_files">
<param name="paired_fastqc_results" type="data_collection" collection_type="list:paired" format="txt" label="Paired list of FastQC results" help="When you've run FastQC on a list of paired end fastq files." />
</when>
<when value="list_of_files">
<param name="list_fastqc_results" type="data_collection" collection_type="list" format="txt" label="List of FastQC results" help="When you've run FastQC on a list of fastq files." />
</when>
<when value="single_files">
<param name="single_fastqc_results" type="data" format="txt" multiple="true" label="FastQC results on single fastq files." help="When you've run FastQC on single fastq files" />
</when>
</conditional>
</inputs>
<outputs>
<data name="outFile" format="tabular" label="${tool.name} on ${on_string}: Tabular summary of FastQC"/>
</outputs>
<tests>
<test>
</test>
</tests>
<stdio>
<exit_code range="1:" level="fatal"/>
</stdio>
<help>
.. class:: infomark
**Purpose**
Merges results from FastQC on fastqc files into a single matrix.
</help>
</tool>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment