Rosalind is a platform for learning bioinformatics through problem solving.
Questions tagged [rosalind]
56 questions
12
votes
5 answers
Fibonacci Rabbits Dying After Arbitrary # of Months
So, I've seen a few solutions for this problem or similar problems, but I really want to know why mine isn't working. It is much easier to read than a lot of solutions I've found, so I'd love to make it work!
Starting with 1 pair of rabbits, which…

spacecadet
- 251
- 1
- 3
- 9
9
votes
2 answers
Javascript is giving a different answer to same algorithm in Python
I'm working on the Rosalind problem Mortal Fibonacci Rabbits and the website keeps telling me my answer is wrong when I use my algorithm written JavaScript. When I use the same algorithm in Python I get a different (and correct) answer.
The…

Cristian
- 42,563
- 25
- 88
- 99
8
votes
4 answers
Rosalind: Mendel's first law
I'm trying to solve the problem at http://rosalind.info/problems/iprb/
Given: Three positive integers k, m, and n, representing a population
containing k+m+n organisms: k individuals are homozygous dominant for
a factor, m are heterozygous, and…

user4146164
- 81
- 1
- 3
7
votes
3 answers
Populate list with tuples
I'm just fiddling with a simulation of (Mendel's First Law of Inheritance).
Before i can let the critters mate and analyze the outcome, the population has to be generated, i.e., a list has to be filled with varying numbers of three different types…

Klaus-Dieter Warzecha
- 2,265
- 2
- 27
- 33
5
votes
1 answer
Algorithmic / probability exercise
I'm trying to solve an exercise from the rosalind project, but keep making some mistake apparently. The full text is available here, but my shorter abstract interpretation and attempt is as follows. Please help me find what am I doing wrong:
We have…

viraptor
- 33,322
- 10
- 107
- 191
3
votes
2 answers
Count frequency of values in pandas DataFrame
Having this pandas.core.frame.DataFrame:
Gorilla A T C C A G C T
Dog G G G C A A C T
Humano A T G G A T C T
Drosophila A A G C A A C C
Elefante T T G G A A C T
Mono A T G C C A T …

Manolo Dominguez Becerra
- 1,205
- 11
- 21
3
votes
1 answer
Computing the probability of an offspring having at least one dominant allele
I am trying to solve the 'Mendel's First Law' problem on http://rosalind.info/
I have tried several different approaches, but I just can't get my solution to return the same answer as the sample problem on their page. I know their sample output is…

user3468950
- 63
- 1
- 5
3
votes
3 answers
Cannot post Python code to the website rosalind.info
I am trying to post a sample solution, written in Python, to rosalind.info.
I tried following their instructions:
To highlight code, add a shebang styled first line :::lexername to your code. Replace lexername with the lexer keyword for the…

NickB
- 1,471
- 4
- 14
- 20
3
votes
1 answer
Finding a Motif in DNA
Problem can be found here:
http://rosalind.info/problems/subs/
The question I have has to do with the performance of the two solutions provided below.
1.
def indexOfAppearances(strand: String, subStrand: String): List[Int] = {
def help0(x:…
user1810593
2
votes
1 answer
Python: Rosalind Consensus and Profile
I am trying to solve the "Consensus and Profile" challenge on Rosalind.
The challenge instructions are as follows:
Given: A collection of at most 10 DNA strings of equal length (at most 1 kbp) in FASTA format.
Return: A consensus string and profile…

annabelperry
- 53
- 5
2
votes
0 answers
Rosalind: Open Reading Frame
I am working through the 'Rosalind' problems and I've become stuck on what the issue with my code is... The problem is:
Either strand of a DNA double helix can serve as the coding strand for
RNA transcription. Hence, a given DNA string implies…

KJTHoward
- 806
- 4
- 16
2
votes
1 answer
Rosalind: REVP failing the given case
I wrote a solution to this challenge . It successfully handles the example case given, but not the actual case.
Challenge:
A DNA string is a reverse palindrome if it is equal to its reverse complement. For instance, GCATGC is a reverse palindrome…

Hang Lin
- 51
- 4
2
votes
2 answers
Rosalind consensus and profile python
I'm working on the problem "Consensus nd Profile" on the Rosalind Bioinformatics website (http://rosalind.info/problems/cons/). I tried my code using the sample input on the website and my output matches the sample output. But when I tried the…

largecats
- 195
- 1
- 14
2
votes
2 answers
Rosalind: SUBS failing the given case
I wrote a solution to this challenge based on this answer. It successfully handles the example case given, but not the actual case.
Challenge:
Given two strings s and t, t is a substring of s if t is contained as a contiguous collection of symbols…

Mast
- 1,788
- 4
- 29
- 46
2
votes
2 answers
Fibonacci mortal rabbits with variable fecundity
I'm trying to modify the python code for Fibonacci mortal rabbits in order to vary the fecundity of the rabbits depending on their age.
Let's make an example.
My rabbits achieve maturity after 3 months and die after 6 months. During their 4 months…

Valentina
- 115
- 1
- 9