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

Uploaded Source

File details

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

File metadata

  • Download URL: pymugen-1.1.tar.gz
  • Upload date:
  • Size: 1.7 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.1.tar.gz
Algorithm Hash digest
SHA256 cb351568b03a270fe4dd2a8c16ecf84f82e673cdaca49606991fc32a1e82544c
MD5 81f151327275f9e31625e8ec6182bc63
BLAKE2b-256 d1b65ee1e0c14c4dd411d88d9b9a40d562f94822cc3d600dafd1c09861a627d8

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