bcftools consensus: Making a chain file to convert coordinates BACK to input reference
Currently, bcftools consensus creates a chain file to convert coordinates from the reference to the newly-created consensus. It would be great if the directionality of the chain was documented, as I was under the impression it created a chain to lift coordinates back to the reference. Is there a way to create a chain file to convert back to the reference coordinates from the consensus coordinates, or can this be implemented in the consensus tool?
You may have figured this out already, but if I'm not mistaken this should be possible with the -c option of consensus. I was actually looking for the answer to the same question just now and found a post that seems to answer this: https://bioinformatics.stackexchange.com/questions/285/remapping-genomic-coordinates-to-account-for-indels
-c will create a chain file, but in the opposite direction I'm interested in. I'd like to go from new->old, not old->new.
I am happy to accept pull requests, but extremely unlikely to work on this myself.
oh well, since I stumbled on this issue ... UCSC has a utility for this called chainswap, which one can find by googling for the "Kent source tree", by following this link hgdownload.soe.ucsc.edu/admin/exe/ or by using (bio-) conda: ucsc-chainswap