Repository revision
1:ef0443c0eaba

Repository 'megan_sam2rma'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/megan_sam2rma

MEGAN: Generate a MEGAN rma6 file tool metadata
Miscellaneous
from a DIAMOND or MALT sam file
megan_sam2rma
toolshed.g2.bx.psu.edu/repos/iuc/megan_sam2rma/megan_sam2rma/6.21.7+galaxy0
6.21.7+galaxy0
None
True
Version lineage of this tool (guids ordered most recent to oldest)
toolshed.g2.bx.psu.edu/repos/iuc/megan_sam2rma/megan_sam2rma/6.21.7+galaxy0 (this tool)
megan_sam2rma
Requirements (dependencies defined in the <requirements> tag set)
name version type
megan 6.21.7 package
Additional information about this tool
#import re

#if str($input_type_cond.input_type) in ['single', 'pair']:
    #set read1 = $input_type_cond.read1
    #set sam1 = $input_type_cond.sam1
#else:
    ## Processing paired reads are tricky if we're
    ## downstream from MALT.  MALT doesn’t have a
    ## paired-read mode, so it won’t attempt to analyze
    ## reads in pairs.  To do paired read processing,
    ## set MALT to generate SAM files and then import the
    ## SAM files into MEGAN, specifying paired read mode
    ## there. If you have multiple SAM files for the same
    ## sample, then import them all at the same time to
    ## create one unified rma6 file.

    #set read1 = $input_type_cond.reads_collection['forward']
    #set sam1 = $input_type_cond.sam1
#end if

#if $read1.is_of_type('fasta', 'fasta.gz'):
    #set read_ext = '.fasta'
#else:
    #set read_ext = '.fastq'
#end if
#if $read1.ext.endswith('.gz'):
    #set read_ext = $read_ext + '.gz'
#end if

#set read1_identifier = 'read1' + $read_ext
ln -s '${read1}' '${read1_identifier}' &&

#set sam1_identifier = 'sam1.' + $sam1.ext
ln -s '${sam1}' '${sam1_identifier}' &&

#if str($input_type_cond.input_type) in ['pair', 'paired']:
    #if str($input_type_cond.input_type) == 'pair':
        #set read2 = $input_type_cond.read2
        #set sam2 = $input_type_cond.sam2
    #else if str($input_type_cond.input_type) == 'paired':
        #set read2 = $input_type_cond.reads_collection['reverse']
        #set sam2 = $input_type_cond.sam2
    #end if
    #set read2_identifier = 'read2' + $read_ext
    ln -s '${read2}' '${read2_identifier}' &&
    #set sam2_identifier = 'sam2.' + $sam2.ext
    ln -s '${sam2}' '${sam2_identifier}' &&
#end if

## The output must be a directory when we have multiple
## inputs, and the outputs inherit the base name of the
## inputs.

sam2rma
#if str($input_type_cond.input_type) == 'single':
    --in '${sam1_identifier}'
    --reads '${read1_identifier}'
    --out '${output_single}'
#else if str($input_type_cond.input_type) == 'pair':
    --in '${sam1_identifier}' '${sam2_identifier}'
    --reads '${read1_identifier}' '${read2_identifier}'
    --paired
    --pairedSuffixLength $input_type_cond.pairedSuffixLength 
    --out '.'
#else if str($input_type_cond.input_type) == 'paired':
    --in '${sam1_identifier}' '${sam2_identifier}'
    --reads '${read1_identifier}' '${read2_identifier}'
    --paired
    --pairedSuffixLength $input_type_cond.pairedSuffixLength 
    ## Strangely, megan requires an output
    ## directory when processing paired reads
    ## even though it produces a single file.
    ## We'll accommodate thie by prepending ./
    ## to a temporary output file and then move
    ## it later.
    --out '.'
#end if
#if $advanced_options.metaDataFile:
    --metaDataFile '$advanced_options.metaDataFile'
#end if
#if str($advanced_options.paired_reads_cond.paired_reads) == 'yes':
    --paired
    $advanced_options.paired_reads_cond.pairedSuffixLength
#end if
$advanced_options.longReads
--maxMatchesPerRead $advanced_options.maxMatchesPerRead
$advanced_options.classify
--minScore $advanced_options.minScore
--maxExpected $advanced_options.maxExpected
--topPercent $advanced_options.topPercent
--minSupportPercent $advanced_options.minSupportPercent
--minSupport $advanced_options.minSupport
--minPercentReadCover $advanced_options.minPercentReadCover
--minPercentReferenceCover $advanced_options.minPercentReferenceCover
--minReadLength $advanced_options.minReadLength
--lcaAlgorithm '$advanced_options.lcaAlgorithm'
--lcaCoveragePercent $advanced_options.lcaCoveragePercent
--readAssignmentMode '$advanced_options.readAssignmentMode'
#if $advanced_options.conFile:
    --conFile '$advanced_options.conFile'
#end if
#if $advanced_options.mapDB:
    --mapDB '$advanced_options.mapDB'
#end if
#if str($advanced_options.only) != '':
    --only '$advanced_options.only'
#end if
--useCompression 'false'
--threads \${GALAXY_SLOTS:-8}
--tempStoreDir '.'
#if str($input_type_cond.input_type) in ['pair', 'paired']:
    && mv 'sam1.rma6' '$output_forward'
    && mv 'sam2.rma6' '$output_reverse'
#end if
    
None
False
Functional tests
name inputs outputs required files
Test-1 input_type_cond|read1: 13-1941-6_S4_L001_R1_600000.fastq.gz
input_type_cond|sam1: input1.sam
name: value
13-1941-6_S4_L001_R1_600000.fastq.gz
input1.sam
value
Test-2 input_type_cond|read1: 13-1941-6_S4_L001_R1_600000.fastq.gz
input_type_cond|sam1: input1.sam
input_type_cond|read2: 13-1941-6_S4_L001_R2_600000.fastq.gz
input_type_cond|sam2: input2.sam
input_type_cond|input_type: pair
name: value
name: value
13-1941-6_S4_L001_R1_600000.fastq.gz
input1.sam
13-1941-6_S4_L001_R2_600000.fastq.gz
input2.sam
value
Test-3 input_type_cond|reads_collection: paired collection
input_type_cond|sam1: input1.sam
input_type_cond|sam2: input2.sam
input_type_cond|input_type: paired
name: value
name: value
13-1941-6_S4_L001_R1_600000.fastq.gz
13-1941-6_S4_L001_R2_600000.fastq.gz
input1.sam
input2.sam
value