Back to index

python-biopython  1.60
Classes | Functions | Variables
Bio.PDB.PSEA Namespace Reference

Classes

class  PSEA

Functions

def run_psea
def psea
def psea2HEC
def annotate

Variables

tuple p = PDBParser()
tuple s = p.get_structure('X', sys.argv[1])

Function Documentation

def Bio.PDB.PSEA.annotate (   m,
  ss_seq 
)
Apply seconardary structure information to residues in model.

Definition at line 69 of file PSEA.py.

00069 
00070 def annotate(m, ss_seq):
00071     """Apply seconardary structure information to residues in model."""
00072     c=m.get_list()[0]
00073     all=c.get_list()
00074     residues=[]
00075     # Now remove HOH etc.
00076     for res in all:
00077         if is_aa(res):
00078             residues.append(res)
00079     L=len(residues)
00080     if not (L==len(ss_seq)):
00081         raise ValueError("Length mismatch %i %i" % (L, len(ss_seq)))
00082     for i in range(0, L):
00083         residues[i].xtra["SS_PSEA"]=ss_seq[i]
00084     #os.system("rm "+fname)

Here is the call graph for this function:

Here is the caller graph for this function:

def Bio.PDB.PSEA.psea (   pname)
Parse PSEA output file.

Definition at line 38 of file PSEA.py.

00038 
00039 def psea(pname):
00040     """Parse PSEA output file."""
00041     fname=run_psea(pname)
00042     start=0
00043     ss=""
00044     fp=open(fname, 'r')
00045     for l in fp.readlines():
00046         if l[0:6]==">p-sea":
00047             start=1
00048             continue
00049         if not start:
00050             continue
00051         if l[0]=="\n":
00052             break
00053         ss=ss+l[0:-1]
00054     fp.close()
00055     return ss

Here is the call graph for this function:

Here is the caller graph for this function:

def Bio.PDB.PSEA.psea2HEC (   pseq)
Translate PSEA secondary structure string into HEC.

Definition at line 56 of file PSEA.py.

00056 
00057 def psea2HEC(pseq):
00058     """Translate PSEA secondary structure string into HEC."""
00059     seq=[]
00060     for ss in pseq:
00061         if ss=="a":
00062             n="H"
00063         elif ss=="b":
00064             n="E"
00065         elif ss=="c":
00066             n="C"
00067         seq.append(n)
00068     return seq

Here is the caller graph for this function:

def Bio.PDB.PSEA.run_psea (   fname)
Run PSEA and return output filename.

Note that this assumes the P-SEA binary is called "psea" and that it is
on the path.

Note that P-SEA will write an output file in the current directory using
the input filename with extension ".sea".

Note that P-SEA will write output to the terminal while run.

Definition at line 22 of file PSEA.py.

00022 
00023 def run_psea(fname):
00024     """Run PSEA and return output filename.
00025     
00026     Note that this assumes the P-SEA binary is called "psea" and that it is
00027     on the path.
00028     
00029     Note that P-SEA will write an output file in the current directory using
00030     the input filename with extension ".sea".
00031     
00032     Note that P-SEA will write output to the terminal while run.
00033     """
00034     os.system("psea "+fname)
00035     last=fname.split("/")[-1]
00036     base=last.split(".")[0]
00037     return base+".sea"

Here is the caller graph for this function:


Variable Documentation

tuple Bio.PDB.PSEA.p = PDBParser()

Definition at line 105 of file PSEA.py.

tuple Bio.PDB.PSEA.s = p.get_structure('X', sys.argv[1])

Definition at line 106 of file PSEA.py.