Revision: b21f03ca27ba
Author: Kevin B. Jacobs <jac...@bioinformed.com>
Date: Tue Feb 21 09:12:49 2012
Log: Change semantics to restrict canonical to canonical contigs and
do not...
http://code.google.com/p/glu-genetics/source/detail?r=b21f03ca27ba
Revision: e731311f0a71
Author: Kevin B. Jacobs <jac...@bioinformed.com>
Date: Tue Feb 21 09:22:00 2012
Log: Split the options that require mapping of transcripts to
canonical con...
http://code.google.com/p/glu-genetics/source/detail?r=e731311f0a71
==============================================================================
Revision: b21f03ca27ba
Author: Kevin B. Jacobs <jac...@bioinformed.com>
Date: Tue Feb 21 09:12:49 2012
Log: Change semantics to restrict canonical to canonical contigs and
do not
require canonical transcripts.
http://code.google.com/p/glu-genetics/source/detail?r=b21f03ca27ba
Modified:
/glu/lib/genedb/queries.py
=======================================
--- /glu/lib/genedb/queries.py Tue Feb 21 06:30:06 2012
+++ /glu/lib/genedb/queries.py Tue Feb 21 09:12:49 2012
@@ -34,7 +34,7 @@
conditions = ['g.name = a.name']
if canonical is not None:
- conditions.append('g.canonical & %d' % canonical)
+ #conditions.append('g.canonical & %d' % canonical)
conditions.append("g.chrom NOT LIKE '%!_%' ESCAPE '!'")
if mapped:
==============================================================================
Revision: e731311f0a71
Author: Kevin B. Jacobs <jac...@bioinformed.com>
Date: Tue Feb 21 09:22:00 2012
Log: Split the options that require mapping of transcripts to
canonical contigs
from the code that attempts to restrict results to canonical isoforms.
http://code.google.com/p/glu-genetics/source/detail?r=e731311f0a71
Modified:
/glu/lib/genedb/queries.py
=======================================
--- /glu/lib/genedb/queries.py Tue Feb 21 09:12:49 2012
+++ /glu/lib/genedb/queries.py Tue Feb 21 09:22:00 2012
@@ -22,7 +22,7 @@
cyto_re = re.compile('(\d+|X|Y)(?:([p|q])(?:(\d+)(.\d+)?)?)?$')
-def query_genes_by_name(con, gene, canonical=1, mapped=None):
+def query_genes_by_name(con, gene, canonical_contig=True,
canonical_transcript=None, mapped=None):
sql = '''
SELECT a.Alias,g.symbol,g.chrom,MIN(g.txStart) as start,MAX(g.txEnd)
as end,g.strand,"GENE"
FROM alias a, gene g
@@ -33,8 +33,10 @@
conditions = ['g.name = a.name']
- if canonical is not None:
- #conditions.append('g.canonical & %d' % canonical)
+ if canonical_transcript is not None:
+ conditions.append('g.canonical & %d' % canonical)
+
+ if canonical_contig:
conditions.append("g.chrom NOT LIKE '%!_%' ESCAPE '!'")
if mapped:
@@ -66,14 +68,16 @@
return genes
-def query_gene_by_name(con,gene,canonical=None,mapped=None):
- genes = query_genes_by_name(con,gene)
+def
query_gene_by_name(con,gene,canonical_contig=True,canonical_transcript=None,mapped=None):
+ genes = query_genes_by_name(con,gene,canonical_contig=canonical_contig,
+
canonical_transcript=canonical_transcript,
+ mapped=mapped)
if not genes:
raise KeyError('Cannot find gene "%s"' % gene)
elif len(genes) > 1:
-
raise KeyError('Gene not unique "%s"' % gene)
+
return genes[0]