Solving problems from Rosalind.info 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)
6 years ago
chapter1 Add code for Chapter 2 (#6) 6 years ago
chapter2 Add solution to BA2F (#17) 6 years ago
chapter3 add chapter3 module, and rosalind functions for BA3a thru BA3c (#9) 6 years ago
rosalind Add solution to BA2F (#17) 6 years ago
scripts Continue work on Chapter 2 problems (#7) 6 years ago
stronghold Add Stronghold module (#8) 6 years ago
.gitignore Chapter1 part2 (#2) 6 years ago
.travis.yml add chapter3 module, and rosalind functions for BA3a thru BA3c (#9) 6 years ago
LICENSE clean up chapter 1, consolidate tests (#5) 6 years ago
Readme.md add chapter3 module, and rosalind functions for BA3a thru BA3c (#9) 6 years ago

Readme.md

go-rosalind

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

travis golang license godoc

Summary

This repo contains a Go (golang) library, rosalind, that implements functionality for solving bioinformatics problems. This is mainly useful for problems on Rosalind.info 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, etc.

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

Rosalind

The rosalind library can be installed using go get:

go get https://github.com/charlesreid1/go-rosalind/rosalind

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

package main

import (
    "fmt"
    "github.com/charlesreid1/go-rosalind/rosalind"
)

func main() {
    input := "AAAATGCGCTAGTAAAAGTCACTGAAAA"
    k := 4
    result, _ := rosalind.MostFrequentKmers(input, k)
    fmt.Println(result)
}

Problem Sets

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

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

go get https://github.com/charlesreid1/go-rosalind/chapter1

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 "github.com/charlesreid1/go-rosalind/chapter1"
)

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

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 Rosalind.info:

$ 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.

URL: http://rosalind.info/problems/ba1a/


Computed result from input file: for_real/rosalind_ba1a.txt
39

Command Line Interface

TBA

Organization

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 Rosalind.info

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