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

::

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

::

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.1.tar.gz (12.9 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pymugen-1.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8e90b5320b723421ced37695d5f1809923df67ae68bcbea18cd8bb9d453ed5fa
MD5 a767e9e01c9239843fe99e57b177c804
BLAKE2b-256 ee180405b708f0e0e3e613f4b92b323801987582b24b947c35f7f65f72a89586

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