Minimaistic VCf parser in python
Project description
vcfparser
Python parser for parsing the genomics and transcriptomics VCF data.
Installation and setup
- Clone this repo
git clone https://github.com/everestial/vcfparser
cd vcfparser
Usage
from vcf_parser import VcfParser
# instantiate a vcf object by passing file name
filepath = 'input_test.vcf'
vcf_object = VcfParser(filepath)
Get MetaInfo about the vcf file
metainfo = vcf_object.parse_metadata()
print(f'Fileformat for given vcf is : {metainfo.fileformat}')
print(f'Filters for given vcf are : {metainfo.filters_}')
print(f' Contig lines are : {metainfo.contig}')
print(f' Dictionary of infos is : {metainfo.infos_}')
print(f' Sample names are : {metainfo.sample_names}')
print("Raw lines are:")
print(metainfo.raw_meta_data)
Get Records from vcf file
records = vcf_object.parse_records() # this creates a generator object
for record in records:
# you can access methods and attributes of record object as
chrom = record.CHROM
pos = record.POS
id = record.ID
ref = record.REF
alt = record.ALT
qual = record.QUAL
filter = record.FILTER
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vcfparser-0.1.6.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for vcfparser-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b46a7d5e4acf3f4d7adf1a404b66ccaa750c76b236c0a28a68097f4b8a22690 |
|
MD5 | 67f6ff979c608d805d9000af3eaaf460 |
|
BLAKE2b-256 | 6644ad87cd08c2b286f141201dfe12c8f0177aa507bba8634a64ce79097b4f80 |