Chaz Reid 9092f98bf6
Add solution to BA2F (#17)
* add a maxint and minint utility function

* add problems ba2f and ba2g

* remove ba2g for now

* adding BA2f to chapter 2 problems

* add BA2f solution (failing)

* remove expensive test

* fix random motif generator script (random number problems)

* fix how we aggregate over multiple random motif searches

* call random motif search multiple times

* update BA2F so eet wurk

* make tests a lil easier

* add ba2f input file, whoops

* add ba2g - gibbs sampler

* update BA2g solution with bug fixes

* add ba2g to chapter 2 tests. add ba2g input file.
2019-04-02 18:24:02 -07:00
2019-01-01 13:28:33 -08:00
2019-04-02 18:24:02 -07:00
2019-04-02 18:24:02 -07:00
2019-01-01 21:49:54 -08:00
2018-12-29 23:07:59 -08:00

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.

Description
Solving problems from Rosalind.info using Go
Readme 6.2 MiB
Languages
Go 94%
Python 3.5%
Jinja 1.8%
Shell 0.7%