Rosalind — Bioinformatics Stronghold
Worked solutions to all 105 problems of the Rosalind Bioinformatics Stronghold. See the problem list.
105 problems — 105 solved, 0 partial. 105 carry assertions that run on every commit; 1 need a network connection and are checked separately.
Problem statements © rosalind.info — paraphrased, not reproduced. Titles, published sample datasets and expected answers are reproduced only as far as verification needs them. Every problem links to its rosalind.info page.
The solutions themselves are not published here. Rosalind asks that solutions not be posted outside their site, and this page cites Rosalind as an independent check on BioLang, so it reports what was verified rather than showing the code. Every problem below links to its own page on rosalind.info.
Sections
Or read every problem on a single page — heavier to load, but one place to scroll, search and print.
Sequence
10 problems — 10 solved
DNA, RNA, REVC, HAMM, GC, TRAN, CONS, REVP, CORR, KMER
Combinatorics
15 problems — 15 solved
FIB, FIBD, MRNA, PERM, PPER, SSET, PMCH, MMCH, CAT, LEXF, SIGN, LEXV, ASPC, MOTZ, PDPL
Translation
2 problems — 2 solved
PROT, SPLC
Motifs
6 problems — 6 solved
SUBS, LCSM, SSEQ, MPRT, ITWV, KSIM
Probability
12 problems — 12 solved
IPRB, IEV, LIA, SEXL, AFRQ, PROB, EVAL, EBIN, INDC, WFMD, RSTR, FOUN
Protein
1 problem — 1 solved
PRTM
Alignment
14 problems — 14 solved
EDIT, GLOB, LOCA, GAFF, OAP, SIMS, EDTA, CTEA, GCON, LAFF, SMGB, MGAP, MULT, OSYM
Graphs
2 problems — 2 solved
GRPH, DBRU
Phylogeny
19 problems — 19 solved
TREE, INOD, PDST, ROOT, CUNR, NWCK, NKEW, CTBL, SPTD, MEND, CSET, CSTR, ALPH, CNTQ, QRT, CHBP, EUBT, QRTD, RSUB
Dynamic programming
3 problems — 3 solved
LGIS, LCSQ, SCSP
Assembly
5 problems — 5 solved
ASMQ, LONG, PCOV, GASM, GREP
Orf
1 problem — 1 solved
ORF
Sets
1 problem — 1 solved
SETO
Strings
6 problems — 6 solved
KMP, TRIE, LING, LREP, MREP, SUFF
Mass spectrometry
5 problems — 5 solved
SPEC, CONV, PRSM, SGRA, FULL
Rna
1 problem — 1 solved
RNAS
Rearrangements
2 problems — 2 solved
REAR, SORT
Every problem
| Problem | Title | Status | Section | Checked |
|---|---|---|---|---|
| DNA | Counting DNA Nucleotides | solved | Sequence | verified by bl test |
| RNA | Transcribing DNA into RNA | solved | Sequence | verified by bl test |
| REVC | Complementing a Strand of DNA | solved | Sequence | verified by bl test |
| HAMM | Counting Point Mutations | solved | Sequence | verified by bl test |
| FIB | Rabbits and Recurrence Relations | solved | Combinatorics | verified by bl test |
| GC | Computing GC Content | solved | Sequence | verified by bl test |
| PROT | Translating RNA into Protein | solved | Translation | verified by bl test |
| SUBS | Finding a Motif in DNA | solved | Motifs | verified by bl test |
| FIBD | Mortal Fibonacci Rabbits | solved | Combinatorics | verified by bl test |
| IPRB | Mendel's First Law | solved | Probability | verified by bl test |
| IEV | Calculating Expected Offspring | solved | Probability | verified by bl test |
| MRNA | Inferring mRNA from Protein | solved | Combinatorics | verified by bl test |
| PRTM | Calculating Protein Mass | solved | Protein | verified by bl test |
| PERM | Enumerating Gene Orders | solved | Combinatorics | verified by bl test |
| PPER | Partial Permutations | solved | Combinatorics | verified by bl test |
| EDIT | Edit Distance | solved | Alignment | verified by bl test |
| GLOB | Global Alignment with Scoring Matrix | solved | Alignment | verified by bl test |
| LOCA | Local Alignment with Scoring Matrix | solved | Alignment | verified by bl test |
| GAFF | Global Alignment with Scoring Matrix and Affine Gap Penalty | solved | Alignment | verified by bl test |
| OAP | Overlap Alignment | solved | Alignment | verified by bl test |
| SSET | Counting Subsets | solved | Combinatorics | verified by bl test |
| PMCH | Perfect Matchings and RNA Secondary Structures | solved | Combinatorics | verified by bl test |
| MMCH | Maximum Matchings and RNA Secondary Structures | solved | Combinatorics | verified by bl test |
| CAT | Catalan Numbers and RNA Secondary Structures | solved | Combinatorics | verified by bl test |
| LIA | Independent Alleles | solved | Probability | verified by bl test |
| SEXL | Sex-Linked Inheritance | solved | Probability | verified by bl test |
| AFRQ | Counting Disease Carriers | solved | Probability | verified by bl test |
| PROB | Introduction to Random Strings | solved | Probability | verified by bl test |
| LEXF | Enumerating k-mers Lexicographically | solved | Combinatorics | verified by bl test |
| LCSM | Finding a Shared Motif | solved | Motifs | verified by bl test |
| TRAN | Transitions and Transversions | solved | Sequence | verified by bl test |
| SPLC | RNA Splicing | solved | Translation | verified by bl test |
| CONS | Consensus and Profile | solved | Sequence | verified by bl test |
| GRPH | Overlap Graphs | solved | Graphs | verified by bl test |
| REVP | Locating Restriction Sites | solved | Sequence | verified by bl test |
| TREE | Completing a Tree | solved | Phylogeny | verified by bl test |
| INOD | Counting Phylogenetic Ancestors | solved | Phylogeny | verified by bl test |
| SIGN | Enumerating Oriented Gene Orderings | solved | Combinatorics | verified by bl test |
| LGIS | Longest Increasing Subsequence | solved | Dynamic programming | verified by bl test |
| SSEQ | Finding a Spliced Motif | solved | Motifs | verified by bl test |
| PDST | Creating a Distance Matrix | solved | Phylogeny | verified by bl test |
| ASMQ | Assessing Assembly Quality with N50 and N75 | solved | Assembly | verified by bl test |
| ORF | Open Reading Frames | solved | Orf | verified by bl test |
| LEXV | Ordering Strings of Varying Length Lexicographically | solved | Combinatorics | verified by bl test |
| SETO | Introduction to Set Operations | solved | Sets | verified by bl test |
| LCSQ | Finding a Shared Spliced Motif | solved | Dynamic programming | verified by bl test |
| KMP | Speeding Up Motif Finding | solved | Strings | verified by bl test |
| DBRU | Constructing a De Bruijn Graph | solved | Graphs | verified by bl test |
| ASPC | Introduction to Alternative Splicing | solved | Combinatorics | verified by bl test |
| CORR | Error Correction in Reads | solved | Sequence | verified by bl test |
| SCSP | Interleaving Two Motifs | solved | Dynamic programming | verified by bl test |
| EVAL | Expected Number of Restriction Sites | solved | Probability | verified by bl test |
| LONG | Genome Assembly as Shortest Superstring | solved | Assembly | verified by bl test |
| KMER | k-Mer Composition | solved | Sequence | verified by bl test |
| EBIN | Wright-Fisher's Expected Behavior | solved | Probability | verified by bl test |
| SPEC | Inferring Protein from Spectrum | solved | Mass spectrometry | verified by bl test |
| ROOT | Counting Rooted Binary Trees | solved | Phylogeny | verified by bl test |
| CUNR | Counting Unrooted Binary Trees | solved | Phylogeny | verified by bl test |
| MOTZ | Motzkin Numbers and RNA Secondary Structures | solved | Combinatorics | verified by bl test |
| INDC | Independent Segregation of Chromosomes | solved | Probability | verified by bl test |
| TRIE | Introduction to Pattern Matching | solved | Strings | verified by bl test |
| WFMD | The Wright-Fisher Model of Genetic Drift | solved | Probability | verified by bl test |
| NWCK | Distances in Trees | solved | Phylogeny | verified by bl test |
| NKEW | Newick Format with Edge Weights | solved | Phylogeny | verified by bl test |
| CTBL | Creating a Character Table | solved | Phylogeny | verified by bl test |
| SPTD | Phylogeny Comparison with Split Distance | solved | Phylogeny | verified by bl test |
| CONV | Comparing Spectra with the Spectral Convolution | solved | Mass spectrometry | verified by bl test |
| PCOV | Genome Assembly with Perfect Coverage | solved | Assembly | verified by bl test |
| SIMS | Finding a Motif with Modifications | solved | Alignment | verified by bl test |
| MEND | Inferring Genotype from a Pedigree | solved | Phylogeny | verified by bl test |
| LING | Linguistic Complexity of a Genome | solved | Strings | verified by bl test |
| RSTR | Matching Random Motifs | solved | Probability | verified by bl test |
| EDTA | Edit Distance Alignment | solved | Alignment | verified by bl test |
| CTEA | Counting Optimal Alignments | solved | Alignment | verified by bl test |
| FOUN | The Founder Effect and Genetic Drift | solved | Probability | verified by bl test |
| GCON | Global Alignment with Constant Gap Penalty | solved | Alignment | verified by bl test |
| PRSM | Matching a Spectrum to a Protein | solved | Mass spectrometry | verified by bl test |
| PDPL | Creating a Restriction Map | solved | Combinatorics | verified by bl test |
| CSET | Fixing an Inconsistent Character Set | solved | Phylogeny | verified by bl test |
| LREP | Finding the Longest Multiple Repeat | solved | Strings | verified by bl test |
| MREP | Identifying Maximal Repeats | solved | Strings | verified by bl test |
| LAFF | Local Alignment with Affine Gap Penalty | solved | Alignment | verified by bl test |
| SMGB | Semiglobal Alignment | solved | Alignment | verified by bl test |
| MGAP | Maximizing the Gap Symbols of an Optimal Alignment | solved | Alignment | verified by bl test |
| CSTR | Creating a Character Table from Genetic Strings | solved | Phylogeny | verified by bl test |
| SUFF | Encoding Suffix Trees | solved | Strings | verified by bl test |
| SGRA | Using the Spectrum Graph to Infer Peptides | solved | Mass spectrometry | verified by bl test |
| FULL | Inferring Peptide from Full Spectrum | solved | Mass spectrometry | verified by bl test |
| ALPH | Alignment-Based Phylogeny | solved | Phylogeny | verified by bl test |
| GASM | Genome Assembly Using Reads | solved | Assembly | verified by bl test |
| MULT | Multiple Alignment | solved | Alignment | verified by bl test |
| GREP | Genome Assembly with Perfect Coverage and Repeats | solved | Assembly | verified by bl test |
| MPRT | Finding a Protein Motif | solved | Motifs | verified by bl test |
| OSYM | Isolating Symbols in Alignments | solved | Alignment | verified by bl test |
| ITWV | Finding Disjoint Motifs in a Gene | solved | Motifs | verified by bl test |
| CNTQ | Counting Quartets | solved | Phylogeny | verified by bl test |
| QRT | Quartets | solved | Phylogeny | verified by bl test |
| CHBP | Character-Based Phylogeny | solved | Phylogeny | verified by bl test |
| EUBT | Enumerating Unrooted Binary Trees | solved | Phylogeny | verified by bl test |
| QRTD | Quartet Distance | solved | Phylogeny | verified by bl test |
| RNAS | Wobble Bonding and RNA Secondary Structures | solved | Rna | verified by bl test |
| KSIM | Finding All Similar Motifs | solved | Motifs | verified by bl test |
| RSUB | Identifying Reversing Substitutions | solved | Phylogeny | verified by bl test |
| REAR | Reversal Distance | solved | Rearrangements | verified by bl test |
| SORT | Sorting by Reversals | solved | Rearrangements | verified by bl test |