diff --git a/tool_data_table_conf.xml.sample b/tool_data_table_conf.xml.sample index ad0e387926b..5fc6d376812 100644 --- a/tool_data_table_conf.xml.sample +++ b/tool_data_table_conf.xml.sample @@ -1,3 +1,4 @@ + @@ -34,7 +35,7 @@ value, dbkey, name, path
- + name, value, dbkey, species @@ -65,9 +66,8 @@
-
diff --git a/tools/ngs_rna/tophat_wrapper.py b/tools/ngs_rna/tophat_wrapper.py index 819d7aa993c..21b6a74bb77 100644 --- a/tools/ngs_rna/tophat_wrapper.py +++ b/tools/ngs_rna/tophat_wrapper.py @@ -30,7 +30,7 @@ def __main__(): parser.add_option( '-g', '--max_multihits', dest='max_multihits', help='Maximum number of alignments to be allowed' ) parser.add_option( '', '--seg-mismatches', dest='seg_mismatches', help='Number of mismatches allowed in each segment alignment for reads mapped independently' ) parser.add_option( '', '--seg-length', dest='seg_length', help='Minimum length of read segments' ) - + # Options for supplying own junctions parser.add_option( '-G', '--GTF', dest='gene_model_annotations', help='Supply TopHat with a list of gene model annotations. \ TopHat will use the exon records in this file to build \ @@ -58,18 +58,18 @@ def __main__(): parser.add_option( '', '--max-closure-intron', dest='max_closure_intron', help='Maximum intron length that may be found during closure search' ) parser.add_option( '', '--min-coverage-intron', dest='min_coverage_intron', help='Minimum intron length that may be found during coverage search' ) parser.add_option( '', '--max-coverage-intron', dest='max_coverage_intron', help='Maximum intron length that may be found during coverage search' ) - + # Wrapper options. parser.add_option( '-1', '--input1', dest='input1', help='The (forward or single-end) reads file in Sanger FASTQ format' ) parser.add_option( '-2', '--input2', dest='input2', help='The reverse reads file in Sanger FASTQ format' ) parser.add_option( '', '--single-paired', dest='single_paired', help='' ) parser.add_option( '', '--settings', dest='settings', help='' ) - + (options, args) = parser.parse_args() - + # Creat bowtie index if necessary. tmp_index_dir = tempfile.mkdtemp() - if options.own_file != 'None': + if options.own_file: index_path = os.path.join( tmp_index_dir, os.path.split( options.own_file )[1] ) cmd_index = 'bowtie-build -f %s %s' % ( options.own_file, index_path ) try: @@ -98,12 +98,12 @@ def __main__(): stop_err( 'Error indexing reference sequence\n' + str( e ) ) else: index_path = options.index_path - + # Build tophat command. tmp_output_dir = tempfile.mkdtemp() cmd = 'tophat -o %s %s %s %s' reads = options.input1 - if options.input2 != 'None': + if options.input2: reads += ' ' + options.input2 opts = '-p %s' % options.num_threads if options.single_paired == 'paired': @@ -129,7 +129,7 @@ def __main__(): opts += ' -j %s' % options.raw_juncs if options.no_novel_juncs: opts += ' --no-novel-juncs' - + # Search type options. if options.coverage_search: opts += ' --coverage-search --min-coverage-intron %s --max-coverage-intron %s' % ( options.min_coverage_intron, options.max_coverage_intron ) @@ -143,13 +143,13 @@ def __main__(): opts += ' --microexon-search' if options.single_paired == 'paired': opts += ' --mate-std-dev %s' % options.mate_std_dev - if options.seg_mismatches != None: + if options.seg_mismatches: opts += ' --segment-mismatches %d' % int(options.seg_mismatches) - if options.seg_length != None: + if options.seg_length: opts += ' --segment-length %d' % int(options.seg_length) - if options.min_segment_intron != None: + if options.min_segment_intron: opts += ' --min-segment-intron %d' % int(options.min_segment_intron) - if options.max_segment_intron != None: + if options.max_segment_intron: opts += ' --max-segment-intron %d' % int(options.max_segment_intron) cmd = cmd % ( tmp_output_dir, opts, index_path, reads ) except Exception, e: @@ -160,7 +160,7 @@ def __main__(): shutil.rmtree( tmp_output_dir ) stop_err( 'Something is wrong with the alignment parameters and the alignment could not be run\n' + str( e ) ) print cmd - + # Run try: tmp_out = tempfile.NamedTemporaryFile( dir=tmp_output_dir ).name @@ -185,10 +185,10 @@ def __main__(): tmp_stderr.close() if returncode != 0: raise Exception, stderr - + # TODO: look for errors in program output. - - # Copy output files from tmp directory to specified files. + + # Copy output files from tmp directory to specified files. shutil.copyfile( os.path.join( tmp_output_dir, "junctions.bed" ), options.junctions_output_file ) shutil.copyfile( os.path.join( tmp_output_dir, "accepted_hits.bam" ), options.accepted_hits_output_file ) except Exception, e: diff --git a/tools/ngs_rna/tophat_wrapper.xml b/tools/ngs_rna/tophat_wrapper.xml index 6cf924b258c..9ff552ae64b 100644 --- a/tools/ngs_rna/tophat_wrapper.xml +++ b/tools/ngs_rna/tophat_wrapper.xml @@ -1,4 +1,4 @@ - + Find splice junctions using RNA-seq data tophat @@ -7,46 +7,41 @@ tophat_wrapper.py ## Change this to accommodate the number of threads you have available. --num-threads="4" - + ## Provide outputs. --junctions-output=$junctions --hits-output=$accepted_hits - + ## Handle reference file. #if $refGenomeSource.genomeSource == "history": --own-file=$refGenomeSource.ownFile - --indexes-path="None" #else: - --own-file="None" - --indexes-path=$refGenomeSource.index + --indexes-path="${ filter( lambda x: str( x[0] ) == str( $refGenomeSource.index ), $__app__.tool_data_tables[ 'tophat_indexes' ].get_fields() )[0][-1] }" #end if - + ## Are reads single-end or paired? --single-paired=$singlePaired.sPaired - + ## First input file always required. --input1=$singlePaired.input1 - + ## Set parms based on whether reads are single-end or paired. #if $singlePaired.sPaired == "single": - --input2="None" - -r "None" - --settings=$singlePaired.sParams.sSettingsType - #if $singlePaired.sParams.sSettingsType == "full": - --mate-std-dev="None" - -a $singlePaired.sParams.anchor_length - -m $singlePaired.sParams.splice_mismatches - -i $singlePaired.sParams.min_intron_length - -I $singlePaired.sParams.max_intron_length - -F $singlePaired.sParams.junction_filter - -g $singlePaired.sParams.max_multihits - --min-segment-intron $singlePaired.sParams.min_segment_intron - --max-segment-intron $singlePaired.sParams.max_segment_intron - --seg-mismatches=$singlePaired.sParams.seg_mismatches - --seg-length=$singlePaired.sParams.seg_length - - ## Supplying junctions parameters. - #if $singlePaired.sParams.own_junctions.use_junctions == "Yes": + --settings=$singlePaired.sParams.sSettingsType + #if $singlePaired.sParams.sSettingsType == "full": + -a $singlePaired.sParams.anchor_length + -m $singlePaired.sParams.splice_mismatches + -i $singlePaired.sParams.min_intron_length + -I $singlePaired.sParams.max_intron_length + -F $singlePaired.sParams.junction_filter + -g $singlePaired.sParams.max_multihits + --min-segment-intron $singlePaired.sParams.min_segment_intron + --max-segment-intron $singlePaired.sParams.max_segment_intron + --seg-mismatches=$singlePaired.sParams.seg_mismatches + --seg-length=$singlePaired.sParams.seg_length + + ## Supplying junctions parameters. + #if $singlePaired.sParams.own_junctions.use_junctions == "Yes": #if $singlePaired.sParams.own_junctions.gene_model_ann.use_annotations == "Yes": -G $singlePaired.sParams.own_junctions.gene_model_ann.gene_annotation_model #end if @@ -57,47 +52,47 @@ #if str($singlePaired.sParams.own_junctions.no_novel_juncs) == "Yes": --no-novel-juncs #end if - #end if - - #if $singlePaired.sParams.closure_search.use_search == "Yes": + #end if + + #if $singlePaired.sParams.closure_search.use_search == "Yes": --closure-search --min-closure-exon $singlePaired.sParams.closure_search.min_closure_exon --min-closure-intron $singlePaired.sParams.closure_search.min_closure_intron --max-closure-intron $singlePaired.sParams.closure_search.max_closure_intron - #else: + #else: --no-closure-search - #end if - #if $singlePaired.sParams.coverage_search.use_search == "Yes": + #end if + #if $singlePaired.sParams.coverage_search.use_search == "Yes": --coverage-search --min-coverage-intron $singlePaired.sParams.coverage_search.min_coverage_intron --max-coverage-intron $singlePaired.sParams.coverage_search.max_coverage_intron - #else: + #else: --no-coverage-search - #end if - ## TODO: No idea why the type conversion is necessary, but it seems to be. - #if str($singlePaired.sParams.microexon_search) == "Yes": + #end if + ## TODO: No idea why the type conversion is necessary, but it seems to be. + #if str($singlePaired.sParams.microexon_search) == "Yes": --microexon-search - #end if - #end if - #else: - --input2=$singlePaired.input2 - -r $singlePaired.mate_inner_distance - --settings=$singlePaired.pParams.pSettingsType - #if $singlePaired.pParams.pSettingsType == "full": - --mate-std-dev=$singlePaired.pParams.mate_std_dev - -a $singlePaired.pParams.anchor_length - -m $singlePaired.pParams.splice_mismatches - -i $singlePaired.pParams.min_intron_length - -I $singlePaired.pParams.max_intron_length - -F $singlePaired.pParams.junction_filter - -g $singlePaired.pParams.max_multihits - --min-segment-intron $singlePaired.pParams.min_segment_intron - --max-segment-intron $singlePaired.pParams.max_segment_intron - --seg-mismatches=$singlePaired.pParams.seg_mismatches - --seg-length=$singlePaired.pParams.seg_length - - ## Supplying junctions parameters. - #if $singlePaired.pParams.own_junctions.use_junctions == "Yes": + #end if + #end if + #else: + --input2=$singlePaired.input2 + -r $singlePaired.mate_inner_distance + --settings=$singlePaired.pParams.pSettingsType + #if $singlePaired.pParams.pSettingsType == "full": + --mate-std-dev=$singlePaired.pParams.mate_std_dev + -a $singlePaired.pParams.anchor_length + -m $singlePaired.pParams.splice_mismatches + -i $singlePaired.pParams.min_intron_length + -I $singlePaired.pParams.max_intron_length + -F $singlePaired.pParams.junction_filter + -g $singlePaired.pParams.max_multihits + --min-segment-intron $singlePaired.pParams.min_segment_intron + --max-segment-intron $singlePaired.pParams.max_segment_intron + --seg-mismatches=$singlePaired.pParams.seg_mismatches + --seg-length=$singlePaired.pParams.seg_length + + ## Supplying junctions parameters. + #if $singlePaired.pParams.own_junctions.use_junctions == "Yes": #if $singlePaired.pParams.own_junctions.gene_model_ann.use_annotations == "Yes": -G $singlePaired.pParams.own_junctions.gene_model_ann.gene_annotation_model #end if @@ -108,29 +103,29 @@ #if str($singlePaired.pParams.own_junctions.no_novel_juncs) == "Yes": --no-novel-juncs #end if - #end if - - #if $singlePaired.pParams.closure_search.use_search == "Yes": + #end if + + #if $singlePaired.pParams.closure_search.use_search == "Yes": --closure-search --min-closure-exon $singlePaired.pParams.closure_search.min_closure_exon --min-closure-intron $singlePaired.pParams.closure_search.min_closure_intron --max-closure-intron $singlePaired.pParams.closure_search.max_closure_intron - #else: + #else: --no-closure-search - #end if - #if $singlePaired.pParams.coverage_search.use_search == "Yes": + #end if + #if $singlePaired.pParams.coverage_search.use_search == "Yes": --coverage-search --min-coverage-intron $singlePaired.pParams.coverage_search.min_coverage_intron --max-coverage-intron $singlePaired.pParams.coverage_search.max_coverage_intron - #else: + #else: --no-coverage-search - #end if - ## TODO: No idea why the type conversion is necessary, but it seems to be. - #if str ($singlePaired.pParams.microexon_search) == "Yes": + #end if + ## TODO: No idea why the type conversion is necessary, but it seems to be. + #if str ($singlePaired.pParams.microexon_search) == "Yes": --microexon-search #end if - #end if - #end if + #end if + #end if @@ -140,10 +135,7 @@ - - - - + @@ -186,7 +178,7 @@ - + @@ -196,7 +188,7 @@ - + @@ -242,7 +234,7 @@ - + @@ -276,7 +268,7 @@ - + @@ -286,7 +278,7 @@ - + @@ -325,14 +317,14 @@ - + - + @@ -342,38 +334,46 @@ - + + - - - - - - - - - - - + + + + + + + + + + - + + - + - + @@ -386,19 +386,32 @@ ---> - + - + - - + + @@ -409,18 +422,26 @@ - - + + ---> - + **Tophat Overview**