# HG changeset patch # User bgruening # Date 1422301565 18000 # Node ID 0895fe70075de47b23e9135fc34e9a64a8c67ec6 # Parent 30caca800c9b17e17c7e2445ffd9fac0e29af33c Uploaded diff -r 30caca800c9b -r 0895fe70075d bismark_bowtie2_wrapper.xml --- a/bismark_bowtie2_wrapper.xml Thu Aug 14 04:46:12 2014 -0400 +++ b/bismark_bowtie2_wrapper.xml Mon Jan 26 14:46:05 2015 -0500 @@ -7,19 +7,14 @@ samtools bowtie2 - - - - - - + bismark_wrapper.py ## Change this to accommodate the number of threads you have available. --num-threads "\${GALAXY_SLOTS:-24}" - ##--bismark_path \$SCRIPT_PATH + --bismark_path \$SCRIPT_PATH --bowtie2 @@ -39,6 +34,7 @@ ## Input parameters ## + #if $singlePaired.sPaired == "single": --single-paired $singlePaired.input_singles @@ -62,17 +58,14 @@ --mate1 #echo ','.join($mate1) --mate2 #echo ','.join($mate2) - #for $mate_pair in $singlePaired.mate_list: - #if $mate_pair.input_mate1.ext == "fastqillumina": - --phred64-quals - --fastq - #elif $mate_pair.input_mate1.ext == "fastqsanger": - --fastq - #elif $mate_pair.input_mate1.ext == "fasta": - --fasta - #end if - #break - #end for + #if $singlePaired.mate_list[0].input_mate1.ext == "fastqillumina": + --phred64-quals + --fastq + #elif $singlePaired.mate_list[0].input_mate1.ext == "fastqsanger": + --fastq + #elif $singlePaired.mate_list[0].input_mate1.ext == "fasta": + --fasta + #end if -I $singlePaired.minInsert -X $singlePaired.maxInsert @@ -282,22 +275,18 @@ - + - - (( - singlePaired['sPaired'] == "paired" and - params['settingsType'] == "custom" and - params['suppressed_read_file'] is True - )) - + singlePaired['sPaired'] == "paired" + params['settingsType'] == "custom" + params['supressed_read_file'] is True @@ -306,9 +295,9 @@ - + @@ -330,22 +319,18 @@ - + - - (( - singlePaired['sPaired'] == "paired" and - params['settingsType'] == "custom" and - params['unmapped_read_file'] is True - )) - + singlePaired['sPaired'] == "paired" + params['settingsType'] == "custom" + params['unmapped_read_file'] is True @@ -354,9 +339,9 @@ - + @@ -656,7 +641,4 @@ always used and its default value is set to 10. - - 10.1093/bioinformatics/btr167 - diff -r 30caca800c9b -r 0895fe70075d bismark_bowtie_wrapper.xml --- a/bismark_bowtie_wrapper.xml Thu Aug 14 04:46:12 2014 -0400 +++ b/bismark_bowtie_wrapper.xml Mon Jan 26 14:46:05 2015 -0500 @@ -7,16 +7,11 @@ samtools bowtie - - - - - - + bismark_wrapper.py - ##--bismark_path \$SCRIPT_PATH + --bismark_path \$SCRIPT_PATH ## ## Bismark Genome Preparation, if desired. @@ -58,17 +53,14 @@ --mate1 #echo ','.join($mate1) --mate2 #echo ','.join($mate2) - #for $mate_pair in $singlePaired.mate_list: - #if $mate_pair.input_mate1.ext == "fastqillumina": - --phred64-quals - --fastq - #elif $mate_pair.input_mate1.ext == "fastqsanger": - --fastq - #elif $mate_pair.input_mate1.ext == "fasta": - --fasta - #end if - #break - #end for + #if $singlePaired.mate_list[0].input_mate1.ext == "fastqillumina": + --phred64-quals + --fastq + #elif $singlePaired.mate_list[0].input_mate1.ext == "fastqsanger": + --fastq + #elif $singlePaired.mate_list[0].input_mate1.ext == "fasta": + --fasta + #end if -I $singlePaired.minInsert -X $singlePaired.maxInsert @@ -259,9 +251,9 @@ - + @@ -279,9 +271,9 @@ - + @@ -303,9 +295,9 @@ - + @@ -322,13 +314,15 @@ - + + + @@ -553,7 +547,4 @@ temporary folder can be either relative or absolute. - - 10.1093/bioinformatics/btr167 - diff -r 30caca800c9b -r 0895fe70075d bismark_methylation_extractor.xml --- a/bismark_methylation_extractor.xml Thu Aug 14 04:46:12 2014 -0400 +++ b/bismark_methylation_extractor.xml Mon Jan 26 14:46:05 2015 -0500 @@ -13,7 +13,7 @@ --infile $input - #--bismark_path \$SCRIPT_PATH + --bismark_path \$SCRIPT_PATH #if $singlePaired.sPaired == "single": --single-end diff -r 30caca800c9b -r 0895fe70075d bismark_wrapper.py --- a/bismark_wrapper.py Thu Aug 14 04:46:12 2014 -0400 +++ b/bismark_wrapper.py Mon Jan 26 14:46:05 2015 -0500 @@ -17,6 +17,7 @@ def __main__(): + print 'tempfile_location',tempfile.gettempdir() #Parse Command Line parser = argparse.ArgumentParser(description='Wrapper for the bismark bisulfite mapper.') parser.add_argument( '-p', '--num-threads', dest='num_threads', @@ -257,6 +258,9 @@ # Final bismark command: cmd = cmd % arguments + print 'bismark_cmd:', cmd + #sys.stderr.write( cmd ) + #sys.exit(1) # Run try: tmp_out = tempfile.NamedTemporaryFile().name @@ -317,8 +321,8 @@ """ #tmp_out = tempfile.NamedTemporaryFile( dir=output_dir ).name tmp_stdout = open( tmp_out, 'wab' ) - #tmp_err = tempfile.NamedTemporaryFile( dir=output_dir ).name - tmp_stderr = open( tmp_err, 'wab' ) + tmp_err = tempfile.NamedTemporaryFile( dir=output_dir ).name + tmp_stderr = open( tmp_err, 'wb' ) tmp_res = tempfile.NamedTemporaryFile( dir= output_dir).name @@ -334,22 +338,18 @@ if returncode != 0: raise Exception, open( tmp_stderr.name ).read() else: - tmp_res = bam_files[0] + tmp_res = bam_files[0] bam_path = "%s" % tmp_res if os.path.exists( bam_path ): - if args.sort_bam: - cmd = 'samtools sort -@ %s %s sorted_bam' % (args.num_threads, bam_path) - proc = subprocess.Popen( args=shlex.split( cmd ) ) - returncode = proc.wait() - if returncode != 0: - raise Exception("Error during '%s'" % cmd) - shutil.move( 'sorted_bam.bam', args.output ) - else: - shutil.move( bam_path, args.output ) + if args.sort_bam: + cmd = 'samtools sort -@ %s %s %s' % (args.num_threads, bam_path, args.output) + else: + shutil.copy( bam_path, args.output ) else: stop_err( 'BAM file no found:\n' + str( bam_path ) ) + # TODO: look for errors in program output.