3 new revisions:
Revision: f4ff4d46c6f4
Author: Kevin B. Jacobs <
jac...@bioinformed.com>
Date: Sun Aug 5 04:31:51 2012
Log: Fix typo format selection code
http://code.google.com/p/glu-genetics/source/detail?r=f4ff4d46c6f4
Revision: 3b408b80278c
Author: Kevin B. Jacobs <
jac...@bioinformed.com>
Date: Sun Aug 5 04:34:07 2012
Log: Add support for phased VCF genotypes
http://code.google.com/p/glu-genetics/source/detail?r=3b408b80278c
Revision: 1e9621c15e09
Author: Kevin B. Jacobs <
jac...@bioinformed.com>
Date: Sun Aug 5 04:36:17 2012
Log: Add support for phased VCF genotypes, make non-autosomal
chromosome ex...
http://code.google.com/p/glu-genetics/source/detail?r=1e9621c15e09
==============================================================================
Revision: f4ff4d46c6f4
Author: Kevin B. Jacobs <
jac...@bioinformed.com>
Date: Sun Aug 5 04:31:51 2012
Log: Fix typo format selection code
http://code.google.com/p/glu-genetics/source/detail?r=f4ff4d46c6f4
Modified:
/glu/modules/seq/annotate.py
=======================================
--- /glu/modules/seq/annotate.py Fri Jul 20 09:52:06 2012
+++ /glu/modules/seq/annotate.py Sun Aug 5 04:31:51 2012
@@ -838,7 +838,7 @@
if format=='VCF': # *** VCF ***
annotate_vcf(options)
- if format=='ION':
+ elif format=='ION':
annotate_ion(options)
elif format=='MASTERVAR':
annotate_mastervar(options)
==============================================================================
Revision: 3b408b80278c
Author: Kevin B. Jacobs <
jac...@bioinformed.com>
Date: Sun Aug 5 04:34:07 2012
Log: Add support for phased VCF genotypes
http://code.google.com/p/glu-genetics/source/detail?r=3b408b80278c
Modified:
/glu/modules/seq/filtervcf.py
/glu/modules/seq/vcf_summary.py
=======================================
--- /glu/modules/seq/filtervcf.py Fri Jul 20 09:50:13 2012
+++ /glu/modules/seq/filtervcf.py Sun Aug 5 04:34:07 2012
@@ -80,13 +80,15 @@
maxcost,minscore,constraints = segmodel
cost = score = 0
+ split_alleles = re.compile('[/|]').split
+
for i,constraint,c_cost,c_score in constraints:
g = genos[i]
if g=='.':
a=b='.'
else:
- a,b = g.split('/')
+ a,b = split_alleles(g)
if constraint=='VAR':
match = a not in '0.' or b not in '0.'
=======================================
--- /glu/modules/seq/vcf_summary.py Fri Jul 20 09:48:31 2012
+++ /glu/modules/seq/vcf_summary.py Sun Aug 5 04:34:07 2012
@@ -53,7 +53,7 @@
ge_known = np.zeros(n, dtype=int)
# Bloody double negatives
- not_variant = set(['.','0','0/0','./0','0/.','./.'])
+ not_variant = set(['.','0','0/0','./0','0/.','./.','0|.','.|0'])
bad = set(['SegDup','Repeat'])
==============================================================================
Revision: 1e9621c15e09
Author: Kevin B. Jacobs <
jac...@bioinformed.com>
Date: Sun Aug 5 04:36:17 2012
Log: Add support for phased VCF genotypes, make non-autosomal
chromosome exclusions more
robust, and improve locus name selection.
http://code.google.com/p/glu-genetics/source/detail?r=1e9621c15e09
Modified:
/glu/modules/seq/vcf2ldat.py
=======================================
--- /glu/modules/seq/vcf2ldat.py Mon Mar 12 17:55:54 2012
+++ /glu/modules/seq/vcf2ldat.py Sun Aug 5 04:36:17 2012
@@ -45,7 +45,7 @@
out.writerow(['ldat']+samples)
seen = set()
- non_autosomes = set(['chrX','chrY','chrM'])
+ non_autosomes = set(['chrX','chrY','chrM','X','Y','M','Mt','MT'])
for v in vcf:
if v.chrom in non_autosomes or not v.names or len(v.var)!=1:
@@ -57,9 +57,9 @@
if len(a)!=1 or len(b)!=1:
continue
- name = v.names[0]
-
- if not name.startswith('rs'):
+ try:
+ name = next(name for name in v.names if name.startswith('rs'))
+ except StopIteration:
continue
if name in seen:
@@ -70,7 +70,8 @@
genomap = genomaps.get(ab)
if genomap is None:
- genomap = genomaps[ab] = {'0/0':a+a,'0/1':a+b,'1/0':a+b,'1/1':b+b}
+ genomap = genomaps[ab] = {'0/0':a+a,'0/1':a+b,'1/0':a+b,'1/1':b+b,
+ '0|0':a+a,'0|1':a+b,'1|0':a+b,'1|1':b+b}
genos = [ genomap.get(g[0],' ') for g in v.genos ]