- Now `vcf` (the instance of `cyvcf2.VCF` is allowed to be passed as 2nd argument to `continuous` and `categorical` macros (45).
python
from vcfstats.macros import cont
cont
def GLOBAL_POS(variant, vcf):
chrom = variant.CHROM.replace("chr", "")
chridx = 23 if chrom == "X" else 24 if chrom == "Y" else int(chrom)
prev_chrom_lens = sum(vcf.seqlens[:(chridx-1)]
return prev_chrom_lens + variant.POS
Check the [API documentation](https://brentp.github.io/cyvcf2/docstrings.html) of cyvcf2 to see what information we can get from vcf.