Skip to main content

Small python library to search snp in primer by position or by sequence.

Project description

SNPrimer

Small python library to search snp in primer by position or by sequence.

Installation

pip install snprimer

Usage

🎯 By position 🎯

from snprimer import PositionRange

position = PositionRange("chr8",19818430, 19818440)
print(position)
# PositionRange(chr='chr8', start=19818430, end=19818440, strand=None, snp=[SNP(id='chr8:g.19818436C>G', rsid='rs316', vaf=0.15300000000000002), SNP(id='chr8:g.19818436C>T', rsid='rs316', vaf=0.15300000000000002)])
for snp in position.get_snp(max_vaf=0.05):
    print(snp)
#SNP(id='chr8:g.19818436C>G', rsid='rs316', vaf=0.15300000000000002)
#SNP(id='chr8:g.19818436C>T', rsid='rs316', vaf=0.15300000000000002)

🔤 By sequence 🔤

from snprimer import Primer

primer = Primer("CACACAGATCAGAGGGCCAAC")
print(primer)
#Primer(seq='CACACAGATCAGAGGGCCAAC', position_ranges=[PositionRange(chr='chr1', start=26774827, end=26774847, strand='+', snp=[SNP(id='chr1:g.26774827G>A', rsid='rs2075289787', vaf=0), SNP(id='chr1:g.26774830A>G', rsid='rs986550282', vaf=0.0), SNP(id='chr1:g.26774842T>C', rsid='rs1440652363', vaf=0.0)])])
primer.infos(max_vaf=0)
#CACACAGATCAGAGGGCCAAC has snp with vaf > 0 : [SNP(id='chr1:g.26774827G>A', rsid='rs2075289787', vaf=0), SNP(id='chr1:g.26774830A>G', rsid='rs986550282', vaf=0.0), SNP(id='chr1:g.26774842T>C', rsid='rs1440652363', vaf=0.0)]

🖥️In silico PCR🖥️

from pathlib import Path
from snprimer import Primer, PrimerPair

a = Primer("GGAGATGTACAGCGTGCCATAC", "hg19")
b = Primer("TACATCTTGCTGAGGGGAAGGC", "hg19")
pp = PrimerPair(a, b)
pcr = pp.make_pcr(Path('/path/to/hg19.fa'))
print(pcr)

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

snprimer-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snprimer-0.2.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file snprimer-0.2.0.tar.gz.

File metadata

  • Download URL: snprimer-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.10 Linux/5.19.0-14.3-liquorix-amd64

File hashes

Hashes for snprimer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 052e8d663fdb24549c19b0d70320101634cc38080c1d1d506ee193780c28f3bc
MD5 60ba6c2db79794c94ba00284b87abe2f
BLAKE2b-256 e6dba434c3bea74a628c106e9ca61c28e7fd032c4c21a72dfb54415b34634292

See more details on using hashes here.

File details

Details for the file snprimer-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: snprimer-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.10 Linux/5.19.0-14.3-liquorix-amd64

File hashes

Hashes for snprimer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a413773e378706aaa512f4be1bf6f639ddf5518c0dc093ac96e9f2756eab8de
MD5 9bd438e0a28fa77d0a3711cf3f4a815a
BLAKE2b-256 a035c0e551011b22e9e91519b62949e0f2ba2f3bd1d29743a3e87ccb8bd33dfb

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