Back to index

python-biopython  1.60
Public Member Functions
xbb_translations.xbb_translations Class Reference

List of all members.

Public Member Functions

def __init__
def frame1
def complement
def reverse
def antiparallel
def frame
def header_nice
def frame_nice
def gc
def gcframe

Detailed Description

Definition at line 16 of file xbb_translations.py.


Constructor & Destructor Documentation

Definition at line 17 of file xbb_translations.py.

00017 
00018     def __init__(self):
00019         ""


Member Function Documentation

Definition at line 30 of file xbb_translations.py.

00030 
00031     def antiparallel(self, seq):
00032         return reverse_complement(seq)
    

Here is the call graph for this function:

Definition at line 23 of file xbb_translations.py.

00023 
00024     def complement(self, seq):
00025         #TODO - use Seq methods instead of this hack:?
00026         return reverse_complement(seq)[::-1]

Here is the call graph for this function:

Here is the caller graph for this function:

def xbb_translations.xbb_translations.frame (   self,
  seq,
  frame,
  translation_table = 1 
)

Definition at line 33 of file xbb_translations.py.

00033 
00034     def frame(self, seq, frame, translation_table = 1):
00035         if not ((-3 <= frame <= -1) or (1 <= frame <= 3)):
00036             frame = 1
00037         if frame != 1 :
00038             raise NotImplementedError
00039             #TODO - Support the frame argument
00040             #The old code didn't, but I can guess from
00041             #the code the expected 1,2,3 for the forward
00042             #strands and -1,-2,-3 for the reverse.
00043         return translate(seq, table=translation_table)

Here is the call graph for this function:

Here is the caller graph for this function:

def xbb_translations.xbb_translations.frame1 (   self,
  seq,
  translation_table = 1 
)

Definition at line 20 of file xbb_translations.py.

00020 
00021     def frame1(self, seq, translation_table = 1):
00022         return translate(seq, table=translation_table)

Here is the call graph for this function:

Here is the caller graph for this function:

def xbb_translations.xbb_translations.frame_nice (   self,
  seq,
  frame,
  translation_table = 1 
)

Definition at line 61 of file xbb_translations.py.

00061 
00062     def frame_nice(self, seq, frame, translation_table = 1):
00063         length = len(seq)
00064         protein = self.frame(seq, frame, translation_table)
00065         res = self.header_nice('Plus one frame translation',seq)
00066         for i in range(0,length,60):
00067             subseq = seq[i:i+60]
00068             p = i/3
00069             res += '%d/%d\n' % (i+1, i/3+1)
00070             res += '  '.join(map(None,protein[p:p+20])) + '\n'
00071             # seq
00072             res += subseq.lower() + '%5d %%\n' % int(self.gc(subseq))
00073 
00074         return res
    

Here is the call graph for this function:

def xbb_translations.xbb_translations.gc (   self,
  seq 
)
Returns a float between 0 and 100.

Definition at line 75 of file xbb_translations.py.

00075 
00076     def gc(self, seq):
00077         """Returns a float between 0 and 100."""
00078         return GC(seq)
    

Here is the call graph for this function:

Here is the caller graph for this function:

def xbb_translations.xbb_translations.gcframe (   self,
  seq,
  translation_table = 1 
)

Definition at line 79 of file xbb_translations.py.

00079 
00080     def gcframe(self, seq, translation_table = 1):
00081         # always use uppercase nt-sequence !!
00082         comp = self.complement(seq)
00083         anti = self.reverse(comp)
00084         length = len(seq)
00085         frames = {}
00086         for i in range(0,3):
00087             frames[i+1]  = self.frame1(seq[i:], translation_table)
00088             frames[-(i+1)] = self.reverse(self.frame1(anti[i:], translation_table))
00089 
00090         res = self.header_nice('GCFrame', seq)
00091 
00092         for i in range(0,length,60):
00093             subseq = seq[i:i+60]
00094             csubseq = comp[i:i+60]
00095             p = i/3
00096             # + frames
00097             res += '%d/%d\n' % (i+1, i/3+1)
00098             res += '  ' + '  '.join(map(None,frames[3][p:p+20])) + '\n'
00099             res += ' ' + '  '.join(map(None,frames[2][p:p+20])) + '\n'
00100             res += '  '.join(map(None,frames[1][p:p+20])) + '\n'
00101             # seq
00102             res += subseq.lower() + '%5d %%\n' % int(self.gc(subseq))
00103             res += csubseq.lower() + '\n'
00104             # - frames
00105             res += '  '.join(map(None,frames[-2][p:p+20]))  +' \n'
00106             res += ' ' + '  '.join(map(None,frames[-1][p:p+20])) + '\n'
00107             res += '  ' + '  '.join(map(None,frames[-3][p:p+20])) + '\n\n'
00108             
00109             
00110         return res
        

Here is the call graph for this function:

def xbb_translations.xbb_translations.header_nice (   self,
  txt,
  seq 
)

Definition at line 44 of file xbb_translations.py.

00044 
00045     def header_nice(self, txt, seq):
00046         length = len(seq)
00047         if length > 20:
00048             short = '%s ... %s' % (seq[:10], seq[-10:])
00049         else:
00050             short = seq
00051             
00052         date = time.strftime('%y %b %d, %X', time.localtime(time.time()))
00053         res = '%s: %s, ' % (txt,date)
00054 
00055         for nt in ['a','t','g','c']:
00056             res += '%s:%d ' % (nt, seq.count(nt.upper()))
00057 
00058         res += '\nSequence: %s, %d nt, %0.2f %%GC\n' % (short.lower(),length, self.gc(seq))       
00059         res += '\n\n'
00060         return res
        

Here is the call graph for this function:

Here is the caller graph for this function:

def xbb_translations.xbb_translations.reverse (   self,
  seq 
)

Definition at line 27 of file xbb_translations.py.

00027 
00028     def reverse(self, seq):
00029         return seq[::-1]

Here is the caller graph for this function:


The documentation for this class was generated from the following file: