Solving problems from using Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Charles Reid 9092f98bf6
Add solution to BA2F (#17)
1 year ago
chapter1 Add code for Chapter 2 (#6) 2 years ago
chapter2 Add solution to BA2F (#17) 1 year ago
chapter3 add chapter3 module, and rosalind functions for BA3a thru BA3c (#9) 2 years ago
rosalind Add solution to BA2F (#17) 1 year ago
scripts Continue work on Chapter 2 problems (#7) 2 years ago
stronghold Add Stronghold module (#8) 2 years ago
.gitignore Chapter1 part2 (#2) 2 years ago
.travis.yml add chapter3 module, and rosalind functions for BA3a thru BA3c (#9) 2 years ago
LICENSE clean up chapter 1, consolidate tests (#5) 2 years ago add chapter3 module, and rosalind functions for BA3a thru BA3c (#9) 2 years ago


rosalind is a Go (golang) package for solving bioinformatics problems.



This repo contains a Go (golang) library, rosalind, that implements
functionality for solving bioinformatics problems. This is mainly
useful for problems on but is for general use as well.

Rosalind problems are grouped by chapter. Each problem has its own
function and is implemented in a library called chapter1, chapter2,

For example, Chapter 1 question A is implemented in package
chapter1 as the function BA1a( <input-file-name> ).
This (specific) functionality wraps the (general purpose)
rosalind library.

Quick Start


The rosalind library can be installed using go get:

go get

The library can now be imported and its functions called directly.
Here is a brief example:

package main

import (

func main() {
    k := 4
    result, _ := rosalind.MostFrequentKmers(input, k)

Problem Sets

Each set of problems is grouped into its own package. These
packages import the rosalind package, so it should be

You can install the Chapter 1 problem set, for example, like so:

go get

This can now be imported and used in any Go program.

Try creating a main.go file in a temporary directory,
and run it with go run main.go:

package main

import (
    rch1 ""

func main() {
    filename := "rosalind_ba1a.txt"

Assuming an input file rosalind_ba1a.txt is available,
you should see a problem description and the output of
the problem, which can be copied and pasted into

$ go run main.go

Rosalind: Problem BA1a:
Most Frequest k-mers

Given an input string and a length k,
report the k-mer or k-mers that occur
most frequently.


Computed result from input file: for_real/rosalind_ba1a.txt

Command Line Interface



The repo contains the following directories:

  • rosalind/ - code and functions for the Rosalind library

  • chapter1/ - solutions to chapter 1 questions (utilizes rosalind library)

  • chapter2/ - solutions to chapter 2 questions

  • chapter3/ - solutions to chapter 3 questions

  • stronghold/ - solutions to questions from the stronghold section of

See the Readme file in each respective directory for more info.