2

如何确定/找到任何基因组中最长的多聚嘌呤束(连续的 As 和 Gs,没有散布的 C 或 T,反之亦然),这需要在大肠杆菌基因组上。是找出多聚嘌呤束然后找出最长的链吗?还是将内含子和外显子从 DNA 上剪下来?由于大肠杆菌的基因组长 460 万个 BP,我需要一些帮助来分解它吗?

4

2 回答 2

3

我同意这个问题的方法学方面更适合https://biology.stackexchange.com/(即,是否应该去除内含子/外显子等),但简而言之,这完全取决于您正在尝试的生物学问题回答。如果您关心这些延伸是否跨越内含子/外显子边界,那么您不应该先拆分它们。但是,我不确定这与大肠杆菌序列是否相关,因为(据我所知)内含子和外显子是真核生物特有的。

为了解决这个问题的技术方面,这里有一些代码说明了如何使用 scikit-bio 做到这一点。(我还在这里发布了这个作为 scikit-bio 食谱的食谱。)

from __future__ import print_function
import itertools
from skbio import parse_fasta, NucleotideSequence

# Define our character sets of interest. We'll define the set of purines and pyrimidines here. 

purines = set('AG')
pyrimidines = set('CTU')


# Obtain a single sequence from a fasta file. 

id_, seq = list(parse_fasta(open('data/single_sequence1.fasta')))[0]
n = NucleotideSequence(seq, id=id_)


# Define a ``longest_stretch`` function that takes a ``BiologicalSequence`` object and the characters of interest, and returns the length of the longest contiguous stretch of the characters of interest, as well as the start position of that stretch of characters. (And of course you could compute the end position of that stretch by summing those two values, if you were interested in getting the span.)

def longest_stretch(sequence, characters_of_interest):
    # initialize some values
    current_stretch_length = 0
    max_stretch_length = 0
    current_stretch_start_position = 0
    max_stretch_start_position = -1

    # this recipe was developed while reviewing this SO answer:
    # http://stackoverflow.com/a/1066838/3424666
    for is_stretch_of_interest, group in itertools.groupby(sequence, 
                                                           key=lambda x: x in characters_of_interest):
        current_stretch_length = len(list(group))
        current_stretch_start_position += current_stretch_length
        if is_stretch_of_interest:
            if current_stretch_length > max_stretch_length:
                max_stretch_length = current_stretch_length
                max_stretch_start_position = current_stretch_start_position
    return max_stretch_length, max_stretch_start_position


# We can apply this to find the longest stretch of purines...

longest_stretch(n, purines)


# We can apply this to find the longest stretch of pyrimidines...

longest_stretch(n, pyrimidines)


# Or the longest stretch of some other character or characters.

longest_stretch(n, set('N'))


# In this case, we try to find a stretch of a character that doesn't exist in the sequence.

longest_stretch(n, set('X'))
于 2014-08-11T18:04:08.170 回答
2

现在在 scikit-bio 的(开发版本)中有一个方法,用于BiologicalSequence名为(和子类)的类find_features。例如

my_seq = DNASequence(some_long_string)
for run in my_seq.find_features('purine_run', min_length=10):
     print run

或者

my_seq = DNASequence(some_long_string)
all_runs = list(my_seq.find_features('purine_run', min_length=10))
于 2014-10-08T17:33:16.847 回答