Skip to main content

A simple Python class for generating custom orthogonal DNA/RNA barcodes.

Project description

Orthogonal Barcodes

A simple Python class for generating custom orthogonal DNA/RNA barcodes.

Features

  • Generate a configurable amount of barcodes.
  • Define length of barcodes.
  • GC percent filter.
  • Hamming distance filter.
  • Avoid common and custom restriction sites.
  • Custom motifs avoidance from barcodes.
  • Start and end sequence avoidance.
  • Avoid barcode homology to organism of interest.

Installation

pip install OrthogonalBarcodes

Quickstart

from OrthogonalBarcodes import OrthogonalBarcode

barcodes = OrthogonalBarcode.OrthogonalBarcode()
barcodes.length=25
barcodes.gc=50
barcodes.amount=10
barcodes.hamming_distance=4
barcodes.generate_barcodes()
print(barcodes.barcodes)

>
>

# Prints the list of barcodes below
['TTAGACGTGCAGTCGTCTTGACCCT', 'CCGTGTGGTCTCCCTCATGGTTAAA', 'GAGCCGGGTGAAACTCAAACTCAAC', 'AGTGGGGACTGTGCTAAGGCAAGAT', 'TGCAGCACCTTTGGTCACCTTTCTC', 'CAGCCGGTCTCCGATTATCTATCTC', 'TATGGGGAAGCTGTCGTGATTGGCT', 'GGCGCCACCAGAATCACTTTAAGTG', 'TACGGTCGATATGGATCCTTCCGTG', 'TGAGTCTCAGGTACGCAAGTTGCCT']

Full Usage

from OrthogonalBarcodes import OrthogonalBarcode

# Instantiate the class and set required/optional properties below.
barcodes = OrthogonalBarcode.OrthogonalBarcode()

# Required — The length of each barcode (Default:20)
barcodes.length=25

# Required — The GC percentage for each barcode generated (Default:50)
barcodes.gc=50

# Required — The amount of barcodes to generate (Default:1)
barcodes.amount=10

# Optional — Hamming distance between all barcodes. (Default:0)
barcodes.hamming_distance=4

# Optional — Fasta file path for organism of interest. (Default:none)
barcodes.ooi_file='tests/test_ooi.fasta'

# Optional — Maximum barcode homology to any part of the oranism of interest file Default:50)
barcodes.ooi_homology_threshold = 40

# Optional — List of restriction sites to avoid when generating barcodes. (Default:none; Accepts Bio.Restriction properties)
barcodes.avoid_rs=[EcoRI,BamHI,NheI,XhoI,KasI] 

# Optional — List of any motifs to filter from barcodes (Default: "AAAA","TTTT","CGCGCGCG","ATATATAT")
barcodes.avoid_motifs=["AAATTTT","TTTTTT","GGGGGGGG"] 

# Optional — List of starting sequences to avoid (Default: "ATATAT")
barcodes.avoid_start=["AAATTTT","TTTTTT","GGGGGGGG"] 

# Optional — List of ending sequences to avoid (Default: "ATATAT")
barcodes.avoid_end=["AAATTTT","TTTTTT","GGGGGGGG"] 

# Generate the barcodes
barcodes.generate_barcodes()

# Print a list of generated barcodes.
print(barcodes.barcodes)

>
>

# Prints the list of barcodes below
['AATCGATCGTGGCATCGTCCCTATC', 'GAAATCGAGACTCCGACCGATGTCT', 'GGTAACTAGTCCTAGATCAGCGAGG', 'AACAGTTCCTGGTGGTGTCTAGGCT', 'TGTTGCGTCCGTACTGTGGCGTAAA', 'CCGATTGATCTGACGTCGTGTCAAG', 'CTAGGACCATTGACTCGGCAACAAG', 'AATACTCACGATGCGATTTCCGCGG', 'TCGGTCTGTAGAGAGAGATACGTGC', 'AGGGTCGTCAGAAACTGAACCTGCT']

Notes

This class uses a brute force method to generate barcodes. The amount of time to generate barcodes increases greatly with the amount of barcodes being generated. Additionally, when filtering against an organism of interest or increasing the hamming distance between barcodes, the class will increase its complexity and barcode generation time will increase.

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

OrthogonalBarcodes-0.2.5.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

OrthogonalBarcodes-0.2.5-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file OrthogonalBarcodes-0.2.5.tar.gz.

File metadata

  • Download URL: OrthogonalBarcodes-0.2.5.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for OrthogonalBarcodes-0.2.5.tar.gz
Algorithm Hash digest
SHA256 78144b73cd6ec6c9f18c364b910d0d1afca552c6a7cffbe54856d16aaaa52997
MD5 1afac9c0ef44d5e7f9d4119d401f8224
BLAKE2b-256 1b5c659c504221aed8ddb2409c8d2c87c2f73778e810438c71a5141791c29fb0

See more details on using hashes here.

File details

Details for the file OrthogonalBarcodes-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for OrthogonalBarcodes-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 25b3b37106fe07a610fe00d8958221dc5ae3a88f6343ab1c11e41bece1d249a8
MD5 285ff1baba12a6a95358149348687ee8
BLAKE2b-256 c9a5493efa8b4243ac5c89db4ab777b6422cc110a0bb6302f10e1f2196e13827

See more details on using hashes here.

Supported by

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