Given two strings
The position of a symbol in a string is the total number of symbols found to its left, including itself (e.g., the positions of all occurrences of 'U' in "AUGCUUCAGAAAGGUCUUACG" are 2, 5, 6, 15, 17, and 18). The symbol at position
A substring of
The location of a substring
Given: Two DNA strings
Return: All locations of
t = "GATATATGCATATACTT"
s = "ATAT"
lengtht =len(t)
lengths =len(s)
index = []
indexplus =[]
for i in range(0,lengtht-lengths):
if t[i:i+lengths]==s:
index.append(i)
for j in range(0,len(index)):
indexplus.append(str(index[j]+1))
print(" ".join(indexplus))
Combing Through the Haystack
Finding the same interval of DNA in the genomes of two different organisms (often taken from different species) is highly suggestive that the interval has the same function in both organisms.
We define a motif as such a commonly shared interval of DNA. A common task in molecular biology is to search an organism's genome for a known motif.
The situation is complicated by the fact that genomes are riddled with intervals of DNA that occur multiple times (possibly with slight modifications), called repeats. These repeats occur far more often than would be dictated by random chance, indicating that genomes are anything but random and in fact illustrate that the language of DNA must be very powerful (compare with the frequent reuse of common words in any human language).
The most common repeat in humans is the Alu repeat, which is approximately 300 bp long and recurs around a million times throughout every human genome (see Figure 1). However, Alu has not been found to serve a positive purpose, and appears in fact to be parasitic: when a new Alu repeat is inserted into a genome, it frequently causes genetic disorders.
'Python > rosaland' 카테고리의 다른 글
Mortal Fibonacci Rabbits (0) | 2018.12.05 |
---|---|
Consensus and Profile (0) | 2018.12.05 |
Translating RNA into Protein (0) | 2018.11.30 |
Mendel's First Law (0) | 2018.11.26 |
Counting Point Mutations (0) | 2018.11.21 |