https://github.com/matmoore/rosalind-problems
Solutions to bioinformatics problems
https://github.com/matmoore/rosalind-problems
Last synced: about 1 year ago
JSON representation
Solutions to bioinformatics problems
- Host: GitHub
- URL: https://github.com/matmoore/rosalind-problems
- Owner: MatMoore
- Created: 2023-03-22T18:35:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-03T20:33:31.000Z (almost 3 years ago)
- Last Synced: 2025-02-08T12:47:08.609Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rosalind problems
This repo contains my solutions to the bioinformatics problems at https://rosalind.info/problems
## To run the solutions
- `ruby runner.rb` runs all the solutions.
- `ruby runner.rb PROBLEM_ID` runs a single solution.
- `ruby runner.rb -o PROBLEM_ID` copies an input from `~/Downloads`, then runs the solution.
## Some fun ruby stuff I used along the way
### Zeitwerk
The runner module uses the [Zeitwerk](https://github.com/fxn/zeitwerk) autoloader to eager load all the code for the project, based on the directory structure. This saves me writing lots of 'require' statements.
### Characterization testing
The runner uses [characertization testing](https://en.wikipedia.org/wiki/Characterization_test) to ensure my previous solutions don't break when refactoring code.
This works great for exercises like this, since my definition of working code is simply: "does it produce a solution that was marked correct?".
### Data classes
Ruby 3.2 added a new data class for defining immutable value objects. I use it in the `GeneticString` module for modelling DNA and RNA.
I made the classes themselves private and provided factory methods to make sure sequences are valid when constructing these values.