Skip to main content

A Python library built in Rust for bioinformatics tasks, offering over 30 functions including dynamic programming and optimized data structures for enhanced performance.

Project description

Bioalgorithms

Overview

Bioalgorithms is a powerful library tailored for Python users but built in Rust, harnessing the efficiency and speed of compiled languages. With over 30 functions crafted for both bioinformatics and general programming tasks, this library integrates dynamic programming, greedy techniques, and optimized data structures such as hashmaps.

Beyond Python, Bioalgorithms offers compatibility with Rust, empowering developers to leverage its capabilities across different programming paradigms.

Features

  • Efficiency: Utilizes Rust's compiled nature for enhanced performance compared to interpreted languages like Python and JavaScript.
  • Comprehensive Functionality: Offers a diverse set of functions optimized for various bioinformatics and programming tasks.
  • Algorithmic Techniques: Implements advanced algorithms including dynamic programming and greedy strategies.
  • Data Structures: Leverages efficient data structures such as hashmaps to streamline problem-solving.

Installation

Prerequisites

  • Git
  • Python 3.x
  • Rust (for compiling Rust code)
  • maturin (for Rust bindings)

Installation Steps

  1. Clone Repository:

    git clone https://github.com/jero98772/Bioalgorithms.git
    
  2. Set Up Virtual Environment:

    cd Bioinformatics-toolspy
    python -m venv env
    source env/bin/activate
    pip install maturin
    
  3. Compile Rust Code:

    maturin develop
    
  4. Integration with Your Code: Place your Python file temporarily inside the folder and execute:

    python <your_file>
    

Code Documentation

For comprehensive documentation and usage guidelines, please refer to the Bioalgorithms Documentation. This documentation covers installation instructions, detailed explanations of available functions, code examples, and more. Whether you're a beginner exploring bioinformatics algorithms or an experienced developer seeking to optimize your workflows, the documentation serves as a valuable resource to unleash the full potential of Bioalgorithms.

Example of a code in python using all functions:

  import bioalgorithms
  print(bioalgorithms.levenshtein_distance("kitten","sitting"))
  print(bioalgorithms.sequence_aligment("AGGGCT","AGGCA",3,2))
  print(bioalgorithms.longest_commons_subsequences(["ACCGAAGG","ACCGAACC","CCACCGAAGG","GGACCGAACC"]))
  print(bioalgorithms.longest_common_subsequence("ACCGAAGG","ACCGAACC"))
  print(bioalgorithms.commun_patters(["XAaXV","XAsXV","XAcXV"]))
  print(bioalgorithms.reconstruct_from_kmers(3,["AAT","ATG", "TGC", "GCT", "CTA"]))#check this output
  print(bioalgorithms.translate_rna_to_aminoacid("AUGGCCAUGGCGCCCAGAACUGAGAUCAAUAGUACCCGUAUUAACGGGUGA"))
  print(bioalgorithms.de_bruijn_collection(["ATG", "ATG", "TGT", "TGG", "CAT", "GGA", "GAT", "AGA"], lambda kmer: kmer[:-1], lambda kmer: kmer[1:]))
  print(bioalgorithms.find_eulerian_cycle({"AAT": ["ATG"],"ATG": ["TGC"],"TGC": ["GCT"],"GCT": ["CTA"],"CTA": ["TAC"],"TAC": ["ACG"],"ACG": ["CGA"],"CGA": ["GAT"],"GAT": ["ATG"]}))
  print(bioalgorithms.de_bruijn(3, "ATGATCAAG"))
  print(bioalgorithms.grph_kmers(["ACCGA", "CCGAA", "CGAAG", "GAAGC", "AAGCT"]))
  print(bioalgorithms.reconstruct(["ACCGA", "CCGAA", "CGAAG", "GAAGC", "AAGCT"]))
  print(bioalgorithms.kmer_composition(2,'CAATCCAAC'))
  print(bioalgorithms.distance_between_pattern_and_strings("AA",['AAATTGACGCAT','GACGAAAAACGTT','CGTCAGCGCCTG''GCTGAGCAAAGG','AGTACGGGACAG']))
  print(bioalgorithms.gibbs(4, 5, 10,["GGCGTTCAGGCA", "AAGAATCAGTCA", "CAAGGAGTTCGC", "CACGTCAATCAC", "CAATAATATTCG"],1000))
  print(bioalgorithms.randomized_motif_search(3,5,["GGCGTTCAGGCA", "AAGAATCAGTCA", "CAAGGAGTTCGC", "CACGTCAATCAC", "CAATAATATTCG"],1))
  print(bioalgorithms.greedy_motif_search(3,5,["GGCGTTCAGGCA", "AAGAATCAGTCA", "CAAGGAGTTCGC", "CACGTCAATCAC", "CAATAATATTCG"]))
  print(bioalgorithms.most_probable("ACCTGTTTATTGCCTAAGTTCCGAACAAACCCAATATAGCCCGAGGGCCT",5,[[0.2, 0.2, 0.3, 0.2, 0.3],[0.4, 0.3, 0.1, 0.5, 0.1],[0.3, 0.3, 0.5, 0.2, 0.4],[0.1, 0.2, 0.1, 0.1, 0.2]]))
  print(bioalgorithms.median_string(['AAATTGACGCAT','GACGACCACGTT','CGTCAGCGCCTG''GCTGAGCACCGG','AGTACGGGACAG'],6))
  print(bioalgorithms.enumerate_motifs(["ATTTGGC","TGCCTTA","CGGTATC","GAAAATT"],3,1))
  print(bioalgorithms.pattern_to_number("CC"))
  print(bioalgorithms.number_to_pattern(5,2))
  print(bioalgorithms.generate_frequency_array("AAACAGATCACCCGCTGAGCGGGTTATCTGTT",1))
  print(bioalgorithms.reverse_complement("AAAAAGCATAAACATTAAAGAG"))
  print(bioalgorithms.frequent_words_mismatch("ACGTTGCATGTCGCATGATGCATGAGAGCT",4,1))
  print(bioalgorithms.approximate_pattern_matching("AAAAAGCATAAACATTAAAGAG","AAAAA",0))
  print(bioalgorithms.approximate_pattern_count("AAAAAGCATAAACATTAAAGAG","AAAAA",0))
  print(bioalgorithms.min_skew("CATGGGCATCGGCCATACGCC"))
  print(bioalgorithms.clump_finding("CGGACTCGACAGATGTGAAGAACGACAATGTGAAGACTCGACACGACAGAGTGAAGAGAAGAG",5,50,4))
  print(bioalgorithms.pattern_count("cgatatatccatag","ata"))
  print(bioalgorithms.frequent_words("actgactcccaccccc",3))
  print(bioalgorithms.pattern_count_positions("cgatatatccatag","ata"))
  print(bioalgorithms.hamming_distances("cgatatatccatag","ata"))

Purpose

Bioalgorithms is a project aimed at enhancing bioinformatics algorithm implementations, focusing on optimizing Python with Rust and PyO3 bindings. It aims to provide a complement to existing libraries like Biopython, featuring functions both in pure Python and Rust for improved performance.

Contribution

Contributions to this project are welcome. If you encounter any issues or have suggestions for improvement, please open an issue. For inquiries or assistance, contact jero98772@protonmail.com.

While the library shows promise, its future development may be uncertain due to other commitments.

Training material and documentation

book bioinformtics algorithms an active learning aproch solutions by Phillip Compeau and Pavel Pevzner

geeksforgeeks

References

Biocomp BookClub

https://github.com/weka511/bioinformatics

License

Bioalgorithms y is licensed under the GNU General Public License v3.0 (GPL-3.0). This license grants users the freedom to copy, modify, and distribute the software according to the terms outlined in the license agreement. If you choose to copy or redistribute the codebase, all you need to do is ensure that my name, jero98772, is included in the credits or acknowledgments. This requirement ensures proper attribution and helps maintain transparency in the open-source community.

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

bioalgorithms-1.1.0.tar.gz (168.7 kB view details)

Uploaded Source

Built Distribution

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

bioalgorithms-1.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (378.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file bioalgorithms-1.1.0.tar.gz.

File metadata

  • Download URL: bioalgorithms-1.1.0.tar.gz
  • Upload date:
  • Size: 168.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.6.0

File hashes

Hashes for bioalgorithms-1.1.0.tar.gz
Algorithm Hash digest
SHA256 dfadfceec54c9de0c9b5af7aec01063686c367c4110764a20127484658d9f20a
MD5 c2bbbf9dfa495d445355bf1d5b73d843
BLAKE2b-256 701b7d6d23cbb8da7bc5f39c2f2a1c8669135403156b78a6b3784a6fe26388bc

See more details on using hashes here.

File details

Details for the file bioalgorithms-1.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for bioalgorithms-1.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1f1f375536587b869aaad546fe3d4c4b3c36ab494650d9ec9ede1b5fba894b72
MD5 d85c922db57303e80f4f4cddae2217b1
BLAKE2b-256 89a3c6ae3a598bfc6696f6ae892b28a908d42c7efdd2def1702110d85f30134f

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