DaehwanKimLab / hisat2

Graph-based alignment (Hierarchical Graph FM index)
GNU General Public License v3.0
473 stars 116 forks source link

How to use hisat2_extract_snps_haplotypes_vcf.py for the VCFs without variant ID? #210

Closed verne91 closed 5 years ago

verne91 commented 5 years ago

I am trying to build the index with my own VCF files which are generated from WGS data. There is no variant ID on the third column of VCF files.

I found that this python script would skip the variants with the same ID.

if varID == prev_varID:
    continue

Therefore, how can I deal with my VCF files?

parkchanhee commented 5 years ago

you can simply make new vcf files.

bcftools can assign new IDs.

ex> bcftools annotate --set-id +'%CHROM_%POS_%REF_%FIRST_ALT' file.vcf

verne91 commented 5 years ago

Thank you! The command line should add '\' before ''. ` bcftools annotate --set-id +'%CHROM_%POS_%RE\%FIRST_ALT' file.vcf `

you can simply make new vcf files.

bcftools can assign new IDs.

ex> bcftools annotate --set-id +'%CHROM%POS%REF_%FIRST_ALT' file.vcf