Skip to content

Deyan2306/helix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helix 🧬

A lightweight functional programming-inspired bioinformatics library for Scala 3.
Helix makes it easy to work with DNA sequences, including validation, nucleotide counting, and random sequence generation, all in a clean and expressive way.


✨ Features

  • ✅ Validate DNA sequences
  • ✅ Convert DNA from/to strings
  • ✅ Count nucleotide frequencies
  • ✅ Generate random DNA sequences
  • ✅ Pretty-print results in the terminal with colors and tables
  • ✅ Fully immutable and FP-oriented design

📦 Installation

Currently, you can clone the repository and use it locally:

git clone https://github.com/Deyan2306/helix.git
cd helix

Then build/run with:

  • Scala CLI

    scala-cli run src
  • sbt

    sbt run

🛠 Usage

✅ Example Code

Create a Main.scala in your project:

import co.helix._
import scala.util.Random

object Main extends App {
  val dnaStr = "ACGTACGT"
  val dnaResult = DNA.fromString(dnaStr)

  // Pretty print validation
  PrettyPrinter.printValidation(dnaResult)

  dnaResult match {
    case Right(validDNA) =>
      // Count nucleotides
      val counts = Helix.countNucleotides(validDNA)
      PrettyPrinter.printCounts(counts)

      // Generate and print random DNA
      val randomDNA = Helix.randomDNA(10, new Random())
      PrettyPrinter.printRandomDNA(randomDNA)

    case Left(_) => // Already printed error
  }
}

✅ Output

✅ Valid DNA: ACGTACGT

 Nucleotide Counts:
┌────────────┬───────┐
│ Name       │ Count │
├────────────┼───────┤
│ Adenine    │     2 │
│ Cytosine   │     2 │
│ Guanine    │     2 │
│ Thymine    │     2 │
└────────────┴───────┘

🔹 Random DNA (length: 10):
GCTTAGCATA

📂 Project Structure

src/
  main/
    scala/
      co/
        helix/
          Nucleotide.scala   # Defines Nucleotide type
          DNA.scala          # DNA class with validation
          Helix.scala        # Core functions (count, random DNA)
          PrettyPrinter.scala# Colorful terminal printing

🚀 Roadmap

  • Add RNA support
  • Add complementary strand computation
  • Add ASCII double helix visualization
  • Publish as a Scala package

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to fork the repo and submit a PR.


👨‍💻 Author

Deyan Sirakov 📧 Email: deyan.sirakov2006@abv.bg 🌐 GitHub: Deyan2306


📜 License

This project is licensed under the MIT License.


About

helix is a bioinformatics library for scala

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages