Error while trying to filter a .vcf.gz file with a bed.gz file
1
0
Entering edit mode
4.1 years ago
ricfoz ▴ 80

Hello everyone,

I am trying to filter a bgzipped vcf file with a bgzipped bed file. I have worked a script for that using bcftools-1.9

The script is:

bcftools call -c -T bedfile.bed.gz chromosomefile.vcf.gz > filteredfile.vcf


I get an error message which says:

Wrong number of PL fields? nals=1 npl=-1


Afterwards i tried to even the script giving a .vcf.gz extention to the output file, but it retreived the same error message.

I haven't manipulated the chromosome file, nor the bed file, since i have downloaded them from a repository where they are supposed to be ready to use. I would appreciate any one of you helping to sort this problem, or suggesting any other script/tools to filter this chromosome with the bed file.

I have to say the chromosome file is a complete human chromosome, and the bed file is a list of sites which should be filtered/masked from the whole chromosome, if that info is of any use to solve the problem

Cheers everyone and thanks in advance

filter error bed bed file • 1.4k views
2
Entering edit mode
4.1 years ago
Ram 37k

I'm trying to filter a ...

Why use bcftools call then? The appropriate command is bcftools view

Afterwards i tried to even the script giving a .vcf.gz extention to the output file, but it retreived the same error message.

The file extension seldom matters. bcftools has an -O option that can be used to change output format.

0
Entering edit mode

Thanks a lot for the answer, i used the command call, since reading the manual it says that view is a former command, which on newer versions of bcftools (say 1-8 towards 1-9 versions) was changed to "call" , anyways, i will try, see what happens!

R.

0
Entering edit mode

bcftools call used to be bcftools view, true, but the command descriptions make it clear what they do.

They should really drop that statement out of the manual. It's dumb that they reused a sub-command to perform a completely unrelated functionality.

That being said, you should always go by the manual for the current version.

0
Entering edit mode

Hello Ram,

Well, i tried, it is a large file so it'll last, but it is generating the vcf file with the command you suggested.

Thank yow for that awesomely fast answer.

Best Regards

R.

1
Entering edit mode

Glad it helped. I've moved my comment to an answer - you can accept it once you confirm it worked.