freeseek / score

Tools to work with GWAS-VCF summary statistics files
MIT License
94 stars 6 forks source link

Error liftover.so: invalid option -- 's': using liftover for assigning coordinates and annotation to vcf #5

Open gsgarlata opened 3 months ago

gsgarlata commented 3 months ago

Hi @freeseek ,

I am trying to use the liftover plugin on a vcf file I generated from WGS of a non-model organism. The dataset was generated with gatk, but the pipeline did not give the SNP ID to my vcf dataset. I though that I could use the liftover plugin to assign SNP id to the vcf file using the old and new reference genome of my species of interest, plus the chain file.

My understanding of the liftover is that it converts genome coordinates and annotation files from the one to another assembly.

I attempted to use the liftover plugin of the binaries I downloaded:

bcftools +$BCFTOOLS_PLUGINS/liftover.so -Oz -o out.vcf.gz input.vcf -s $reference_genome -f $old_reference_genome -c $chain_file

But I do get the following error:

$BCFTOOLS_PLUGINS/liftover.so: invalid option -- 's'
$BCFTOOLS_PLUGINS/liftover.so: invalid option -- 'f'
$BCFTOOLS_PLUGINS/liftover.so: invalid option -- 'c'

First of all, sorry if I am actually misunderstanding what liftover is for. Second, in case it makes sense, what do you think I am doing wrong?

Thanks,

Best Gabriele

freeseek commented 3 months ago

If you run the plugin with the command:

bcftools +liftover -h

You will see that the syntax is a bit different. You should run something like the following:

bcftools +$BCFTOOLS_PLUGINS/liftover.so -Oz -o out.vcf.gz input.vcf --
  -s $old_reference_genome -f $reference_genome -c $chain_file

Notice the -- in between the basic options and the plugin options. Also notice that -s is for the source reference and -f is for the target reference

gsgarlata commented 3 months ago

Ok, the -- notation was not very clear to me from the help page. Sorry. It indeed worked. However, it did not do what I was expecting to do. In fact, it did not pull SNP ID in the vcf file. But I guess that this is not a problem related to liftover.

Thanks again Giulio. Bests, Gabriele

freeseek commented 3 months ago

See here for how to generate a VCF file with rsIDs and then use that file to annotate your VCF. If you need the rsIDs for something other than GRCh38, see here for suggestions for how to generate that