Revision: 0471900f12f7
Branch: default
Author: Kevin B. Jacobs <
jac...@bioinformed.com>
Date: Mon Dec 10 08:24:20 2012
Log: Fix case in cgfvariants where pure insertion alleles were not
annotated due
to tabix semantics.
http://code.google.com/p/glu-genetics/source/detail?r=0471900f12f7
Modified:
/glu/lib/seqlib/cgfvariants.py
=======================================
--- /glu/lib/seqlib/cgfvariants.py Mon Dec 10 07:56:48 2012
+++ /glu/lib/seqlib/cgfvariants.py Mon Dec 10 08:24:20 2012
@@ -27,10 +27,20 @@
chromosome = chromosome[3:]
chrmap = {'X':23,'Y':24,'MT':25,'M':25}
- score = self.vars.fetch(chrmap.get(chromosome,chromosome), start,
stop+1)
+
+ # Search more broadly than necessary to ensure that we cover indels
+ score = self.vars.fetch(chrmap.get(chromosome,chromosome), start-1,
stop+1)
for s in score:
chrom,vstart,vstop,allele,common_score,function_score,source =
s.split('\t')
+
+ vstart = int(vstart)
+ vstop = int(vstop)
+
+ # Skip non-matching records due to broader search
+ if vstart!=start or vstop!=vstop:
+ continue
+
source = [ s.strip() for s in source.split(',') ]
yield VarRecord(chrom, int(vstart), int(vstop),
allele.replace('-',''),