Biostar Beta. Not for public use.
bcftools "The argument to -g not recognised"
0
Entering edit mode
18 months ago
AP • 90

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 options • 1.3k views
ADD COMMENTlink
1
Entering edit mode
4.2 years ago
umn_bist • 320

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 COMMENTlink
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 REPLYlink
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 REPLYlink
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 REPLYlink
0
Entering edit mode

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

ADD REPLYlink
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 REPLYlink
0
Entering edit mode
4 hours ago
RamRS 21k
Houston, TX

-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 COMMENTlink
0
Entering edit mode
18 months ago
AP • 90

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 COMMENTlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1