Documentation
¶
Overview ¶
Package rosa implements utility functions to facilitate problem solving on the bioinformatics platform Rosalind.
Index ¶
Examples ¶
Constants ¶
View Source
const ( // Stop indicates the stop of amino acid translation. Stop byte = 0 )
Variables ¶
This section is empty.
Functions ¶
func Prot ¶
Prot translates the provided RNA sequence to a protein which consists of a sequence of amino acids.
Example ¶
rna := "AUGGCCAUGGCGCCCAGAACUGAGAUCAAUAGUACCCGUAUUAACGGGUGA" prot, err := Prot(rna) if err != nil { log.Fatalln(err) } fmt.Println(prot)
Output: MAMAPRTEINSTRING
Types ¶
type FASTA ¶
type FASTA struct { // Seqs is a map from FASTA label names to DNA sequences. Seqs map[string]string // contains filtered or unexported fields }
FASTA handles labeled DNA sequences.
func ParseFASTA ¶
ParseFASTA reads data from r and parses it according to the FASTA file format.
Example ¶
// Parse FASTA. fas, err := ParseFASTA(strings.NewReader(s)) if err != nil { log.Fatalln(err) } // Sort keys. var labels []string for label := range fas.Seqs { labels = append(labels, label) } sort.Strings(labels) for _, label := range labels { dna := fas.Seqs[label] fmt.Println(label) fmt.Println(dna) }
Output: Rosalind_0808 CCACCCTCGTGGTATGGCTAGGCATTCAGGAACCGGAGAACGCTTCAGACCAGCCCGGACTGGGAACCTGCGGGCAGTAGGTGGAAT Rosalind_5959 CCATCGGTAGCGCATCCTTAGTCCAATTAAGTCCCTATCCAGGCGCTCCGCCGAAGGTCTATATCCATTTGTCAGCAGACACGC Rosalind_6404 CCTGCGGAAGATCGGCACTAGAATAGCCAGAACCGTTTCTCTGAGGCTTCCGGCCTTCCCTCCCACTAATAATTCTGAGG
func (*FASTA) Index ¶
Index returns the index of the provided label.
Example ¶
// Parse FASTA. fas, err := ParseFASTA(strings.NewReader(s)) if err != nil { log.Fatalln(err) } // Locate the index of the label named "Rosalind_0808". i, err := fas.Index("Rosalind_0808") if err != nil { log.Fatalln(err) } fmt.Println(i)
Output: 2
func (*FASTA) Label ¶
Label returns the nth label of the FASTA file.
Example ¶
// Parse FASTA. fas, err := ParseFASTA(strings.NewReader(s)) if err != nil { log.Fatalln(err) } // Locate the second label. label, err := fas.Label(1) if err != nil { log.Fatalln(err) } fmt.Println(label)
Output: Rosalind_5959
Click to show internal directories.
Click to hide internal directories.