bcftools "The argument to -g not recognised"
3
0
Entering edit mode
8.2 years ago
AP ▴ 100

Hi all,

Fairly new to the use of bcftools, I am trying to create a vcf file by typing the following:

bcftools view -v -c -g output.bcf > output.vcf

However, I receive the following error message: the argument to -g not recognised. Expected one of hom/het/miss/^hom/^het/^miss, got "output.bcf".

I confirm that I am in the right directory and even tried to give the full directory but without success. Unfortunately, I cannot find details online on how to solve this issue.

Any help would be much appreciated.

Antoine

bcftools • 2.7k views
ADD COMMENT
1
Entering edit mode
8.2 years ago
umn_bist ▴ 390

I just had an issue with bcftools and found a solution. Hopefully your issue is similar.

The new bcftools (1.3) uses call function in place of view now. If you still need the view function, -g, --genotype requires combination of [^][hom|het|miss].

Man page.

ADD COMMENT
0
Entering edit mode

Thanks. It is likely the source of the problem. I tried the following but without success:

bcftools view -v -c -g[hom|het|miss] output.bcf > output.vcf
bcftools call -v -c -g[hom|het|miss] output.bcf > output.vcf

Any thoughts?

ADD REPLY
1
Entering edit mode

Try supplying just hom to the -g - if it works, there might be a problem with the syntax of the compound option.Also, try giving a white space between the -g and the hom|het - that might be a possible source of error as well.

And welcome to the trial and error world of tools :)

ADD REPLY
0
Entering edit mode

Thanks Ram. I tried that but it did not work. I am thinking it could be related to the version of bcftools where the syntax has to be applied differently than in previous versions.

ADD REPLY
0
Entering edit mode

Have you tried removing the brackets (e.g. bcftools view -vcg hom|het|miss)?

ADD REPLY
0
Entering edit mode

Yes I did. Still no luck. Btw, I am not sure that the latest version of bcftools actually uses call in place of view. The man page says that call is the former "view". So I guess view is the option I am actually aiming for.

Thanks for sharing your thoughts.

ADD REPLY
0
Entering edit mode
8.2 years ago
Ram 43k

-g is to filter genotypes and is not a toggle - it needs an value passed to the argument. Are you looking to drop genotype information? That's the -G option.

ADD COMMENT
0
Entering edit mode
8.2 years ago
AP ▴ 100

Thanks for your quick answer Ram. My understanding was that -g was a filtering options allowing to "include only sites with one or more homozygous (hom), heterozygous (het) or missing (miss) genotypes". At this point, I am not trying to drop genotype information but to do what the -g seems to offer. There might still be something I am missing here.

ADD COMMENT

Login before adding your answer.

Traffic: 2559 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