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

python setup.py install

Only Python 3.x is tested.

Usage

GenomeDiff files are read using GenomeDiff.read(file). The GenomeDiff object contains a metadata dict with the metadata, 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)
>>> document.mutations[0].parents
[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)]
>>> document.write(open('NewDiff.gd', 'w', encoding='utf-8'))

Project details


Download files

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

Source Distribution

genomediff-0.4.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

genomediff-0.4.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file genomediff-0.4.1.tar.gz.

File metadata

  • Download URL: genomediff-0.4.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for genomediff-0.4.1.tar.gz
Algorithm Hash digest
SHA256 61027cf473797944cafefef810877056af7fee1c242d887d025591d3ecc97df6
MD5 6b0109b423bdfc7a68d79b3eb6b92e8a
BLAKE2b-256 d40d93f420a1a503f55f8133b0c681e75311c832ea49ba2c37ad6a50512c80a1

See more details on using hashes here.

File details

Details for the file genomediff-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: genomediff-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for genomediff-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9c43661e558dca08a1332c8d8334e5ca68783206ff9b802bc6b7ff9bf4125bf
MD5 2d104437cd899ed1706bf0f82180e4e3
BLAKE2b-256 870879dd25becefe1de41e93c7f53bc6e3594692a5cc0507db8511c9c521f5ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page