Exemple #1
0
def findSequences(text):
    """ find dna in text and return as a list of tuples: (start, end, seq)
    >>> list(findSequences(" actg catgtgtg catgtgc  tgactg crap crap crap tga "))
    [(1, 30, 'actgcatgtgtgcatgtgctgactg')]
    """
    for row in pubDnaFind.nucleotideOccurrences(text):
        if row.seq == "":  # can only happen if seq is a restriction site
            continue
        yield row.start, row.end, row.seq
Exemple #2
0
def findSequences(text):
    """ find dna in text and return as a list of tuples: (start, end, seq)
    >>> list(findSequences(" actg catgtgtg catgtgc  tgactg crap crap crap tga "))
    [(1, 30, 'actgcatgtgtgcatgtgctgactg')]
    """
    for row in pubDnaFind.nucleotideOccurrences(text):
        if row.seq=="": # can only happen if seq is a restriction site
            continue
        yield row.start, row.end, row.seq
Exemple #3
0
    def annotateFile(self, articleData, fileData):
        """ interface for pubRun to get annotation lines for text """
        # find organisms in text
        dbs = set()
        text = fileData.content
        dbString = ",".join( set(findDbs(text)))

        # find dna in text and add organisms
        for row in pubDnaFind.nucleotideOccurrences(text):
            if row.seq=="": # can only happen if seq is a restriction site
                continue
            row = [str(x) for x in row]
            row.append(dbString)
            yield row
Exemple #4
0
    def annotateFile(self, articleData, fileData):
        """ interface for pubRun to get annotation lines for text """
        # find organisms in text
        dbs = set()
        text = fileData.content
        dbString = ",".join(set(findDbs(text)))

        # find dna in text and add organisms
        for row in pubDnaFind.nucleotideOccurrences(text):
            if row.seq == "":  # can only happen if seq is a restriction site
                continue
            row = [str(x) for x in row]
            row.append(dbString)
            yield row