Skip to content

David-OConnor/na_seq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nucleic Acid Sequence tools

Crate Docs PyPI

Home page

This Rust and Python library contains types and functions used for performing operations on DNA, RNA, and amino acid sequences. Its most fundamental types are the Nucleotide and AminoAcid enums, representing a single DNA nucleotide, and single amino acid respectively. This library is general, and intended to be used by any program or library that uses DNA sequences. It also includes an Element enum, with parameters associated with each element.

It includes functions to convert between &[Nucleotide] to string and vice-versa, and convert to and from u8 representations of the UTF-8 characters. It includes functions to serialize and deserialize in a compact binary format, with 2 bits per nucleotide.

It includes forcefield-parameter amino acid variants, as used by Amber as the AminoAcidProtenationVariant enum.

Basic types impl Display and ToStr, with variants in some cases, e.g. to display an AA as a single letter, or 3-letter string.

See the docs for details on data structures and functions available.

Also includes restriction enzyme and ligation basics.

Minmal python example. See the rust docs for adetails:

from na_seq import *

aa = AminoAcid.from_codons([Nucleotide.A, Nucleotide.T, Nucleotide.G])
aa = AminoAcid.from_str("HIS")

aa.to_str(AaIdent.OneLetter)
aa.to_str(AaIdent.ThreeLetters)

Element.C.atomic_weight()

seq = [Nucleotide.A, Nucleotide.T, Nucleotide.G, Nucleotide.C, Nucleotide.C]

seq_complement(seq)
# [G, G, C, A, T]

seq_from_str("ATGC")
# [A, T, G, C]

seq_to_str_lower(seq)
# 'atgc'

seq_aa_from_str("MKYS")
# [Met, Lys, Tyr, Ser]

seq_aa_to_str( #...)


el = Element.Carbon
el.atomic_weight()

seq_weight(seq)

Utility functionality

  • Sequence and nucleotide complements
  • Sequence and nucleotide weight
  • GC content, and misc general properties of elements and amino acids. ( e.g. hydrophobicity, weight, CPK colors)
  • A small restriction enzyme library

We may add Sequence searches, and other utility features in the future.

This library is used by the PlasCAD plasmid editor and Daedalus molecule viewer.

Note: The Python version currently does not include restriction-enzyme and ligation functionality.

About

Tools for working with DNA sequences

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages