Skip to main content

Management about FASTA and VCF files.

Project description

pymugen

This module allows to manage data about genomic sequences, specificaly getting sequences from a FASTA file.

The module's other functionality is the ability to get sequences with a mutation from a VCF file and transform it to another representation.

Installation

Install pymugen with python

pip3 install pymugen

Usage/Examples

Fasta example

.. code-block:: python

from pymugen.fasta import FastaReader

fasta = FastaReader("fasta.fa")

chromosome = fasta['chr1'] sequence = chromosome.sequence(10, 5, 5)

sequence[1]

A

sequence[:]

CATGCATGCAT

str(sequence)

C-A-T-G-C,A,T-G-C-A-T

chromosome[5: 16]

CATGCATGCAT

VCF example

.. code-block:: python

from pymugen.transformers import ExtendedTransformer from pymugen.fasta import FastaReader

vcf = ExtendedTransformer("vcf.vcf", "fasta.fa")

fasta = FastaReader("fasta.fa")

chromosome = fasta['chr1'] sequence = chromosome.sequence(10, 5, 5)

mutated = vcf.method(sequence, "CGT")

str(mutated)

'A|w-q-r-e-w,s-d-f,v-c-x-z-v'

mutated[:]

'wqrewsdfvcxzv'

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

pymugen-1.2.tar.gz (12.9 kB view details)

Uploaded Source

File details

Details for the file pymugen-1.2.tar.gz.

File metadata

  • Download URL: pymugen-1.2.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.8.0 tqdm/4.56.0 CPython/3.8.10

File hashes

Hashes for pymugen-1.2.tar.gz
Algorithm Hash digest
SHA256 d00e8521ec57547dc9968bda7d765bb9c2cd5570859327b39db4d1a727ee1711
MD5 3a7857fd135e5f2701d265c9ae4ee0d2
BLAKE2b-256 e2e655d1d0b01b6b95af731acdfa6dfa02986be7eb5572beec2f830cf9403c8b

See more details on using hashes here.

Supported by

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