0

For some reason, when counting the times a substring repeats within a string (a STR in a DNA), my code fails with the large database. It is not a matter of overlapping sequences, because the numbers that i get may be bigger than what I should get

# Get ADN
fADN = open(sys.argv[2])
ADN = fADN.read()

# Get STRs
STRs = arch.readline().split(",")
STRs[-1] = STRs[-1][:-1]
STRs = STRs[1:]

# Counting ocurrences
ocurrences = []
for i in range(len(STRs)):
    ocurrences.append(ADN.count(STRs[i]))
0

It turns out that for this problem, one has to keep track of the longest consecutive sequence of sequences, not just how many times a sequence repeats, which I think I was doing right

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .