Open ksw9 opened 4 years ago
Hi @ksw9. I am busy with COVID19 response at the moment. I’ll have a look over the coming days. Sorry for the delay.
Hi, I hope you are doing well. I was wondering if you could help me troubleshoot the issue we encountered and if your script requires a specifically formatted VCF?
Thank you in advance! All the best,
Hi, I just had the same error and thought I'd share a solution.
b2constsites.py
has this function, which is checking for nucleotide types (I think on the home page it says it can only deal with SNPs and MNP):
def _parse_pos(self, rec):
'''
Find which positions to mask
'''
ACCEPTABLE_VAR_TYPES = {'snp', 'mnp'}
try:
if rec.INFO['TYPE'][0] in ACCEPTABLE_VAR_TYPES:
start_pos = rec.POS
if rec.INFO['TYPE'][0] == 'mnp':
end_pos = start_pos + len(rec.ALT[0])
else:
end_pos = start_pos + 1
except KeyError:
logging.critical("Something is not right with your vcf file")
raise
return list(range(start_pos, end_pos))
This function is looking for the 'TYPE' field in the INFO column, which does not exist in my VCF (I'm using VCF v 4.2, if that helps), so that's why I got the same KeyError: 'TYPE'
Since I know my VCF is only SNPs because of the filtering I've done, I don't need it to check the type, so I just commented most of the function and left the start and end positions:
def _parse_pos(self, rec):
'''
Find which positions to mask
'''
ACCEPTABLE_VAR_TYPES = {'snp', 'mnp'}
# try:
# if rec.INFO['TYPE'][0] in ACCEPTABLE_VAR_TYPES:
# start_pos = rec.POS
# if rec.INFO['TYPE'][0] == 'mnp':
# end_pos = start_pos + len(rec.ALT[0])
# else:
# end_pos = start_pos + 1
# except KeyError:
# logging.critical("Something is not right with your vcf file")
# raise
start_pos = rec.POS
end_pos = start_pos + 1
return list(range(start_pos, end_pos))
I got no errors and the XML opens fine in Beauti.
Gary
Hi, Thanks for a great program! I'm getting an error 'Something is not right with your vcf file' and I'm wondering if there are VCF file specifications that need to be met to use this tool? I'm not sure if, for instance, this requires haploid genotype calls? [Uploading cluster10.vcf.gz…]()
Following a previously published pipeline, I used VarScan to call variants and have a VCF with diploid calls. I'm attaching the VCF below.
Any suggestions would be great! Thank you and best,