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

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

bed bcftools • 2.1k views
ADD COMMENT
2
Entering edit mode
6.3 years ago
Ram 44k

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.

ADD COMMENT
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.

ADD REPLY
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.

ADD REPLY
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.

ADD REPLY
1
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1693 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6