Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for Multiple Tools
[![codecov](https://codecov.io/gh/rhshah/basicfiltering/branch/master/graph/badge.svg)](https://codecov.io/gh/rhshah/basicfiltering)

## Requirements:
- pyvcf : [v0.6.8](http://pyvcf.readthedocs.io/en/latest/INTRO.html)
- pyvcf : [v0.6.7](http://pyvcf.readthedocs.io/en/latest/INTRO.html)
- pandas : [v0.16.2](http://pandas.pydata.org/)
- nose : [v1.3.7](http://nose.readthedocs.io/en/latest/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
##FORMAT=<ID=RD,Number=1,Type=Integer,Description="Reference depth, how many reads support the reference">
##FORMAT=<ID=AD,Number=2,Type=Integer,Description="Allele depth, how many reads support this allele">
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Total coverage at the site">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT PoolNormal-N PoolTumor2-T
2 6636086 . A AGCTTCGTTAAACTTCACTCGGAAGT . PASS END=6636086;HOMLEN=0;SVLEN=25;SVTYPE=INS GT:AD 0/0:554,1 0/0:719,10
2 29451557 . GAGGCAGGGTGCTGGCTCGAAAGCCAGCACCCTGCCTCTGGCTGGTCC G . PASS END=29451604;HOMLEN=7;HOMSEQ=AGGCAGG;SVLEN=-47;SVTYPE=DEL GT:AD 0/0:59,0 0/0:145,5
Expand Down
2,017 changes: 1,009 additions & 1,008 deletions data/sample_output/PoolTumor2-T_bc52_muTect_1.1.4_STDfilter.vcf

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion mutect/filter_mutect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'''
@Description : This tool helps to filter muTect v1.14 txt and vcf through command line.
@Created : 07/17/2016
@Updated : 03/17/2017
@Updated : 04/18/2017
@author : Ronak H Shah

'''
Expand All @@ -26,6 +26,7 @@
pass
try:
import vcf
from vcf.parser import _Info as VcfInfo, field_counts as vcf_field_counts
except ImportError:
logger.fatal("filter_mutect: pyvcf is not installed, please install pyvcf as it is required to run the mapping.")
sys.exit(1)
Expand Down Expand Up @@ -68,6 +69,7 @@ def RunStdFilter(args):
vcf_out = vcf_out + "_STDfilter.vcf"
txt_out = txt_out + "_STDfilter.txt"
vcf_reader = vcf.Reader(open(args.inputVcf, 'r'))
vcf_reader.infos['FAILURE_REASON'] = VcfInfo('FAILURE_REASON', '1', 'String', 'Failure Reason from MuTect text File')
vcf_writer = vcf.Writer(open(vcf_out, 'w'), vcf_reader)
txtDF = pd.read_table(args.inputTxt, skiprows=1, low_memory=False)
txt_fh = open(txt_out, "wb")
Expand Down Expand Up @@ -149,6 +151,10 @@ def RunStdFilter(args):
for record in vcf_reader:
key_for_tracking = str(record.CHROM) + ":" + str(record.POS) + ":" + str(record.REF) + ":" + str(record.ALT[0])
if(key_for_tracking in keepDict):
failure_reason = keepDict.get(key_for_tracking)
if(failure_reason == "KEEP"):
failure_reason = "None"
record.add_info('FAILURE_REASON', failure_reason)
if(record.FILTER == "PASS"):

vcf_writer.write_record(record)
Expand Down
4 changes: 3 additions & 1 deletion pindel/filter_pindel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
@Description : This tool helps to filter pindel v0.2.5a7 vcf through command line.
@Created : 07/17/2014
@Updated: 03/17/2017
@Updated: 04/18/2017
@author : Ronak H Shah

"""
Expand All @@ -26,6 +26,7 @@
pass
try:
import vcf
from vcf.parser import _Format as VcfFormat, field_counts as vcf_field_counts
except ImportError:
logger.fatal("filter_pindel: pyvcf is not installed, please install pyvcf as it is required to run the mapping.")
sys.exit(1)
Expand Down Expand Up @@ -157,6 +158,7 @@ def RunStdFilter(args):
vcf_out = vcf_out + "_STDfilter.vcf"
txt_out = txt_out + "_STDfilter.txt"
vcf_reader = vcf.Reader(open(args.inputVcf, 'r'))
vcf_reader.formats['DP'] = VcfFormat('DP', '1', 'Integer', 'Total coverage at the site')
vcf_writer = vcf.Writer(open(vcf_out, 'w'), vcf_reader)
txt_fh = open(txt_out, "wb")
allsamples = vcf_reader.samples
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nose==1.3.7
pyvcf==0.6.8
pyvcf==0.6.7
pandas==0.16.2
coloredlogs==5.2
codecov==2.0.5
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='basicfiltering',
version='0.1.3',
version='0.1.4',
description='Package for filtering multiple variant calling tools',
long_description=readme,
author='Ronak Shah',
Expand Down