Back to index

python-biopython  1.60
Classes | Functions
Bio.Emboss.PrimerSearch Namespace Reference

Classes

class  InputRecord
class  OutputRecord
class  Amplifier

Functions

def read

Detailed Description

Code to interact with the primersearch program from EMBOSS.

Function Documentation

def Bio.Emboss.PrimerSearch.read (   handle)
Get output from primersearch into a PrimerSearchOutputRecord

Definition at line 43 of file PrimerSearch.py.

00043 
00044 def read(handle):
00045     """Get output from primersearch into a PrimerSearchOutputRecord
00046     """
00047     record = OutputRecord()
00048 
00049     for line in handle:
00050         if not line.strip():
00051             continue
00052         elif line.startswith("Primer name"):
00053             name = line.split()[-1]
00054             record.amplifiers[name] = []
00055         elif line.startswith("Amplimer"):
00056             amplifier = Amplifier()
00057             record.amplifiers[name].append(amplifier)
00058         elif line.startswith("\tSequence: "):
00059             amplifier.hit_info = line.replace("\tSequence: ", "")
00060         elif line.startswith("\tAmplimer length: "):
00061             length = line.split()[-2]
00062             amplifier.length = int(length)
00063         else:
00064             amplifier.hit_info += line
00065 
00066     for name in record.amplifiers:
00067         for amplifier in record.amplifiers[name]:
00068             amplifier.hit_info = amplifier.hit_info.rstrip()
00069 
00070     return record