Repository 'gmap'
hg clone https://toolshed.g2.bx.psu.edu/repos/jjohnson/gmap

Changeset 6:3be0e0a858fe (2011-11-08)
Previous changeset 5:f4b4c1712e39 (2011-11-08) Next changeset 7:561503a442f0 (2011-11-08)
Commit message:
refactor and update README
added:
README
lib/galaxy/datatypes/gmap.py
tool-data/gmap_indices.loc.sample
removed:
gmap/README
gmap/gmap_indices.loc.sample
gmap/lib/galaxy/datatypes/gmap.py
b
diff -r f4b4c1712e39 -r 3be0e0a858fe README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README Tue Nov 08 13:22:34 2011 -0600
b
@@ -0,0 +1,71 @@
+GMAP applications and citation info are available from:    http://research-pub.gene.com/gmap/
+
+
+    Installation instructions are in the README file in the download, 
+    and online:   http://research-pub.gene.com/gmap/src/README
+
+    These tools were consistent with gmap version: 2011-10-16
+
+
+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"/>
+        <datatype extension="gmapsnpindex" type="galaxy.datatypes.gmap:GmapSnpIndex"  display_in_upload="False"/>
+        <datatype extension="iit" type="galaxy.datatypes.gmap:IntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="splicesites.iit" type="galaxy.datatypes.gmap:SpliceSitesIntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="introns.iit" type="galaxy.datatypes.gmap:IntronsIntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="snps.iit" type="galaxy.datatypes.gmap:SNPsIntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="tally.iit" type="galaxy.datatypes.gmap:TallyIntervalIndexTree"  display_in_upload="True"/>
+        <datatype extension="gmap_annotation" type="galaxy.datatypes.gmap:IntervalAnnotation"  display_in_upload="False"/>
+        <datatype extension="gmap_splicesites" type="galaxy.datatypes.gmap:SpliceSiteAnnotation"  display_in_upload="True"/>
+        <datatype extension="gmap_introns" type="galaxy.datatypes.gmap:IntronAnnotation"  display_in_upload="True"/>
+        <datatype extension="gmap_snps" type="galaxy.datatypes.gmap:SNPAnnotation"  display_in_upload="True"/>
+        <datatype extension="gsnap_tally" type="galaxy.datatypes.gmap:TallyAnnotation"  display_in_upload="True"/>
+        <datatype extension="gsnap" type="galaxy.datatypes.gmap:GsnapResult"  display_in_upload="True"/>
+        <!-- End GMAP Datatypes -->
+
+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.xml" />
+   <tool file="gmap/gsnap.xml" />
+   <tool file="gmap/gmap_build.xml" />
+   <tool file="gmap/snpindex.xml" />
+   <tool file="gmap/iit_store.xml" />
+
+Admin built cached gmapdb indexes defined in tool-data/gmap_indices.loc
+
+
+TODO:
+  
+  
+  Add classes to gmap.py
+    CmetIndex - an index created by cmetindex
+    AtoiIndex - an index created by atoiindex
+
+  Add tally creation
+    gsnap default output -> gsnap_tally -> iit_store
+
+  Add goby support
+    Should add separate tools and datatypes for goby 
+    GSNAP goby output relies on goby input, might be better to have a separate gsnap tool for goby
+
+  Possibly add Tools:
+    get_genome - retrieves from a gmapdb
+    cmetindex - create methylcytosine index
+    atoiindex - create  A-to-I RNA editing index
+    
+    
+     
+
+
b
diff -r f4b4c1712e39 -r 3be0e0a858fe gmap/README
--- a/gmap/README Tue Nov 08 13:07:25 2011 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,60 +0,0 @@
-GMAP applications and citation info are available from:    http://research-pub.gene.com/gmap/
-
-
-    Installation instructions are in the README file in the download, 
-    and online:   http://research-pub.gene.com/gmap/src/README
-
-    These galaxy tools assume gmap is configured and built with goby support.
-    These tools were consistent with gmap version: 2011-10-07
-
-
-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"/>
-        <datatype extension="gmapsnpindex" type="galaxy.datatypes.gmap:GmapSnpIndex"  display_in_upload="False"/>
-        <datatype extension="iit" type="galaxy.datatypes.gmap:IntervalIndexTree"  display_in_upload="True"/>
-        <datatype extension="splicesites.iit" type="galaxy.datatypes.gmap:SpliceSitesIntervalIndexTree"  display_in_upload="True"/>
-        <datatype extension="introns.iit" type="galaxy.datatypes.gmap:IntronsIntervalIndexTree"  display_in_upload="True"/>
-        <datatype extension="snps.iit" type="galaxy.datatypes.gmap:SNPsIntervalIndexTree"  display_in_upload="True"/>
-        <datatype extension="gmap_annotation" type="galaxy.datatypes.gmap:IntervalAnnotation"  display_in_upload="False"/>
-        <datatype extension="gmap_splicesites" type="galaxy.datatypes.gmap:SpliceSiteAnnotation"  display_in_upload="True"/>
-        <datatype extension="gmap_introns" type="galaxy.datatypes.gmap:IntronAnnotation"  display_in_upload="True"/>
-        <datatype extension="gmap_snps" type="galaxy.datatypes.gmap:SNPAnnotation"  display_in_upload="True"/>
-        <!-- End GMAP tools -->
-
-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.xml" />
-   <tool file="gmap/gsnap.xml" />
-   <tool file="gmap/gmap_build.xml" />
-   <tool file="gmap/snpindex.xml" />
-   <tool file="gmap/iit_store.xml" />
-
-Admin built cached gmapdb indexes defined in tool-data/gmap_indices.loc
-
-
-TODO:
-  Add classes to gmap.py
-    CmetIndex - an index created by cmetindex
-    AtoiIndex - an index created by atoiindex
-
-  Possibly add Tools:
-    get_genome - retrieves from a gmapdb
-    cmetindex - create methylcytosine index
-    atoiindex - create  A-to-I RNA editing index
-    
-    
-     
-
-
b
diff -r f4b4c1712e39 -r 3be0e0a858fe gmap/gmap_indices.loc.sample
--- a/gmap/gmap_indices.loc.sample Tue Nov 08 13:07:25 2011 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,10 +0,0 @@
-#This is a sample file distributed with Galaxy that enables tools
-#to use a directory of GMAPDB indexed sequences data files.  You will need
-#to create these data files using gmap_build and then create a gmap_indices.loc file 
-#similar to this one (store it in this directory) that points to 
-#the directories in which those files are stored. The gmap_indices.loc 
-#file has this format (white space characters are TAB characters):
-#
-#<unique_build_id>   <dbkey>   <display_name>   <kmers> <map,map>       <snp,snp>       <file_base_path>
-#hg18   hg18    hg18 (cmet atoi)        12,13,14,15     splicesites,introns     snps    /depot/data2/galaxy/gmap/hg18
-#hg19 hg19 hg19 (cmet atoi) 12,13,14,15 splicesites,introns,snps snps,dbsnp /depot/data2/galaxy/gmap/hg19
b
diff -r f4b4c1712e39 -r 3be0e0a858fe gmap/lib/galaxy/datatypes/gmap.py
--- a/gmap/lib/galaxy/datatypes/gmap.py Tue Nov 08 13:07:25 2011 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,472 +0,0 @@\n-"""\n-GMAP indexes\n-"""\n-import logging\n-import os,os.path,re\n-import data\n-from data import Text\n-from galaxy import util\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-\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 = '..b' == None: # Failed to match \n-                        return False\n-        finally:\n-            fh.close()\n-        return False\n-\n-class SNPAnnotation(IntervalAnnotation):\n-    file_ext = \'gmap_snps\'\n-    """\n-    Example:\n-        >rs62211261 21:14379270 CG\n-        >rs62211262 21:14379281 AT\n-        >rs62211263 21:14379298 WN\n-    Each line must start with a ">" character, then be followed by an\n-    identifier (which may have duplicates).  Then there should be the\n-    chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so\n-    the first character of a chromosome is number 1.)  Finally, there\n-    should be the two possible alleles.  (Previous versions required that\n-    these be in alphabetical order: "AC", "AG", "AT", "CG", "CT", or "GT",\n-    but that is no longer a requirement.)  These alleles must correspond\n-    to the possible nucleotides on the plus strand of the genome.  If the\n-    one of these two letters does not match the allele in the reference\n-    sequence, that SNP will be ignored in subsequent processing as a\n-    probable error.\n-    \n-    GSNAP also supports the idea of a wildcard SNP.  A wildcard SNP allows\n-    all nucleotides to match at that position, not just a given reference\n-    and alternate allele.  It is essentially as if an "N" were recorded at\n-    that genomic location, although the index files still keep track of\n-    the reference allele.  To indicate that a position has a wildcard SNP,\n-    you can indicate the genotype as "WN", where "W" is the reference\n-    allele.  Another indication of a wildcard SNP is to provide two\n-    separate lines at that position with the genotypes "WX" and "WY",\n-    where "W" is the reference allele and "X" and "Y" are two different\n-    alternate alleles.\n-    """\n-    def sniff( self, filename ):\n-        """\n-        Determines whether the file is a gmap SNP annotation file\n-        """\n-        try:\n-            pat = \'>(\\S+)\\s((\\S+):(\\d+)\\s([TACGW][TACGN])$\' #>label chr:position ATCG \n-            fh = open( filename )\n-            count = 0\n-            while True and count < 10:\n-                line = fh.readline()\n-                if not line:\n-                    break #EOF\n-                line = line.strip()\n-                if line: #first non-empty line\n-                    count += 1\n-                    if re.match(pat,line) == None: # Failed to match \n-                        return False\n-        finally:\n-            fh.close()\n-        return False\n-\n-\n-class TallyAnnotation(IntervalAnnotation):\n-    file_ext = \'gsnap_tally\'\n-    """\n-    Output produced by gsnap_tally\n-    Example:\n-        >144 chr20:57268791..57268935\n-        G0\n-        A1(1@7|1Q-3)\n-        A2(1@36,1@1|1Q2,1Q-8)\n-        C2      0.889,0.912,0.889,0.889,0.933,0.912,0.912,0.889,0.889,0.889     -2.66,-2.89,-2.66,-2.66,-3.16,-2.89,-2.89,-2.66,-2.66,-2.66\n-        C1 T1   0.888,0.9,0.888,0.9,0.913,0.9,0.911,0.888,0.9,0.913     -2.66,-2.78,-2.66,-2.78,-2.91,-2.78,-2.89,-2.66,-2.78,-2.91\n-    """\n-    def sniff( self, filename ): # TODO\n-        """\n-        Determines whether the file is a gmap splice site annotation file\n-        """\n-        try:\n-            pat = \'^>(\\d+)\\s((\\S+):(\\d+)\\.\\.(\\d+))$\' #>total chr:position..position\n-            pat2 = \'^[GATCN]\\d.*$\' #BaseCountDeatails\n-            fh = open( filename )\n-            count = 0\n-            while True and count < 10:\n-                line = fh.readline()\n-                if not line:\n-                    break #EOF\n-                line = line.strip()\n-                if line: #first non-empty line\n-                    count += 1\n-                    if re.match(pat,line) == None and re.match(pat2,line) == None: # Failed to match \n-                        return False\n-        finally:\n-            fh.close()\n-        return False\n-\n-class GsnapResult( Text ):\n-    """\n-    The default output format for gsnap.   Can be used as input for gsnap_tally.\n-    """\n-    file_ext = \'gsnap\'\n-\n-\n'
b
diff -r f4b4c1712e39 -r 3be0e0a858fe lib/galaxy/datatypes/gmap.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/galaxy/datatypes/gmap.py Tue Nov 08 13:22:34 2011 -0600
[
b'@@ -0,0 +1,472 @@\n+"""\n+GMAP indexes\n+"""\n+import logging\n+import os,os.path,re\n+import data\n+from data import Text\n+from galaxy import util\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+\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 = '..b' == None: # Failed to match \n+                        return False\n+        finally:\n+            fh.close()\n+        return False\n+\n+class SNPAnnotation(IntervalAnnotation):\n+    file_ext = \'gmap_snps\'\n+    """\n+    Example:\n+        >rs62211261 21:14379270 CG\n+        >rs62211262 21:14379281 AT\n+        >rs62211263 21:14379298 WN\n+    Each line must start with a ">" character, then be followed by an\n+    identifier (which may have duplicates).  Then there should be the\n+    chromosomal coordinate of the SNP.  (Coordinates are all 1-based, so\n+    the first character of a chromosome is number 1.)  Finally, there\n+    should be the two possible alleles.  (Previous versions required that\n+    these be in alphabetical order: "AC", "AG", "AT", "CG", "CT", or "GT",\n+    but that is no longer a requirement.)  These alleles must correspond\n+    to the possible nucleotides on the plus strand of the genome.  If the\n+    one of these two letters does not match the allele in the reference\n+    sequence, that SNP will be ignored in subsequent processing as a\n+    probable error.\n+    \n+    GSNAP also supports the idea of a wildcard SNP.  A wildcard SNP allows\n+    all nucleotides to match at that position, not just a given reference\n+    and alternate allele.  It is essentially as if an "N" were recorded at\n+    that genomic location, although the index files still keep track of\n+    the reference allele.  To indicate that a position has a wildcard SNP,\n+    you can indicate the genotype as "WN", where "W" is the reference\n+    allele.  Another indication of a wildcard SNP is to provide two\n+    separate lines at that position with the genotypes "WX" and "WY",\n+    where "W" is the reference allele and "X" and "Y" are two different\n+    alternate alleles.\n+    """\n+    def sniff( self, filename ):\n+        """\n+        Determines whether the file is a gmap SNP annotation file\n+        """\n+        try:\n+            pat = \'>(\\S+)\\s((\\S+):(\\d+)\\s([TACGW][TACGN])$\' #>label chr:position ATCG \n+            fh = open( filename )\n+            count = 0\n+            while True and count < 10:\n+                line = fh.readline()\n+                if not line:\n+                    break #EOF\n+                line = line.strip()\n+                if line: #first non-empty line\n+                    count += 1\n+                    if re.match(pat,line) == None: # Failed to match \n+                        return False\n+        finally:\n+            fh.close()\n+        return False\n+\n+\n+class TallyAnnotation(IntervalAnnotation):\n+    file_ext = \'gsnap_tally\'\n+    """\n+    Output produced by gsnap_tally\n+    Example:\n+        >144 chr20:57268791..57268935\n+        G0\n+        A1(1@7|1Q-3)\n+        A2(1@36,1@1|1Q2,1Q-8)\n+        C2      0.889,0.912,0.889,0.889,0.933,0.912,0.912,0.889,0.889,0.889     -2.66,-2.89,-2.66,-2.66,-3.16,-2.89,-2.89,-2.66,-2.66,-2.66\n+        C1 T1   0.888,0.9,0.888,0.9,0.913,0.9,0.911,0.888,0.9,0.913     -2.66,-2.78,-2.66,-2.78,-2.91,-2.78,-2.89,-2.66,-2.78,-2.91\n+    """\n+    def sniff( self, filename ): # TODO\n+        """\n+        Determines whether the file is a gmap splice site annotation file\n+        """\n+        try:\n+            pat = \'^>(\\d+)\\s((\\S+):(\\d+)\\.\\.(\\d+))$\' #>total chr:position..position\n+            pat2 = \'^[GATCN]\\d.*$\' #BaseCountDeatails\n+            fh = open( filename )\n+            count = 0\n+            while True and count < 10:\n+                line = fh.readline()\n+                if not line:\n+                    break #EOF\n+                line = line.strip()\n+                if line: #first non-empty line\n+                    count += 1\n+                    if re.match(pat,line) == None and re.match(pat2,line) == None: # Failed to match \n+                        return False\n+        finally:\n+            fh.close()\n+        return False\n+\n+class GsnapResult( Text ):\n+    """\n+    The default output format for gsnap.   Can be used as input for gsnap_tally.\n+    """\n+    file_ext = \'gsnap\'\n+\n+\n'
b
diff -r f4b4c1712e39 -r 3be0e0a858fe tool-data/gmap_indices.loc.sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/gmap_indices.loc.sample Tue Nov 08 13:22:34 2011 -0600
b
@@ -0,0 +1,10 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of GMAPDB indexed sequences data files.  You will need
+#to create these data files using gmap_build and then create a gmap_indices.loc file 
+#similar to this one (store it in this directory) that points to 
+#the directories in which those files are stored. The gmap_indices.loc 
+#file has this format (white space characters are TAB characters):
+#
+#<unique_build_id>   <dbkey>   <display_name>   <kmers> <map,map>       <snp,snp>       <file_base_path>
+#hg18   hg18    hg18 (cmet atoi)        12,13,14,15     splicesites,introns     snps    /depot/data2/galaxy/gmap/hg18
+#hg19 hg19 hg19 (cmet atoi) 12,13,14,15 splicesites,introns,snps snps,dbsnp /depot/data2/galaxy/gmap/hg19