Skip to content

Instantly share code, notes, and snippets.

@MatthewRalston
Last active August 29, 2015 14:25
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/fd71d1326a897af2e641 to your computer and use it in GitHub Desktop.
Save MatthewRalston/fd71d1326a897af2e641 to your computer and use it in GitHub Desktop.
Galaxy tool for subsampling a fastq file.
<tool name="Random Subsample" id="subsample_fastq" version="0.0.1">
<description>Subsamples a fastq file</description>
<command>
RandomSubFq -w $readsRequested
-i $paired_fastq_files.forward
-i $paired_fastq_files.reverse
-o $paired_list_output.forward
-o $paired_list_output.reverse
</command>
<inputs>
<param name="paired_fastq_files" type="data_collection" collection_type="paired" format="fastq,fastqsanger" label="Paired list of fastq files" help="Read documentation on creating a list of paired files." />
<param name="readsRequested" type="integer" min="1" value="100000" label="Total number of reads you want from the file"/>
</inputs>
<outputs>
<collection name="paired_list_output" type="paired" structured_like="paired_fastq_files" inherits_format="true" label="Subsampled ${on_string}">
<data name="forward" format="fastq" hidden="true"/>
<data name="reverse" format="fastq" hidden="true"/>
</collection>
</outputs>
<stdio>
<exit_code range="-1" level="fatal" description="RandomSubFq failed"/>
</stdio>
<help>
This program randomly sub samples a fastq file
Files need to be in the fastq file and can be gzip compressed
-t can be set with the total number of fastq records in the file (prefered as it keeps from looping over the file twice).
-w needs to be set to the total number of records you want from the file (must be less than total records).
If you pass more than one file to this program at a time it will pull the same records from each file. This is intended behavior for paired end reads.
This program assumes all files provided are of the same size and that paired end reads are in the same order.
</help>
</tool>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment