Skip to content

Commit

Permalink
initial work on an extensible VCF filter
Browse files Browse the repository at this point in the history
  • Loading branch information
James Casbon committed Jan 20, 2012
1 parent 0ec7e3e commit 7f7b7bd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
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',
]
}
)
8 changes: 4 additions & 4 deletions test/example.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ';'
Expand Down

0 comments on commit 7f7b7bd

Please sign in to comment.