Questions tagged [rosalind]

Rosalind is a platform for learning bioinformatics through problem solving.

56 questions
2
votes
7 answers

Rosalind "Mendel's First Law" IPRB

As preparation for an upcoming bioinformatics course, I am doing some assignments from rosalind.info. I am currently stuck in the assignment "Mendel's First Law". I think I could brute force myself through this, but that somehow my thinking must be…
Bemmu
  • 17,849
  • 16
  • 76
  • 93
2
votes
1 answer

Why does modulo have to be performed during every iteration?

This is one of those questions where I stumbled upon the right answer, but I don't understand why it's the right one and Wikipedia didn't help. For Rosalind, I wrote a simple script for getting the number of all the possible RNA sequences from a…
thefourtheye
  • 607
  • 1
  • 6
  • 19
2
votes
7 answers

Beginner Python script for calculating GC content in DNA sequence

I'm trying to calculate the GC content (in %) of a DNA sequence for a Rosalind question. I have the following code, but it returns 0, or only the number of G's alone or C's alone (no percentage). x = raw_input("Sequence?:").upper() total = len(x) c…
jstewartmitchel
  • 171
  • 3
  • 3
  • 11
1
vote
0 answers

Solving the Rosalind challenge "Finding a Motif in DNA"

The problem I am currently working on gives you a DNA string and a substring. You need to have your code output the start location of each instance of the substring in the DNA string. For ex; given DNA string = "GATATATGCATATACTT" substring =…
Mell
  • 33
  • 5
1
vote
1 answer

Python - Rosalind Open Reading Frame Problem

There's an Open Reading Frame exercise on Rosalind, for which I get different results from what is obtained in the example task. The exercise description can be found here. I have this code: gencode = {"GCT": "A", "GCC": "A", "GCA": "A", "GCG":…
1
vote
1 answer

Strange behaviour of Python difflib library for sequence matcher

I am somewhat puzzled by a strange behaviour in the difflib library. I try to find overlapping sequences in strings (actually Fasta sequences from a Rosalind task) to glue them together. The code adapted from here works well with a smaller length of…
Mr. T
  • 11,960
  • 10
  • 32
  • 54
1
vote
1 answer

rosalind solution fixing: shared motifs

I am aware that there are solutions for rosalind challenges but I do not want them to spoil the fun. I thought I found a solution for "Finding a shared motif" yet my answer is wrong all the time. The question is about finding the longest common…
Fırat Uyulur
  • 149
  • 1
  • 11
1
vote
1 answer

Python: Multiple Consensus sequences

starting from a list of dna sequences, I must have in return all the possible consensus (the resulting sequence with the highest nucleotide frequency in each position) sequences. If in some positions the nucleotides have the same highest…
3lli0t
  • 67
  • 3
  • 8
1
vote
1 answer

runtime too long for GC skew

I'm currently working on a script that analyzes skew differences. Unfortunately, my problem is that when the length of the string increases, the runtime becomes too long and I can't seem to calculate my answer. def SkewGC(file): countG = 0 …
1
vote
1 answer

Partial Digest Algorithm (PDP)

I am trying to implement the partial digest problem, the algorithm is given in this pdf https://cise.ufl.edu/class/cap5515sp10/Ch04_DNA_mapping.pdf on pages 35-36. There is an example given on the subsequent pages. I am unable to get the the…
limitlessriver
  • 751
  • 1
  • 6
  • 9
1
vote
1 answer

Regex - Match multiple times in a string

I am trying to do a regex search on 'NNTSY` so that I can get two matches. NNTS NTSY When I attempted to match using the pattern ?N[^P][ST][^P])", I am only getting one match, which is NNTS. How can I use Regex to match NNTSY so…
dance2die
  • 35,807
  • 39
  • 131
  • 194
1
vote
4 answers

Why do I keep getting an index error when trying to delete, when replacing with a character works fine?

Programming newb/python newb, my job is super undemanding so I've found a lot of free time to teach myself how to code. I'm working this rosalind.info problem. Here is my code so far: # -*- coding: utf-8 -*- """ Created on Thu Jan 21 09:01:51…
CelineDion
  • 906
  • 5
  • 21
1
vote
2 answers

Python find function not working. What am I doing wrong?

I'm a hobbyist programmer (my actual my actual major is biology), so I apologize if the code is atrocious. Anyway, I'm doing a rosalind.info exercise (http://rosalind.info/problems/subs/) that wants to me find every index where a specific DNA motif…
GT.
  • 764
  • 1
  • 8
  • 30
1
vote
2 answers

Double-Degree Array

I have a problem Sample Dataset: Graph with which number of vertices is 5, number of edges is 4 and 1 2, 2 3, 4 3, 2 4 is an edge list. The degree array for this dataset is 1 3 2 2 0 (in the order of vertices). I did double-degree array for this…
0
votes
0 answers

Why is my solution to the Consensus Profile Rosalind Challenge wrong?

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 matrix for the collection. (If several possible consensus strings exist, then you may return any one of…