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!
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.
There is no
hgvs_g_to_c
method that does exactly what you want? Maybe things have changed in the past couple of years, but I don't know if they'd remove a functionality.EDIT: It does exist. See http://hgvs.readthedocs.io/en/stable/modules/mapping.html?highlight=g_to_c
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.