This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I convert VCF to HGVS format?

Is there any library that I can use to convert VCF format to HGVS format?

I'm using a python module called myvariant, but this module only allows me to input HGVS formats.

But all I have is VCFs, so I'm wondering if there are any each methods (preferably a python module) for me to use to convert a VCF format to a HGVS format.

It would be best if I could convert mixed indel variants to HGVS format. For example something like (not real coordinates/variants): [VCF] chr1 112 AAAAAA TG --> convert to [HGVS] chr1:g.112_117delinsTG

Thank you in advance!

next-gen genome

3 answers

You can use tools such as VEP, SnpEff and Annovar to annotate your vcf file, which will also include HGVS notation of variants.

Take a look at the well named hgvs module: https://github.com/biocommons/hgvs

Yes, I've looked up hgvs and pyhgvs. However, it doesn't seem to give any functionality about simple coordinate-alternation (chromosome : position : ref : var) to HGVS format (chr1.g.2919391C>T) conversion. If it had given it, I would've definitely used it.

anyway to use hgvs on a custom reference? i want to get the hgvs representation convention, without relying on a public reference or external database.

You'll need to craft it manually. It would not be HGVS per se, but you could use the conventions to show position and edit on your custom sequence. The important part would be establishing context - identifiers are global and point to the sequence being used, so you'd need to give your sequence an identifier and use it with all the notations, along with explaining that the identifier you are using is local to the context you're using it in.

You may also be interested in this: https://batch.variantvalidator.org/vcf2hgvs/

From what I've seen, there are a number of VCF to HGVS converters, and they generally only look at a few VCF fields (e.g. Chr, Pos, Ref, Alt), so have some limitations.

Log in to answer this question.