Next changeset 1:30d42bb409b8 (2011-10-18) |
Commit message:
Uploaded |
added:
gmap/README gmap/gmap.xml gmap/gmap_build.xml gmap/gsnap.xml gmap/lib/galaxy/datatypes/gmap.py |
b |
diff -r 000000000000 -r d58d272914e7 gmap/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmap/README Tue Oct 18 12:42:42 2011 -0400 |
b |
@@ -0,0 +1,50 @@ + +GMAP and GSNAP use added datatypes: + + add datatype definition file: lib/galaxy/datatypes/gmap.py + + add the following import line to: lib/galaxy/datatypes/registry.py + import gmap # added for gmap tools + + add to datatypes_conf.xml + <!-- Start GMAP Datatypes --> + <datatype extension="gmapdb" type="galaxy.datatypes.gmap:GmapDB" display_in_upload="False"/> + <!-- + + + +Tools: + GMAP_Build - create a GmapDB set of index files for a reference sequence and optional set of annotations + GMAP - map sequences to a reference sequence GmapDB index + GSNAP - align sequences to a reference and detect splicing + + Add to tool_conf.xml ( probably in the "NGS: Mapping" section ) + <tool file="gmap/gmap_build.xml" /> + <tool file="gmap/gmap.xml" /> + <tool file="gmap/gsnap.xml" /> + + +TODO: + Add classes to gmap.py + IntervalIndexTree - datatype for the iit_store result + IntervalAnnotation - generic class for gmap annotation formats + SpliceSiteAnnotation - class for gmap splicesite annotation format + IntronAnnotation - class for gmap introns annotation format + SNPAnnotation - class for gmap snp annotation format + GmapIndex - generic class for a gmap index + SnpIndex - an index created by snpindex + CmetIndex - an index created by cmetindex + AtoiIndex - an index created by atoiindex + + Possibly add Tools: + iit_store - creates a mapping index .iit from: gtf,gff3,gmapannotation, UCSC refGene table + iit_get - retrieves from .iit store + get_genome - retrieves from a gmapdb + snpindex - create a SNPIndex + cmetindex - create methylcytosine index + atoiindex - create A-to-I RNA editing index + + + + + |
b |
diff -r 000000000000 -r d58d272914e7 gmap/gmap.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmap/gmap.xml Tue Oct 18 12:42:42 2011 -0400 |
[ |
b'@@ -0,0 +1,411 @@\n+<tool id="gmap" name="GMAP" version="2.0.0">\n+ <description>Genomic Mapping and Alignment Program for mRNA and EST sequences</description>\n+ <requirements>\n+ <requirement type="binary">gmap</requirement>\n+ </requirements>\n+ <version_string>gmap --version</version_string>\n+ <command>\n+ #import os,os.path\n+ gmap\n+ --nthreads=4 --ordered\n+ #if $refGenomeSource.genomeSource == "history":\n+ --gseg=$refGenomeSource.ownFile\n+ #elif $refGenomeSource.genomeSource == "gmapdb":\n+ #set $gmapdb = $os.listdir($refGenomeSource.gmapdb.extra_files_path)[0]\n+ --dir=$refGenomeSource.gmapdb.extra_files_path --db=$gmapdb\n+ #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:\n+ --kmer=$refGenomeSource.kmer\n+ #end if\n+ #else:\n+ --dir=$os.path.dirname($refGenomeSource.gmapindex.value) --db=$os.path.basename($refGenomeSource.gmapindex.value)\n+ #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:\n+ --kmer=$refGenomeSource.kmer\n+ #end if\n+ #end if\n+ #if $result.format == "summary":\n+ --summary\n+ #elif $result.format == "align":\n+ --align\n+ #elif $result.format == "continuous":\n+ --continuous\n+ #elif $result.format == "continuous-by-exon":\n+ --continuous-by-exon\n+ #elif $result.format == "compress":\n+ --compress\n+ #elif $result.format == "exons_dna":\n+ --exons=cdna\n+ #elif $result.format == "exons_gen":\n+ --exons=genomic\n+ #elif $result.format == "protein_dna":\n+ --protein_dna\n+ #elif $result.format == "protein_gen":\n+ --protein_gen\n+ #elif $result.format == "sam":\n+ --format=$result.sam_paired_read\n+ $result.no_sam_headers \n+ #if len($result.noncanonical_splices.__str__) > 0\n+ --noncanonical-splices=$result.noncanonical_splices\n+ #end if\n+ #if len($result.read_group_id.__str__) > 0\n+ --read-group-id=$result.read_group_id\n+ #end if\n+ #if len($result.read_group_name.__str__) > 0\n+ --read-group-name=$result.read_group_name\n+ #end if\n+ #if len($result.read_group_library.__str__) > 0\n+ --read-group-library=$result.read_group_library\n+ #end if\n+ #if len($result.read_group_platform.__str__) > 0\n+ --read-group-platform=$result.read_group_platform\n+ #end if\n+ #elif $result.format != "gmap":\n+ --format=$result.format\n+ #end if\n+ #if $computation.options == "advanced":\n+ $computation.nosplicing\n+ $computation.cross_species\n+ --min-intronlength=$computation.min_intronlength\n+ --intronlength=$computation.intronlength\n+ --localsplicedist=$computation.localsplicedist\n+ --totallength=$computation.totallength\n+ --trimendexons=$computation.trimendexons\n+ --direction=$computation.direction\n+ --canonical-mode=$computation.canonical\n+ --prunelevel=$computation.prunelevel\n+ --allow-close-indels=$computation.allow_close_indels\n+ --microexon-spliceprob=$computation.microexon_spliceprob\n+ #if int($computation.chimera_margin) >= 0:\n+ --chimera-margin=$computation.chimera_margin\n+ #end if\n+ #end if\n+ #if $advanced.options == "used":\n+ #if int($advanced.npaths) >= 0:\n+ --npaths=$advanced.npaths\n+ #end if\n+ #if int($advanced.chimera_overlap) > 0:\n+ --chimera_overlap=$advanced.chimera_overlap\n+ #end if\n+ $advanced.protein\n+ $advanced.tolerant\n+ $advanced.nolengths\n+ $advanced.invertmode\n+ #if int($advanced.introngap) > 0:\n+ --introngap=$advanced.introngap\n+ #end if\n+ #if int($advanced.wraplength) > 0:\n+ --wraplength=$advanced.wraplength\n+ #end if\n+ #end if\n+ #if $split_output == True\n+ $split_output\n+ #end if\n+ #if len($quality_protocol.__str__) > 0:\n+ --quality-protocol=$quality_protocol\n+ #end if\n+ $input\n+ #for $i in $inputs:\n+ ${i.added'..b'alue="splicesites" format="gmap_splicesites"/>\n+ <when input="result[\'format\']" value="introns" format="gmap_introns"/>\n+ -->\n+ </change_format>\n+ </data>\n+ <data format="txt" name="uniq" label="${tool.name} on ${on_string} uniq.${result.format}" from_work_dir="gmap_out.uniq">\n+ <filter>(split_output == True)</filter>\n+ <change_format>\n+ <when input="result[\'format\']" value="gff3_gene" format="gff3"/>\n+ <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n+ <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n+ <when input="result[\'format\']" value="sam" format="sam"/>\n+ </change_format>\n+ </data>\n+ <data format="txt" name="transloc" label="${tool.name} on ${on_string} transloc.${result.format}" from_work_dir="gmap_out.transloc">\n+ <filter>(split_output == True)</filter>\n+ <change_format>\n+ <when input="result[\'format\']" value="gff3_gene" format="gff3"/>\n+ <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n+ <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n+ <when input="result[\'format\']" value="sam" format="sam"/>\n+ </change_format>\n+ </data>\n+ <data format="txt" name="nomapping" label="${tool.name} on ${on_string} nomapping.${result.format}" from_work_dir="gmap_out.nomapping">\n+ <filter>(split_output == True)</filter>\n+ <change_format>\n+ <when input="result[\'format\']" value="gff3_gene" format="gff3"/>\n+ <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n+ <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n+ <when input="result[\'format\']" value="sam" format="sam"/>\n+ </change_format>\n+ </data>\n+ <data format="txt" name="mult" label="${tool.name} on ${on_string} mult.${result.format}" from_work_dir="gmap_out.mult">\n+ <filter>(split_output == True)</filter>\n+ <change_format>\n+ <when input="result[\'format\']" value="gff3_gene" format="gff3"/>\n+ <when input="result[\'format\']" value="gff3_match_cdna" format="gff3"/>\n+ <when input="result[\'format\']" value="gff3_match_est" format="gff3"/>\n+ <when input="result[\'format\']" value="sam" format="sam"/>\n+ </change_format>\n+ </data>\n+ </outputs>\n+ <tests>\n+ </tests> \n+\n+ <help>\n+\n+**What it does**\n+\n+GMAP_ (Genomic Mapping and Alignment Program) The functionality provided by gmap allows a user to: (1) map and align a single cDNA interactively against a large genome in about a second, without the startup time of several minutes typically needed by existing mapping programs; (2) switch arbitrarily among different genomes, without the need for a preloaded server dedicated to each genome; (3) run the program on computers with as little as 128 MB of RAM (random access memory); (4) perform high-throughput batch processing of cDNAs by using memory mapping and multithreading when appropriate memory and hardware are available; (5) generate accurate gene models, even in the presence of substantial polymorphisms and sequence errors; (6) locate splice sites accurately without the use of probabilistic splice site models, allowing generalized use of the program across species; (7) detect statistically significant microexons and incorporate them into the alignment; and (8) handle mapping and alignment tasks on genomes having alternate assemblies, linkage groups or strains. It is developed by Thomas D. Wu of Genentech, Inc. \n+\n+Publication_ citation: Thomas D. Wu, Colin K. Watanabe Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310\n+\n+.. _GMAP: http://research-pub.gene.com/gmap/\n+.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859\n+\n+------\n+\n+**Know what you are doing**\n+\n+.. class:: warningmark\n+\n+You will want to read the README_\n+\n+.. _README: http://research-pub.gene.com/gmap/src/README\n+\n+ </help>\n+</tool>\n+\n' |
b |
diff -r 000000000000 -r d58d272914e7 gmap/gmap_build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmap/gmap_build.xml Tue Oct 18 12:42:42 2011 -0400 |
b |
@@ -0,0 +1,163 @@ +<tool id="gmap_build" name="GMAP Build" version="2.0.0"> + <description>a GMAP DB Index</description> + <requirements> + <requirement type="binary">gmap_build</requirement> + </requirements> + <version_string>gmap --version</version_string> + <command interpreter="command"> /bin/bash $shscript 2>1 1> $output </command> + <inputs> + <!-- Input data --> + <param name="input" type="data" format="fasta" label="reference sequence fasta" /> + <param name="refname" type="text" label="reference name" help=""> + <validator type="empty_field" message="A database name is required."/> + </param> + <param name="kmer" type="select" multiple="true" force_select="true" label="kmer size" help=""> + <option value="12">12</option> + <option value="13">13</option> + <option value="14">14</option> + <option value="15" selected="true">15</option> + </param> + <param name="cmetindex" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Create cmetindex to process reads from bisulfite-treated DNA"/> + <param name="atoiindex" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Create atoiindex to process reads under RNA-editing tolerance"/> + <conditional name="splicesite"> + <param name="splice_source" type="select" label="Add splice and intron info from" > + <option value="none"></option> + <option value="refGeneTable">refGenes table from UCSC table browser</option> + <option value="gtf">GTF</option> + <option value="gff3">GFF3</option> + </param> + <when value="none"/> + <when value="refGeneTable"> + <param name="refGenes" type="data" format="tabular" optional="true" label="UCSC refGenes table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/refGene.txt.gz" /> + <param name="col_skip" type="integer" value="1" label="Columns to skip before the id/name column (default 1)" + help="Note that alignment tracks in UCSC sometimes have an extra column on the left."> + <validator type="in_range" message="The number of colmumns to skip must >= 0." min="0."/> + </param> + + </when> + <when value="gtf"> + <param name="gtfGenes" type="data" format="gtf" optional="true" label="Genes as GTF" help="" /> + </when> + <when value="gff3"> + <param name="gff3Genes" type="data" format="gff3" optional="true" label="Genes in GFF3 format" help="" /> + </when> + </conditional> + <conditional name="dbsnp"> + <param name="snp_source" type="select" label="Add SNP info from" > + <option value="none"></option> + <option value="snpTable">UCSC SNP Table</option> + <option value="snpFile">GMAP SNP File</option> + </param> + <when value="none"/> + <when value="snpTable"> + <param name="snps" type="data" format="tabular" optional="true" label="UCSC SNPs table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130.txt.gz" /> + <param name="snpsex" type="data" format="tabular" optional="true" label="UCSC SNP Exceptions table" help="Example: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/snp130Exceptions.txt.gz" /> + <param name="weight" type="select" label="Include SNPs with at least Confidence Level" help=""> + <option value="1" selected="true">1 (High)</option> + <option value="2">2 (Medium)</option> + <option value="3">3 (All)</option> + </param> + </when> + <when value="snpFile"> + <param name="snps" type="data" format="gmap_snps" optional="true" label="GMAP SNPs file" + help="Format (3 columns): + <br>>rs62211261 21:14379270 CG + <br>>rs62211262 21:14379281 CG + <br>Each line must start with a > character, then be followed by an + identifier (which may have duplicates). Then there should be the + chromosomal coordinate of the SNP. (Coordinates are all 1-based, so + the first character of a chromosome is number 1.) Finally, there + should be the two possible alleles: ( AC AG AT CG CT GT or AN CN GN TN) + <br>These alleles must correspond to the possible nucleotides on the plus strand of the genome. + If the one of these two letters does not match the allele in the reference + sequence, that SNP will be ignored in subsequent processing as a probable error. + The N stands for any other allele." /> + </when> + </conditional> + </inputs> + <outputs> + <!-- + <data format="txt" name="log" label="${tool.name} on ${on_string}: log"/> + --> + <!-- this should have its own datatype: gmapdb --> + <data format="gmapdb" name="output" label="${tool.name} on ${on_string} gmapdb ${refname}" /> + </outputs> + <configfiles> + <configfile name="shscript"> +#!/bin/bash +#set $ds = chr(36) +#set $gt = chr(62) +#set $lt = chr(60) +#set $ad = chr(38) +#import os.path +#set $gmapdb = $output.extra_files_path +#set $mapsdir = $os.path.join($os.path.join($gmapdb,str($refname)), str($refname) + '.maps') +mkdir -p $gmapdb +## export GMAPDB required for cmetindex and atoiindex +export GMAPDB=$gmapdb +#for $k in $kmer.__str__.split(','): +gmap_build -D $gmapdb -d $refname -s numeric-alpha -k $k $input +#end for +get-genome -D $gmapdb -d '?' | sed 's/^Available .*/gmap db: /' +echo "kmers: " $kmer +#if $splicesite.splice_source == 'refGeneTable': +#if $splicesite.refGenes.__str__ != 'None': +cat $splicesite.refGenes | psl_splicesites -s $splicesite.col_skip | iit_store -o $os.path.join($mapsdir,'splicesites') +cat $splicesite.refGenes | psl_introns -s $splicesite.col_skip | iit_store -o $os.path.join($mapsdir,'introns') +#end if +#elif $splicesite.splice_source == 'gtf': +#if $splicesite.gtfGenes.__str__ != 'None': +cat $splicesite.gtfGenes | gtf_splicesites | iit_store -o $os.path.join($mapsdir,'splicesites') +cat $splicesite.gtfGenes | gtf_introns | iit_store -o $os.path.join($mapsdir,'introns') +#end if +#elif $splicesite.splice_source == 'gff3': +#if $splicesite.gff3Genes.__str__ != 'None': +cat $splicesite.gff3Genes | gff3_splicesites | iit_store -o $os.path.join($mapsdir,'splicesites') +cat $splicesite.gff3Genes | gff3_introns | iit_store -o $os.path.join($mapsdir,'introns') +#end if +#end if +#if $dbsnp.snp_source == 'snpTable': +#if $dbsnp.snps.__str__ != 'None': +#if $dbsnp.snpsex.__str__ != 'None': +cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight -e $dbsnp.snpsex | iit_store -o $os.path.join($mapsdir,'snps') +#else: +cat $dbsnp.snps | dbsnp_iit -w $dbsnp.weight | iit_store -o $os.path.join($mapsdir,'snps') +#end if +snpindex -d $refname -v snps +#end if +#end if +#if $cmetindex.__str__ == 'yes': +cmetindex -d $refname +echo "cmetindex" +#end if +#if $atoiindex.__str__ == 'yes': +atoiindex -d $refname +echo "atoiindex" +#end if +get-genome -D $gmapdb -d $refname -m '?' | sed 's/^Available maps .*/maps: /' + </configfile> + </configfiles> + + <tests> + </tests> + + <help> + + +**GMAP Build** + +GMAP Build creates an index of a genomic sequence for alignments using GMAP_ (Genomic Mapping and Alignment Program for mRNA and EST sequences) and GSNAP_ (Genomic Short-read Nucleotide Alignment Program). + +You will want to read the README_ + +Publication_ citation: Thomas D. Wu, Colin K. Watanabe Bioinformatics 2005 21(9):1859-1875; doi:10.1093/bioinformatics/bti310 + +.. _GMAP: http://research-pub.gene.com/gmap/ +.. _GSNAP: http://research-pub.gene.com/gmap/ +.. _README: http://research-pub.gene.com/gmap/src/README +.. _Publication: http://bioinformatics.oxfordjournals.org/cgi/content/full/21/9/1859 + + + </help> +</tool> + |
b |
diff -r 000000000000 -r d58d272914e7 gmap/gsnap.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmap/gsnap.xml Tue Oct 18 12:42:42 2011 -0400 |
[ |
b'@@ -0,0 +1,585 @@\n+<tool id="gsnap" name="GSNAP" version="2.0.0">\n+ <description>Genomic Short-read Nucleotide Alignment Program</description>\n+ <requirements>\n+ <requirement type="binary">gsnap</requirement>\n+ </requirements>\n+ <version_string>gsnap --version</version_string>\n+ <command>\n+ #import os.path, re\n+ gsnap\n+ --nthreads="4" --ordered\n+ #if $refGenomeSource.genomeSource == "history":\n+ --gseg=$refGenomeSource.ownFile\n+ #elif $refGenomeSource.genomeSource == "gmapdb":\n+ #set $gmapdb = $os.listdir($refGenomeSource.gmapdb.extra_files_path)[0]\n+ --dir=$refGenomeSource.gmapdb.extra_files_path --db=$gmapdb\n+ #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:\n+ --kmer=$refGenomeSource.kmer\n+ #end if\n+ #if $refGenomeSource.splicemap != None and len($refGenomeSource.splicemap.__str__) == 2:\n+ --use-splices=$refGenomeSource.splicemap\n+ #end if\n+ #if $refGenomeSource.snpindex != None and len($refGenomeSource.snpindex.__str__) == 2:\n+ --use-snps=$refGenomeSource.snpindex\n+ #end if\n+ #else:\n+ --dir=$os.path.dirname($refGenomeSource.gmapindex.value) --db=$os.path.basename($refGenomeSource.gmapindex.value)\n+ #if $refGenomeSource.kmer != None and len($refGenomeSource.kmer.__str__) == 2:\n+ --kmer=$refGenomeSource.kmer\n+ #end if\n+ #end if\n+ #if $mode.__str__ != \'\':\n+ --mode=$mode\n+ #end if\n+ #if $computation.options == "advanced":\n+ #if $computation.max_mismatches.__str__ != \'\':\n+ --max-mismatches=$computation.max_mismatches\n+ #end if\n+ $computation.query_unk_mismatch\n+ $computation.genome_unk_mismatch\n+ #if $computation.terminal_threshold.__str__ != \'\':\n+ --terminal-threshold=$computation.terminal_threshold\n+ #end if\n+ #if $computation.indel_penalty.__str__ != \'\':\n+ --indel-penalty=$computation.indel_penalty\n+ #end if\n+ #if $computation.indel_endlength.__str__ != \'\':\n+ --indel-endlength=$computation.indel_endlength\n+ #end if\n+ #if $computation.max_middle_insertions.__str__ != \'\':\n+ --max-middle-insertions=$computation.max_middle_insertions\n+ #end if\n+ #if $computation.max_middle_deletions.__str__ != \'\':\n+ --max-middle-deletions=$computation.max_middle_deletions\n+ #end if\n+ #if $computation.max_end_insertions.__str__ != \'\':\n+ --max-end-insertions=$computation.max_end_insertions\n+ #end if\n+ #if $computation.max_end_deletions.__str__ != \'\':\n+ --max-end-deletions=$computation.max_end_deletions\n+ #end if\n+ #if $computation.suboptimal_levels.__str__ != \'\':\n+ --suboptimal-levels=$computation.suboptimal_levels\n+ #end if\n+ #if $computation.adapter_strip.__str__ != \'\':\n+ --adapter-strip=$computation.adapter_strip\n+ #end if\n+ ## gmap options\n+ #if $computation.gmap_mode.__str__ != \'\' and $computation.gmap_mode.__str__ != \'None\':\n+ --gmap-mode=\'$computation.gmap_mode\'\n+ #end if\n+ #if $computation.trigger_score_for_gmap.__str__ != \'\':\n+ --trigger-score-for-gmap=$computation.trigger_score_for_gmap\n+ #end if\n+ #if $computation.max_gmap_pairsearch.__str__ != \'\' and $re.search("pairsearch",$computation.gmap_mode):\n+ --max-gmap-pairsearch=$computation.max_gmap_pairsearch\n+ #end if\n+ #if $computation.max_gmap_terminal.__str__ != \'\' and $re.search("terminal",$computation.gmap_mode):\n+ --max-gmap-terminal=$computation.max_gmap_terminal\n+ #end if\n+ #if $computation.max_gmap_improvement.__str__ != \'\' and $re.search("improv",$computation.gmap_mode):\n+ --max-gmap-improvement=$computation.max_gmap_improvement\n+ #end if\n+ #if $computation.microexon_spliceprob.__str__ != \'\':\n+ --microexon-spliceprob=$computation.microexon_spliceprob\n+ #end if\n+ #end if\n+ #if $splicing.options == "advanced":\n+ $splicing.novels'..b'at>\n+ </data>\n+ <data format="txt" name="unpaired_uniq" label="${tool.name} on ${on_string} uniq.${result.format}" from_work_dir="gsnap_out.unpaired_uniq">\n+ <filter>(split_output == True)</filter>\n+ <change_format>\n+ <when input="result[\'format\']" value="sam" format="sam"/>\n+ </change_format>\n+ </data>\n+ <data format="txt" name="halfmapping_mult" label="${tool.name} on ${on_string} uniq.${result.format}" from_work_dir="gsnap_out.halfmapping_mult">\n+ <filter>(split_output == True)</filter>\n+ <change_format>\n+ <when input="result[\'format\']" value="sam" format="sam"/>\n+ </change_format>\n+ </data>\n+ <data format="txt" name="halfmapping_uniq" label="${tool.name} on ${on_string} uniq.${result.format}" from_work_dir="gsnap_out.halfmapping_uniq">\n+ <filter>(split_output == True)</filter>\n+ <change_format>\n+ <when input="result[\'format\']" value="sam" format="sam"/>\n+ </change_format>\n+ </data>\n+ <data format="txt" name="nomapping" label="${tool.name} on ${on_string} uniq.${result.format}" from_work_dir="gsnap_out.nomapping">\n+ <filter>(split_output == True)</filter>\n+ <change_format>\n+ <when input="result[\'format\']" value="sam" format="sam"/>\n+ </change_format>\n+ </data>\n+\n+ </outputs>\n+ <tests>\n+ </tests> \n+\n+ <help>\n+\n+**What it does**\n+\n+GSNAP_ (Genomic Short-read Nucleotide Alignment Program) is a short read aligner which can align both single- and paired-end reads as short as 14nt and of arbitrarily long length. It can detect short- and long-distance splicing, including interchromosomal splicing, in individual reads, using probabilistic models or a database of known splice sites. Our program also permits SNP-tolerant alignment to a reference space of all possible combinations of major and minor alleles, and can align reads from bisulfite-treated DNA for the study of methylation state. It is developed by Thomas D. Wu of Genentech, Inc. \n+Publication_ citation: Thomas D. Wu, Serban Nacu "Fast and SNP-tolerant detection of complex variants and splicing in short reads. Bioinformatics. 2010 Apr 1;26(7):873-81. Epub 2010 Feb 10.\n+\n+.. _GSNAP: http://research-pub.gene.com/gmap/\n+.. _Publication: http://bioinformatics.oupjournals.org/cgi/content/full/26/7/873\n+http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2844994/?tool=pubmed\n+\n+------\n+\n+**Know what you are doing**\n+\n+.. class:: warningmark\n+\n+You will want to read the README_\n+\n+.. _README: http://research-pub.gene.com/gmap/src/README\n+\n+------\n+\n+**Input formats**\n+\n+Input to GSNAP should be either in FASTQ or FASTA format. \n+\n+The FASTQ input may include quality scores, which will then be included in SAM\n+output, if that output format is selected. \n+\n+For FASTA format, you should include one line per read (or end of a\n+paired-end read). The same FASTA file can have a mixture of\n+single-end and paired-end reads of varying lengths, if desired.\n+\n+Single-end reads:\n+\n+Each FASTA entry should contain one short read per line, like this\n+\n+>Header information\n+AAAACATTCTCCTCCGCATAAGCCTGCGTCAGATTA\n+\n+Each short read can have a different length. However, the entire read\n+needs to be on a single line, and may not wrap around multiple lines.\n+If it extends to a second line, GSNAP will think that the read is\n+paired-end.\n+\n+\n+Paired-end reads:\n+\n+Each FASTA entry should contain two short reads, one per line, like\n+this\n+\n+>Header information\n+AAAACATTCTCCTCCGCATAAGCCTAGTAGATTA\n+GGCGTAGGTAGAAGTAGAGGTTAAGGCGCGTCAG\n+\n+By default, the program assumes that the second end is in the reverse\n+complement direction compared with the first end. If they are in the\n+same direction, you may need to use the --circular-input (or -c) flag.\n+\n+( The Galaxy tool: "FASTA Width formatter" can be used to reformat fasta files to have single line sequences. )\n+\n+------\n+\n+**Output formats in GSNAP**\n+\n+SAM output format\n+\n+Default GSNAP format\n+ See the README_\n+\n+\n+\n+\n+ </help>\n+</tool>\n+\n' |
b |
diff -r 000000000000 -r d58d272914e7 gmap/lib/galaxy/datatypes/gmap.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmap/lib/galaxy/datatypes/gmap.py Tue Oct 18 12:42:42 2011 -0400 |
[ |
b'@@ -0,0 +1,169 @@\n+"""\n+GMAP indexes\n+"""\n+import logging\n+import os,os.path,re\n+from data import Text\n+from metadata import MetadataElement\n+\n+log = logging.getLogger(__name__)\n+\n+class GmapDB( Text ):\n+ """\n+ A GMAP DB for indexes\n+ """\n+ MetadataElement( name="db_name", desc="The db name for this index set", default=\'unknown\', set_in_upload=True, readonly=True )\n+ MetadataElement( name="basesize", default="12", desc="The basesize for offsetscomp", visible=True, readonly=True )\n+ MetadataElement( name="kmers", default=[\'\'], desc="The kmer sizes for indexes", visible=True, no_value=[\'\'], readonly=True )\n+ MetadataElement( name="map_dir", desc="The maps directory", default=\'unknown\', set_in_upload=True, readonly=True )\n+ MetadataElement( name="maps", default=[\'\'], desc="The names of maps stored for this gmap gmapdb", visible=True, no_value=[\'\'], readonly=True )\n+ MetadataElement( name="snps", default=[\'\'], desc="The names of SNP indexes stored for this gmapdb", visible=True, no_value=[\'\'], readonly=True )\n+ MetadataElement( name="cmet", default=False, desc="Has a cmet index", visible=True, readonly=True )\n+ MetadataElement( name="atoi", default=False, desc="Has a atoi index", visible=True, readonly=True )\n+ \n+ file_ext = \'gmapdb\'\n+ is_binary = True\n+ composite_type = \'auto_primary_file\'\n+ allow_datatype_change = False\n+\n+ def generate_primary_file( self, dataset = None ):\n+ """ \n+ This is called only at upload to write the html file\n+ cannot rename the datasets here - they come with the default unfortunately\n+ """\n+ return \'<html><head></head><body>AutoGenerated Primary File for Composite Dataset</body></html>\'\n+ \n+ def regenerate_primary_file(self,dataset):\n+ """\n+ cannot do this until we are setting metadata \n+ """\n+ bn = dataset.metadata.db_name\n+ log.info( "GmapDB regenerate_primary_file %s" % (bn))\n+ rval = [\'<html><head><title>GMAPDB %s</title></head><p/><H3>GMAPDB %s</H3><p/>cmet %s<br>atoi %s<H4>Maps:</H4><ul>\' % (bn,bn,dataset.metadata.cmet,dataset.metadata.atoi)]\n+ for i,name in enumerate(dataset.metadata.maps):\n+ rval.append( \'<li>%s\' % name)\n+ rval.append( \'</ul></html>\' )\n+ f = file(dataset.file_name,\'w\')\n+ f.write("\\n".join( rval ))\n+ f.write(\'\\n\')\n+ f.close()\n+\n+ def set_peek( self, dataset, is_multi_byte=False ):\n+ log.info( "GmapDB set_peek %s" % (dataset))\n+ if not dataset.dataset.purged:\n+ dataset.peek = "GMAPDB index %s\\n cmet %s\\n atoi %s\\n maps %s" % ( dataset.metadata.db_name,dataset.metadata.cmet,dataset.metadata.atoi,dataset.metadata.maps )\n+ dataset.blurb = "GMAPDB %s" % ( dataset.metadata.db_name )\n+ else:\n+ dataset.peek = \'file does not exist\'\n+ dataset.blurb = \'file purged from disk\'\n+ def display_peek( self, dataset ):\n+ try:\n+ return dataset.peek\n+ except:\n+ return "GMAP index file"\n+ def sniff( self, filename ):\n+ return False\n+ def set_meta( self, dataset, overwrite = True, **kwd ):\n+ """\n+ Expecting:\n+ extra_files_path/<db_name>/db_name>.ref<basesize><kmer>3<index>\n+ extra_files_path/db_name/db_name.ref1[2345]1[2345]3offsetscomp\n+ extra_files_path/db_name/db_name.ref1[2345]1[2345]3positions\n+ extra_files_path/db_name/db_name.ref1[2345]1[2345]3gammaptrs\n+ index maps: \n+ extra_files_path/db_name/db_name.maps/*.iit\n+ """\n+ log.info( "GmapDB set_meta %s %s" % (dataset,dataset.extra_files_path))\n+ pat = \'(.*)\\.((ref)|(met)[atgc][atgc]|(a2i)[atgc][atgc])((\\d\\d)(\\d\\d))?3positions(\\.(.+))?\'\n+ efp = dataset.extra_files_path\n+ flist = os.listdir(efp)\n+ for i,fname in enumerate(flist):\n+ log.info( "GmapDB set_meta %s %s" % (i,fname))\n+ fpath = os.path.join(efp,fname)\n+ if '..b'(fpath)\n+ kmers = {\'\':\'default\'} # HACK \'\' empty key added so user has default choice when selecting kmer from metadata\n+ for j,iname in enumerate(ilist):\n+ log.info( "GmapDB set_meta file %s %s" % (j,iname))\n+ ipath = os.path.join(fpath,iname)\n+ if os.path.isdir(ipath): # find maps\n+ dataset.metadata.map_dir = iname\n+ for mapfile in os.listdir(ipath):\n+ mapname = mapfile.replace(\'.iit\',\'\')\n+ log.info( "GmapDB set_meta map %s %s" % (mapname,mapfile))\n+ dataset.metadata.maps.append(mapname)\n+ else: \n+ m = re.match(pat,iname)\n+ if m:\n+ log.info( "GmapDB set_meta m %s %s " % (iname, m))\n+ assert len(m.groups()) == 10\n+ dataset.metadata.db_name = fname\n+ if m.groups()[2] == \'ref\':\n+ if m.groups()[-1] != None:\n+ dataset.metadata.snps.append(m.groups()[-1])\n+ else:\n+ if m.groups()[-3] != None:\n+ k = int(m.groups()[-3])\n+ kmers[k] = k\n+ if m.groups()[-4] != None:\n+ dataset.metadata.basesize = int( m.groups()[-4])\n+ elif m.groups()[3] == \'met\':\n+ dataset.metadata.cmet = True\n+ elif m.groups()[4] == \'a2i\':\n+ dataset.metadata.atoi = True\n+ dataset.metadata.kmers = kmers.keys()\n+\n+## class IntervalIndexTree( Text ):\n+## """\n+## A GMAP Interval Index Tree Map\n+## created by iit_store\n+## (/path/to/map)/(mapname).iit\n+## """\n+## MetadataElement( name="map_name", desc="The map name for this index set", default=\'unknown\', set_in_upload=True, readonly=False )\n+## file_ext = \'iit\'\n+## is_binary = True\n+## composite_type = \'auto_primary_file\'\n+## allow_datatype_change = False\n+## \n+## class IntervalAnnotation(data.Text):\n+## """\n+## Class describing a GMAP Interval format:\n+## >label coords optional_tag\n+## optional_annotation (which may be zero, one, or multiple lines)\n+## The coords should be of the form:\n+## chr:position\n+## chr:startposition..endposition\n+## """\n+## file_ext = \'gmapannotation\'\n+## \n+## class SpliceSiteAnnotation(IntervalAnnotation):\n+## file_ext = \'gmapsplicesites\'\n+## """\n+## Example:\n+## >NM_004448.ERBB2.exon1 17:35110090..35110091 donor 6678\n+## >NM_004448.ERBB2.exon2 17:35116768..35116769 acceptor 6678\n+## >NM_004448.ERBB2.exon2 17:35116920..35116921 donor 1179\n+## >NM_004448.ERBB2.exon3 17:35118099..35118100 acceptor 1179\n+## >NM_004449.ERG.exon1 21:38955452..38955451 donor 783\n+## >NM_004449.ERG.exon2 21:38878740..38878739 acceptor 783\n+## >NM_004449.ERG.exon2 21:38878638..38878637 donor 360\n+## >NM_004449.ERG.exon3 21:38869542..38869541 acceptor 360\n+## """\n+## \n+## class IntronAnnotation(IntervalAnnotation):\n+## file_ext = \'gmapintrons\'\n+## """\n+## Example:\n+## >NM_004448.ERBB2.intron1 17:35110090..35116769\n+## >NM_004448.ERBB2.intron2 17:35116920..35118100\n+## >NM_004449.ERG.intron1 21:38955452..38878739\n+## >NM_004449.ERG.intron2 21:38878638..38869541\n+## """\n+## \n+## class SNPAnnotation(IntervalAnnotation):\n+## file_ext = \'gmapsnps\'\n+## """\n+## Example:\n+## >rs62211261 21:14379270 CG\n+## >rs62211262 21:14379281 CG\n+## """\n' |