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
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
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
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