Skip to main content

GenomeDiff (*.gd) file reader

Project description

genomediff-python parses files in the GenomeDiff format generated by the breseq variant caller for haploid microbial organisms.

Installation

pip3 install genomediff==0.1a

Only Python 3.x is tested.

Usage

GenomeDiff files are read using GenomeDiff.read(file). The GenomeDiff object contains a metadata dict with the meta data, as well as mutations, evidence and validation lists—each containing records of that type. Records can be accessed through this list or by id. GenomeDiff is iterable and iterating will return all records of all types.

>>> from genomediff import *
>>> document = GenomeDiff.read(open('MyDiff.gd', 'r', encoding='utf-8'))
>>> document.metadata
{'GENOME_DIFF': '1.0', 'AUTHOR': ''}
>>> document.mutations[0]
Record('SNP', 1, [191], new_seq='A', seq_id='NC_000913', snp_type='intergenic',  position=12346)
>>> document.mutations[0].parent_ids
[191]
>>> document[191]
Record('RA', 191, None, tot_cov='46/42', new_base='A', insert_position=0, ref_base='G', seq_id='NC_000913', quality=252.9, position=12345)

Contribution

Contribution to this project is welcomed. Wishlist:

  • Writing GD files
  • Automatically resolving parent_ids into parents
  • Python 2.x support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for genomediff, version 0.1a
Filename, size File type Python version Upload date Hashes
Filename, size genomediff-0.1a.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page