Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lldelisle committed Feb 2, 2023
1 parent b5142ff commit 117ce39
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 45 deletions.
53 changes: 42 additions & 11 deletions tools/rgrnastar/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
<citation type="doi">10.1093/bioinformatics/bts635</citation>
</citations>
</xml>
<xml name="@SJDBOPTIONS@" token_optional="true">
<param argument="--sjdbGTFfile" type="data" format="gff3,gtf" label="Gene model (gff3,gtf) file for splice junctions" optional="@OPTIONAL@" help="Exon junction information for mapping splices"/>
<xml name="SJDBOPTIONS">
<param argument="--sjdbGTFfile" type="data" format="gff3,gtf" label="Gene model (gff3,gtf) file for splice junctions" optional="false" help="Exon junction information for mapping splices"/>
<param argument="--sjdbOverhang" type="integer" min="1" value="100" label="Length of the genomic sequence around annotated junctions" help="Used in constructing the splice junctions database. Ideal value is ReadLength-1"/>
</xml>
<xml name="dbKeyActions">
Expand Down Expand Up @@ -129,17 +129,15 @@
#else:
'${refGenomeSource.GTFconditional.genomeDir.fields.path}'
## Handle difference between indices with/without annotations
#if str($refGenomeSource.GTFconditional.GTFselect) == 'without-gtf':
#if $refGenomeSource.GTFconditional.sjdbGTFfile:
--sjdbOverhang $refGenomeSource.GTFconditional.sjdbOverhang
--sjdbGTFfile '${refGenomeSource.GTFconditional.sjdbGTFfile}'
#if str($refGenomeSource.GTFconditional.sjdbGTFfile.ext) == 'gff3':
--sjdbGTFtagExonParentTranscript Parent
#end if
#if str($refGenomeSource.GTFconditional.GTFselect) == 'without-gtf-with-gtf':
--sjdbOverhang $refGenomeSource.GTFconditional.sjdbOverhang
--sjdbGTFfile '${refGenomeSource.GTFconditional.sjdbGTFfile}'
#if str($refGenomeSource.GTFconditional.sjdbGTFfile.ext) == 'gff3':
--sjdbGTFtagExonParentTranscript Parent
#end if
#end if
#end if
]]></token>
#end if
]]></token>
<token name="@READSHANDLING@" ><![CDATA[
## Check that the input pairs are of the same type
## otherwise STARsolo will run for a long time and then error out.
Expand Down Expand Up @@ -364,4 +362,37 @@
</change_format>
</data>
</xml>
<xml name="quantMode">
<conditional name="quantmode_output">
<param argument="--quantMode" type="select"
label="Per gene/transcript output"
help="STAR can provide analysis results not only with respect to the reference genome, but also with respect to genes and transcripts described by a gene model. Note: This functionality requires either the selection above of a cached index with a gene model, or a gene model provided alongside the index/reference genome in GTF or GFF3 format!">
<option value="-">No per gene or transcript output</option>
<option value="GeneCounts">Per gene read counts (GeneCounts)</option>
<option value="TranscriptomeSAM">Transcript-based BAM output (TranscriptomeSAM)</option>
<option value="TranscriptomeSAM GeneCounts">Both per gene read counts and transcript-based BAM output (TranscriptomeSAM GeneCounts)</option>
</param>
<when value="-" />
<when value="GeneCounts" />
<when value="TranscriptomeSAM">
<param argument="--quantTranscriptomeBan" type="boolean" truevalue="IndelSoftclipSingleend" falsevalue="Singleend"
label="Exclude alignments with indels or soft clipping from the transcriptome BAM output?"
help="You will need to exclude alignments with indels and soft-clipped bases from the transcriptome BAM output for compatibility with certain transcript quantification tools, most notably RSEM. If you are using a tool, like eXpress, that can deal with indels and soft-clipped bases, you can achieve better results by leaving this option disabled." />
</when>
<when value="TranscriptomeSAM GeneCounts">
<param argument="--quantTranscriptomeBan" type="boolean" truevalue="IndelSoftclipSingleend" falsevalue="Singleend"
label="Exclude alignments with indels or soft clipping from the transcriptome BAM output?"
help="You will need to exclude alignments with indels and soft-clipped bases from the transcriptome BAM output for compatibility with certain transcript quantification tools, most notably RSEM. If you are using a tool, like eXpress, that can deal with indels and soft-clipped bases, you can achieve better results by leaving this option disabled." />
</when>
</conditional>
</xml>
<xml name="quantModeNoGTF">
<conditional name="quantmode_output">
<param argument="--quantMode" type="select"
label="Per gene/transcript output">
<option value="-">No per gene or transcript output as no GTF was provided</option>
</param>
<when value="-" />
</conditional>
</xml>
</macros>
86 changes: 54 additions & 32 deletions tools/rgrnastar/rg_rnaStar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
#end if
#end if
--quantMode ${quantmode_output.quantMode}
#if 'TranscriptomeSAM' in str($quantmode_output.quantMode):
--quantTranscriptomeBan ${quantmode_output.quantTranscriptomeBan}
--quantMode ${refGenomeSource.GTFconditional.quantmode_output.quantMode}
#if 'TranscriptomeSAM' in str($refGenomeSource.GTFconditional.quantmode_output.quantMode):
--quantTranscriptomeBan ${refGenomeSource.GTFconditional.quantmode_output.quantTranscriptomeBan}
#end if
## Output format parameters
Expand Down Expand Up @@ -242,7 +242,7 @@
&&
## recompress BAM output for smaller file size
samtools view -b -o '$mapped_reads' Aligned.sortedByCoord.out.bam
#if 'TranscriptomeSAM' in str($quantmode_output.quantMode):
#if 'TranscriptomeSAM' in str($refGenomeSource.GTFconditional.quantmode_output.quantMode):
## same recompression for optional transcriptome BM
&&
samtools view -b -o '$transcriptome_mapped_reads' Aligned.toTranscriptome.out.bam
Expand Down Expand Up @@ -282,15 +282,22 @@
<param name="GTFselect" type="select"
label="Reference genome with or without an annotation"
help="Select the '... with builtin gene-model' option to select from the list of available indexes that were built with splice junction information. Select the '... without builtin gene-model' option to select from the list of available indexes without annotated splice junctions, and, optionally, provide your own splice-junction annonations.">
<option value="without-gtf" selected='true'>use genome reference without builtin gene-model</option>
<option value="without-gtf-with-gtf" selected='true'>use genome reference without builtin gene-model but provide a gtf</option>
<option value="without-gtf">use genome reference without builtin gene-model and do not provide a gtf</option>
<option value="with-gtf">use genome reference with builtin gene-model</option>
</param>
<when value="with-gtf">
<expand macro="index_selection" with_gene_model="1" />
<expand macro="quantMode" />
</when>
<when value="without-gtf-with-gtf">
<expand macro="index_selection" with_gene_model="0" />
<expand macro="SJDBOPTIONS"/>
<expand macro="quantMode" />
</when>
<when value="without-gtf">
<expand macro="index_selection" with_gene_model="0" />
<expand macro="@SJDBOPTIONS@" />
<expand macro="quantModeNoGTF" />
</when>
</conditional>
</when>
Expand All @@ -304,9 +311,12 @@
<option value="with-gtf">build index with gene-model</option>
</param>
<when value="with-gtf">
<expand macro="@SJDBOPTIONS@" optional="false"/>
<expand macro="SJDBOPTIONS"/>
<expand macro="quantMode" />
</when>
<when value="without-gtf">
<expand macro="quantModeNoGTF" />
</when>
<when value="without-gtf" />
</conditional>
</when>
</conditional>
Expand Down Expand Up @@ -338,28 +348,6 @@
label="Pregenerated splice junctions datasets of your samples" />
</when>
</conditional>
<conditional name="quantmode_output">
<param argument="--quantMode" type="select"
label="Per gene/transcript output"
help="STAR can provide analysis results not only with respect to the reference genome, but also with respect to genes and transcripts described by a gene model. Note: This functionality requires either the selection above of a cached index with a gene model, or a gene model provided alongside the index/reference genome in GTF or GFF3 format!">
<option value="-">No per gene or transcript output</option>
<option value="GeneCounts">Per gene read counts (GeneCounts)</option>
<option value="TranscriptomeSAM">Transcript-based BAM output (TranscriptomeSAM)</option>
<option value="TranscriptomeSAM GeneCounts">Both per gene read counts and transcript-based BAM output (TranscriptomeSAM GeneCounts)</option>
</param>
<when value="-" />
<when value="GeneCounts" />
<when value="TranscriptomeSAM">
<param argument="--quantTranscriptomeBan" type="boolean" truevalue="IndelSoftclipSingleend" falsevalue="Singleend"
label="Exclude alignments with indels or soft clipping from the transcriptome BAM output?"
help="You will need to exclude alignments with indels and soft-clipped bases from the transcriptome BAM output for compatibility with certain transcript quantification tools, most notably RSEM. If you are using a tool, like eXpress, that can deal with indels and soft-clipped bases, you can achieve better results by leaving this option disabled." />
</when>
<when value="TranscriptomeSAM GeneCounts">
<param argument="--quantTranscriptomeBan" type="boolean" truevalue="IndelSoftclipSingleend" falsevalue="Singleend"
label="Exclude alignments with indels or soft clipping from the transcriptome BAM output?"
help="You will need to exclude alignments with indels and soft-clipped bases from the transcriptome BAM output for compatibility with certain transcript quantification tools, most notably RSEM. If you are using a tool, like eXpress, that can deal with indels and soft-clipped bases, you can achieve better results by leaving this option disabled." />
</when>
</conditional>
<param argument="--chimOutType" type="select"
label="Report chimeric alignments?"
help="Choose if and how chimeric alignments should be reported. STAR-Fusion users should select the 'Junctions' option and use the resulting tabular dataset as input to STAR-Fusion. Everyone else: note that selecting 'WithinBAM' or 'WithinBAM Junctions' disables the --chimMultimapNmax setting in the algorithmic parameters section below (the tool will only consider uniquely mapped reads in the search for chimeric alignments). If you disable the reporting of chimeric alignments here, then all chimeric alignment settings in the algorithmic parameters section below will be ignored.">
Expand Down Expand Up @@ -550,12 +538,12 @@ used: >=5 mappings => MAPQ=0; 3-4 mappings => MAPQ=1; 2 mappings => MAPQ=3. This
</data>

<data name="transcriptome_mapped_reads" format="unsorted.bam" label="${tool.name} on ${on_string}: transcriptome-mapped.bam" >
<filter>'TranscriptomeSAM' in quantmode_output['quantMode']</filter>
<filter>'TranscriptomeSAM' in refGenomeSource['GTFconditional']['quantmode_output']['quantMode']</filter>
<expand macro="dbKeyActions" />
</data>

<data name="reads_per_gene" format="tabular" label="${tool.name} on ${on_string}: reads per gene" from_work_dir="ReadsPerGene.out.tab">
<filter>'GeneCounts' in quantmode_output['quantMode']</filter>
<filter>'GeneCounts' in refGenomeSource['GTFconditional']['quantmode_output']['quantMode']</filter>
<expand macro="dbKeyActions" />
<expand macro="outCountActions" />
</data>
Expand Down Expand Up @@ -680,6 +668,40 @@ used: >=5 mappings => MAPQ=0; 3-4 mappings => MAPQ=1; 2 mappings => MAPQ=3. This
<output name="mapped_reads" file="rnastar_test_mapped_reads.bam" compare="sim_size" delta="634" />
<output name="transcriptome_mapped_reads" file="rnastar_test_transcriptome_mapped_reads.bam" compare="sim_size" delta="634" />
</test>
<!-- test cached no index but gtf file and GeneCounts TranscriptomeSAM mode -->
<test expect_num_outputs="5">
<conditional name="singlePaired">
<param name="sPaired" value="single" />
<param name="input1" value="tophat_in2.fastqsanger" ftype="fastqsanger" />
</conditional>
<conditional name="refGenomeSource">
<param name="geneSource" value="indexed" />
<conditional name="GTFconditional">
<param name="GTFselect" value="without-gtf-with-gtf" />
<param name="genomeDir" value="000" />
<param name="sjdbOverhang" value="75"/>
<param name="sjdbGTFfile" value="test1.gtf" ftype="gtf"/>
</conditional>
</conditional>
<conditional name="quantmode_output">
<param name="quantMode" value="TranscriptomeSAM GeneCounts"/>
</conditional>
<section name="oformat">
<param name="outSAMattributes" value="NH,HI,AS,nM,NM,MD,jM,jI,MC,ch" />
<param name="outSAMmapqUnique" value="255" />
</section>
<section name="algo">
<conditional name="params">
<param name="settingsType" value="default" />
</conditional>
</section>

<output name="output_log" file="rnastar_test.log" compare="re_match_multiline" />
<output name="splice_junctions" file="rnastar_test_splicejunctions.bed"/>
<output name="mapped_reads" file="rnastar_test_mapped_reads.bam" compare="sim_size" delta="634" />
<output name="reads_per_gene" file="tophat_test_reads_per_gene.txt" />
<output name="transcriptome_mapped_reads" file="rnastar_test_transcriptome_mapped_reads.bam" compare="sim_size" delta="634" />
</test>
<test expect_num_outputs="3">
<conditional name="singlePaired">
<param name="sPaired" value="single" />
Expand Down
4 changes: 2 additions & 2 deletions tools/rgrnastar/rg_rnaStarSolo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@
</when>
<when value="without-gtf">
<expand macro="index_selection" with_gene_model="0" />
<expand macro="@SJDBOPTIONS@" optional="false" />
<expand macro="SJDBOPTIONS"/>
</when>
</conditional>
</when>
<when value="history">
<expand macro="ref_selection" />
<expand macro="@SJDBOPTIONS@" optional="false"/>
<expand macro="SJDBOPTIONS"/>
</when>
</conditional>
<conditional name="sc" >
Expand Down

0 comments on commit 117ce39

Please sign in to comment.