Permalink
Browse files

initial work on an extensible VCF filter

  • Loading branch information...
1 parent 0ec7e3e commit 7f7b7bdd243c1f4104c6f2d563d4edbf3049a06c James Casbon committed Jan 17, 2012
Showing with 13 additions and 8 deletions.
  1. +8 −3 setup.py
  2. +4 −4 test/example.vcf
  3. +1 −1 vcf.py
View
11 setup.py
@@ -10,11 +10,16 @@
setup(
name='PyVCF',
- py_modules=['vcf'],
- scripts=['vcf_melt'],
+ py_modules=['vcf', 'vcf_filter'],
+ scripts=['vcf_melt', 'vcf_filter.py'],
author='James Casbon',
author_email='casbon@gmail.com',
description='Variant Call Format (VCF) parser for python',
test_suite='test.test_vcf.suite',
- requires=requires
+ requires=requires,
+ entry_points = {
+ 'vcf.filters': [
+ 'site_quality = vcf_filter:SiteQuality',
+ ]
+ }
)
View
8 test/example.vcf
@@ -18,7 +18,7 @@
##FORMAT=<ID=HQ,Number=2,Type=Integer,Description="Haplotype Quality">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 NA00002 NA00003
20 14370 rs6054257 G A 29 PASS NS=3;DP=14;AF=0.5;DB;H2 GT:GQ:DP:HQ 0|0:48:1:51,51 1|0:48:8:51,51 1/1:43:5:.,.
-20 17330 . T A 3 q10 NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:49:3:58,50 0|1:3:5:65,3 0/0:41:3
-20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 1|2:21:6:23,27 2|1:2:0:18,2 2/2:35:4
-20 1230237 . T . 47 PASS NS=3;DP=13;AA=T GT:GQ:DP:HQ 0|0:54:7:56,60 0|0:48:4:51,51 0/0:61:2
-20 1234567 microsat1 GTCT G,GTACT 50 PASS NS=3;DP=9;AA=G GT:GQ:DP ./.:35:4 0/2:17:2 1/1:40:3
+20 17330 . T A 3 q10 NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:49:3:58,50 0|1:3:5:65,3 0/0:41:3:65,3
+20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 1|2:21:6:23,27 2|1:2:0:18,2 2/2:35:4:65,4
+20 1230237 . T . 47 PASS NS=3;DP=13;AA=T GT:GQ:DP:HQ 0|0:54:7:56,60 0|0:48:4:51,51 0/0:61:2:65,3
+20 1234567 microsat1 GTCT G,GTACT 50 PASS NS=3;DP=9;AA=G GT:GQ:DP ./.:35:4 0/2:17:2 1/1:40:3:65,3
View
2 vcf.py
@@ -237,7 +237,7 @@ def add_format(self, fmt):
self.FORMAT = self.FORMAT + ':' + fmt
def add_filter(self, flt):
- if self.FILTER == '.':
+ if self.FILTER == '.' or self.FILTER == 'PASS':
self.FILTER = ''
else:
self.FILTER = self.FILTER + ';'

0 comments on commit 7f7b7bd

Please sign in to comment.