Skip to content

Instantly share code, notes, and snippets.

@elowy01
Last active August 2, 2023 19:32
Show Gist options
  • Save elowy01/3bcabaae71d1a554b1976f416fa304b5 to your computer and use it in GitHub Desktop.
Save elowy01/3bcabaae71d1a554b1976f416fa304b5 to your computer and use it in GitHub Desktop.
from nucleus.io import vcf
from nucleus.util import variant_utils
with vcf.VcfReader('/home/ec2-user/DEEPVARIANT/NA12878_calls.vcf.gz') as reader:
print('Sample names in VCF: ', ' '.join(reader.header.sample_names))
for variant in reader:
print(variant_utils.variant_type(variant)) # variant type
print(variant.reference_name) # reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment