# HG changeset patch # User drosofff # Date 1399965285 14400 # Node ID cb331ca63e04fa18a0202188e878d2326ee962e4 # Parent 752bd9400127ea1ee665e8fb0a012e3391838a7a Deleted selected files diff -r 752bd9400127 -r cb331ca63e04 bowtie_indices_ged.loc.sample --- a/bowtie_indices_ged.loc.sample Mon May 12 12:24:28 2014 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -#This is a file adapted from bowtie_indices.loc -# -# -Dmel /home/galaxy/galaxy-dist/bowtie/Dmel/dmel-all-chromosome-r5.49 -Dmel_2R /home/galaxy/galaxy-dist/bowtie/Dmel_2R/Dmel_2R -Dmel_all-gene_extended2000 /home/galaxy/galaxy-dist/bowtie/Dmel_all-gene_extended2000/dmel-all-gene_extended2000-r5.49 -Dmel_all_genes /home/galaxy/galaxy-dist/bowtie/Dmel_all-gene/Dmel_all-gene -Dmel_all-intergenic /home/galaxy/galaxy-dist/bowtie/Dmel_all-intergenic/dmel-all-intergenic-r5.49 -Dmel_all-intron /home/galaxy/galaxy-dist/bowtie/Dmel_all-intron/dmel-all-intron-r5.49 -Dmel_all-miscRNA /home/galaxy/galaxy-dist/bowtie/Dmel_all-miscRNA/dmel-all-miscRNA-r5.49 -Dmel_all-ncRNA /home/galaxy/galaxy-dist/bowtie/Dmel_all-ncRNA/dmel-all-ncRNA-r5.49 -Dmel_all-tRNA /home/galaxy/galaxy-dist/bowtie/Dmel_all-tRNA/dmel-all-tRNA-r5.49 -Ensembl_extented_tRNA /home/galaxy/galaxy-dist/bowtie/Ensembl_Dmel_extended_tRNA/Ensembl_Dmel_extended_tRNA -Dmel_all-transcript /home/galaxy/galaxy-dist/bowtie/Dmel_all-transcript/dmel-all-transcript-r5.49 -Dmel_all-transposon /home/galaxy/galaxy-dist/bowtie/Dmel_all-transposon/dmel-all-transposon-r5.49 -Dmel_all-transposon_merge /home/galaxy/galaxy-dist/bowtie/Dmel_all-transposon_merged/Dmel_all-transposon_merge -Dmel_all-transposon_merge_minBrennecke /home/galaxy/galaxy-dist/bowtie/Dmel_all-transposon_merged_min_Brennecke/Dmel_all-transposon_merged_min_Brennecke -Transposons_set_BDGBv941 /home/galaxy/galaxy-dist/bowtie/transposons_set/Dmel_transposon_set_BDGP_v941 -Ensembl_transposon_set /home/galaxy/galaxy-dist/bowtie/Ensembl_transposon_set/Ensembl_transposon_set -piRNA_clusters /home/galaxy/galaxy-dist/bowtie/piRNA_clusters/piRNA_clusters -dme_miR_r18 /home/galaxy/galaxy-dist/bowtie/dme_miR_r18/dme_miR_r18 -dme_miR_r20 /home/galaxy/galaxy-dist/bowtie/dme_miR_r20/dme_miR_r20 -mmus_miR_r19 /home/galaxy/galaxy-dist/bowtie/mmus_miR_r19/mmus_miR_r19 -mmus_miR_r20 /home/galaxy/galaxy-dist/bowtie/mmus_miR_r20/mmus_miR_r20 -hs_miR_r18 /home/galaxy/galaxy-dist/bowtie/hs_miR_r18/hs_miR_r18 -PlacW /home/galaxy/galaxy-dist/bowtie/PlacW/PlacW -#PlacZ_common /home/galaxy/galaxy-dist/bowtie/PlacZ_common/PlacZ_common -#P1152 /home/galaxy/galaxy-dist/bowtie/P1152/P1152 -P1152 /home/galaxy/galaxy-dist/bowtie/complete_P1152/complete_P1152 -P-element /home/galaxy/galaxy-dist/bowtie/P-element/P-element -esi1_esi2 /home/galaxy/galaxy-dist/bowtie/esi1_esi2/esi1_esi2 -EGFP /home/galaxy/galaxy-dist/bowtie/EGFP/EGFP -TasB /home/galaxy/galaxy-dist/bowtie/TasB/TasB -TAS2R /home/galaxy/galaxy-dist/bowtie/TAS2R/TAS2R -TAS3R /home/galaxy/galaxy-dist/bowtie/TAS3R/TAS3R -mm9 /home/galaxy/galaxy-dist/bowtie/mm9/mm9 -42AB /home/galaxy/galaxy-dist/bowtie/42AB/42AB -flamenco /home/galaxy/galaxy-dist/bowtie/flamenco/flamenco -insect_viruses /home/galaxy/galaxy-dist/bowtie/insect_viruses/viruses -#David_mmus_r19 /home/galaxy/galaxy-dist/bowtie/David_mmus_r19/David_mmus_r19 -Onyong /home/galaxy/galaxy-dist/bowtie/Onyong/Onyong -A.gambiae_redundant /home/galaxy/galaxy-dist/bowtie/AgamP3.17/AgamP3.17 -A.gambiae_masked /home/galaxy/galaxy-dist/bowtie/Agam_Pest3/Agam_Pest3 -Agam_all-cDNAs /home/galaxy/galaxy-dist/bowtie/AgamP3.17_all-transcripts/AgamP3.17_all-transcripts -AgamP3.17_all_stranded_genes /home/galaxy/galaxy-dist/bowtie/AgamP3.17_all_stranded_genes/AgamP3.17_all_stranded_genes -Agam_ribosomal /home/galaxy/galaxy-dist/bowtie/Agam_ribosomal/Agam_ribosomal -Agam_miR_r19 /home/galaxy/galaxy-dist/bowtie/aga_miR_r19/aga_miR_r19 -AgamP3.17_miscRNA-rRNA-snoRNA-snRNA-tRNA /home/galaxy/galaxy-dist/bowtie/AgamP3.17_miscRNA-rRNA-snoRNA-snRNA-tRNA/AgamP3.17_miscRNA-rRNA-snoRNA-snRNA-tRNA -AgamP3.17_RepeatMasker /home/galaxy/galaxy-dist/bowtie/AgamP3.17_RepeatMasker/AgamP3.17_RepeatMasker diff -r 752bd9400127 -r cb331ca63e04 sRbowtie_wrapper.py --- a/sRbowtie_wrapper.py Mon May 12 12:24:28 2014 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -#!/usr/bin/env python -# generic bowtie wrapper for bowtie, small RNA oriented -# version 1 17-1-2014 -# Usage sRbowtie_wrapper.py <1 input_fasta_file> <2 alignment method> <3 -v mismatches> <4 out_type> <5 buildIndexIfHistory> <6 fasta/bowtie index> <7 bowtie output> <8 ali_fasta> <9 unali_fasta> - -import sys, re, os, subprocess, shlex, tempfile, shutil - -def stop_err( msg ): - sys.stderr.write( '%s\n' % msg ) - sys.exit() - -def bowtieCommandLiner (alignment_method, v_mis, out_type, aligned, unaligned, input, index, output): - if alignment_method=="RNA": - x = "-v %s -M 1 --best --strata -p 12 --norc --suppress 2,6,7,8" % v_mis - elif alignment_method=="unique": - x = "-v %s -m 1 -p 12 --suppress 6,7,8" % v_mis - elif alignment_method=="multiple": - x = "-v %s -M 1 --best --strata -p 12 --suppress 6,7,8" % v_mis - elif alignment_method=="k_option": - x = "-v %s -k 1 --best -p 12 --suppress 6,7,8" % v_mis - elif alignment_method=="n_option": - x = "-n %s -M 1 --best -p 12 --suppress 6,7,8" % v_mis - elif alignment_method=="a_option": - x = "-v %s -a --best -p 12 --suppress 6,7,8" % v_mis - if aligned == "None" and unaligned == "None": fasta_command = "" - elif aligned != "None" and unaligned == "None": fasta_command= " --al %s" % aligned - elif aligned == "None" and unaligned != "None": fasta_command = " --un %s" % unaligned - else: fasta_command = " --al %s --un %s" % (aligned, unaligned) - x = x + fasta_command - if out_type == "tabular": - return "bowtie %s %s -f %s > %s" % (x, index, input, output) - elif out_type=="sam": - return "bowtie %s -S %s -f %s > %s" % (x, index, input, output) - elif out_type=="bam": - return "bowtie %s -S %s -f %s |samtools view -bS - > %s" % (x, index, input, output) - -def bowtie_squash(fasta): - # make temp directory for placement of indices and copy reference file there if necessary - tmp_index_dir = tempfile.mkdtemp() - ref_file = tempfile.NamedTemporaryFile( dir=tmp_index_dir ) - ref_file_name = ref_file.name - ref_file.close() # by default, this action delete the temporary file ! - os.symlink( fasta, ref_file_name ) # now there is a symlink between the fasta source file and the deleted ref_file name - cmd1 = 'bowtie-build -f %s %s' % (ref_file_name, ref_file_name ) # this will work with the bowtie command line but we have to change the working dir ! - try: - FNULL = open(os.devnull, 'w') - tmp = tempfile.NamedTemporaryFile( dir=tmp_index_dir ).name # a full path temp file to tmp_index_dir is created. just a string - tmp_stderr = open( tmp, 'wb' ) # creates and open the file handler - proc = subprocess.Popen( args=cmd1, shell=True, cwd=tmp_index_dir, stderr=FNULL, stdout=FNULL ) # fileno() method return the file descriptor number of tmp_stderr / stderr=tmp_stderr.fileno() - # here I played a while a finish by redirecting everythin in dev/null. Clean later tmp_stderr calls - returncode = proc.wait() - tmp_stderr.close() - FNULL.close() - sys.stdout.write(cmd1 + "\n") - except Exception, e: - # clean up temp dir - if os.path.exists( tmp_index_dir ): - shutil.rmtree( tmp_index_dir ) - stop_err( 'Error indexing reference sequence\n' + str( e ) ) - # no Cleaning if no Exception, to be cleaned later after bowtie alignment - index_full_path = os.path.join(tmp_index_dir, ref_file_name) # bowtie fashion path (without extention) ... - return tmp_index_dir, index_full_path - -def bowtie_alignment(command_line, flyPreIndexed=''): - # make temp directory just for stderr - tmp_index_dir = tempfile.mkdtemp() - tmp = tempfile.NamedTemporaryFile( dir=tmp_index_dir ).name - tmp_stderr = open( tmp, 'wb' ) - # conditional statement for sorted bam generation viewable in Trackster - if "samtools" in command_line: - target_file = command_line.split()[-1] # recover the final output file name - path_to_unsortedBam = os.path.join(tmp_index_dir, "unsorted.bam") - path_to_sortedBam = os.path.join(tmp_index_dir, "unsorted.bam.sorted") - first_command_line = " ".join(command_line.split()[:-3]) + " -o " + path_to_unsortedBam + " - " # example: bowtie -v 0 -M 1 --best --strata -p 12 --suppress 6,7,8 -S /home/galaxy/galaxy-dist/bowtie/Dmel/dmel-all-chromosome-r5.49 -f /home/galaxy/galaxy-dist/database/files/003/dataset_3460.dat |samtools view -bS -o /tmp/tmp_PgMT0/unsorted.bam - - second_command_line = "samtools sort %s %s" % (path_to_unsortedBam, path_to_sortedBam) # Be carreful : this indeed will generate an unsorted.bam.sorted.bam file, NOT a unsorted.bam.sorted file - p = subprocess.Popen(args=first_command_line, cwd=tmp_index_dir, shell=True, stderr=tmp_stderr.fileno()) - returncode = p.wait() - sys.stdout.write("%s\n" % first_command_line + str(returncode)) - p = subprocess.Popen(args=second_command_line, cwd=tmp_index_dir, shell=True, stderr=tmp_stderr.fileno()) - returncode = p.wait() - sys.stdout.write("\n%s\n" % second_command_line + str(returncode)) - if os.path.isfile(path_to_sortedBam + ".bam"): - shutil.copy2(path_to_sortedBam + ".bam", target_file) - else: - p = subprocess.Popen(args=command_line, shell=True, stderr=tmp_stderr.fileno()) - returncode = p.wait() - sys.stdout.write(command_line + "\n") - tmp_stderr.close() - ## cleaning if the index was created in the fly - if os.path.exists( flyPreIndexed ): - shutil.rmtree( flyPreIndexed ) - # cleaning tmp files and directories - if os.path.exists( tmp_index_dir ): - shutil.rmtree( tmp_index_dir ) - return - -def __main__(): - F = open (sys.argv[-3], "w") - if sys.argv[5] == "history": - tmp_dir, index_path = bowtie_squash(sys.argv[6]) - else: - tmp_dir, index_path = "dummy/dymmy", sys.argv[6] - command_line = bowtieCommandLiner(sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[-2], sys.argv[-1], sys.argv[1], index_path, sys.argv[7]) - bowtie_alignment(command_line, flyPreIndexed=tmp_dir) - F.close() -if __name__=="__main__": __main__() diff -r 752bd9400127 -r cb331ca63e04 sRbowtie_wrapper.xml --- a/sRbowtie_wrapper.xml Mon May 12 12:24:28 2014 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ - - small RNA oriented - bowtie - - sRbowtie_wrapper.py $input - $method - $v_mismatches - $output_type - $refGenomeSource.genomeSource - ## the very source of the index (indexed or fasta file) - #if $refGenomeSource.genomeSource == "history": - $refGenomeSource.ownFile - #else: - $refGenomeSource.index - #end if - ## - $output - $aligned - $unaligned - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - additional_fasta == "al" or additional_fasta == "al_and_unal" - - - additional_fasta == "unal" or additional_fasta == "al_and_unal" - - - - - -**What it does** - -Bowtie_ is a short read aligner designed to be ultrafast and memory-efficient. It is developed by Ben Langmead and Cole Trapnell. Please cite: Langmead B, Trapnell C, Pop M, Salzberg SL. Ultrafast and memory-efficient alignment of short DNA sequences to the human genome. Genome Biology 10:R25. - -.. _Bowtie: http://bowtie-bio.sourceforge.net/index.shtml - -A generic "Map with Bowtie for Illumina" Galaxy tool is available in the main Galaxy distribution. - -However, this useful Bowtie wrapper tool only takes as inputs FASTQ files. - -Our sRbowtie wrapper is intented to work specifically with short reads FASTA inputs and to serve downstream small RNA sequencing analyses - ------- - -**OPTIONS** - -.. class:: infomark - -This script uses Bowtie to match reads on a reference index. - -Depending on the type of matching, different bowtie options are used: - -**Match on sense strand RNA reference index, multiple mappers randomly matched at a single position** - -Match on RNA reference, SENSE strand, randomly attributing multiple mapper to target with least mismatches, the polarity column is suppressed in the bowtie tabular report: - -*-v [0,1,2,3] -M 1 --best --strata -p 12 --norc --suppress 2,6,7,8* - -**Match unique mappers on DNA reference index** - -Match ONLY unique mappers on DNA reference index - -*-v [0,1,2,3] -m 1 -p 12 --suppress 6,7,8* - -Note that using this option with -v values other than 0 is questionnable... - -**Match on DNA, multiple mappers randomly matched at a single position** - -Match multiple mappers, randomly attributing multiple mapper to target with least mismatches, number of mismatch allowed specified by -v option: - -*-v [0,1,2,3] -M 1 --best --strata -p 12 --suppress 6,7,8* - -**Match on DNA as fast as possible, without taking care of mapping issues (for raw annotation of reads)** - -Match with highest speed, not guaranteeing best hit for speed gain: - -*-v [0,1,2,3] -k 1 --best -p 12 --suppress 6,7,8* - - ------ - -**Input formats** - -.. class:: warningmark - -*The only accepted format for the script is a raw fasta list of reads, clipped from their adapter* - ------ - -**OUTPUTS** - -If you choose tabular as the output format, you will obtain the matched reads in standard bowtie output format, having the following columns:: - - Column Description - -------- -------------------------------------------------------- - 1 FastaID fasta identifier - 2 polarity + or - depending whether the match was reported on the forward or reverse strand - 3 target name of the matched target - 4 Offset O-based coordinate of the miR on the miRBase pre-miR sequence - 5 Seq sequence of the matched Read - -If you choose SAM, you will get the output in unordered SAM format. - -.. class:: warningmark - -if you choose BAM, the output will be in sorted BAM format. -To be viewable in Trackster, several condition must be fulfilled: - -.. class:: infomark - -Reads must have been matched to a FULL genome whose chromosome names are compatible with Trackster genome indexes - -.. class:: infomark - -the database/Build (dbkey) which is indicated for the dataset (Pencil - Database/Build field) must match a Trackster genome index. - -Please contact the GED galaxy team is your reference genome is not referenced properly in GED galaxy - -**Optionnal matched and unmatched fasta reads can be obtained, for further annotations** - - - diff -r 752bd9400127 -r cb331ca63e04 tool_data_table_conf.xml.sample --- a/tool_data_table_conf.xml.sample Mon May 12 12:24:28 2014 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ - - - - - value, dbkey, name, path - -
- - - value, dbkey, formats, name, path - -
- - - value, name, path - -
- - - value, name, path - -
- - - value, dbkey, name, path - -
- - - value, dbkey, name, path - -
- - - value, dbkey, name, path - -
- - - name, value - -
- - - name, value - -
- - - value, dbkey, name, path - -
- - - value, dbkey, name, path - -
- - - value, dbkey, name, path - -
- - - name, value, dbkey, species - -
- - - value, dbkey, name, path - -
- - - value, name, path - -
- - - value, name, path - -
- - - value, name, path - -
- - - value, dbkey, name, path - -
- - - value, dbkey, name, path, tools_valid_for - -
- - - value, dbkey, name, path - -
- - - value, dbkey, name, path - -
- - - value, dbkey, name, path - -
- - - value, name, path - -
- - - value, dbkey, name, path - -
-