Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
SeqGui.SeqPanel Class Reference

List of all members.

Public Member Functions

def __init__
def OnClose
def OnApply
def OnClear
def translate
def transcribe
def back_transcribe

Public Attributes

 parent
 src_text
 dest_text

Detailed Description

Definition at line 72 of file SeqGui.py.


Constructor & Destructor Documentation

def SeqGui.SeqPanel.__init__ (   self,
  parent,
  log 
)

Definition at line 73 of file SeqGui.py.

00073 
00074     def __init__(self, parent, log):
00075         self.parent = parent
00076         wx.Panel.__init__(self, parent, -1)
00077         apply_button = wx.Button(self, ID_APPLY, "Apply")
00078         clear_button = wx.Button(self, ID_CLEAR, "Clear")
00079         close_button = wx.Button(self, ID_CLOSE, "Close")
00080         wx.EVT_BUTTON(self, ID_CLOSE, self.OnClose)
00081         wx.EVT_BUTTON(self, ID_APPLY, self.OnApply)
00082         wx.EVT_BUTTON(self, ID_CLEAR, self.OnClear)
00083 
00084         lc = wx.LayoutConstraints()
00085         lc.bottom.SameAs(self, wx.Bottom, 10)
00086         lc.left.SameAs(self, wx.Left, 10)
00087         lc.height.AsIs()
00088         lc.width.PercentOf(self, wx.Width, 25)
00089         apply_button.SetConstraints(lc)
00090 
00091         lc = wx.LayoutConstraints()
00092         lc.bottom.SameAs(self, wx.Bottom, 10)
00093         lc.left.RightOf(apply_button, 5)
00094         lc.height.AsIs()
00095         lc.width.PercentOf(self, wx.Width, 25)
00096         clear_button.SetConstraints(lc)
00097 
00098         lc = wx.LayoutConstraints()
00099         lc.bottom.SameAs(self, wx.Bottom, 10)
00100         lc.left.RightOf(clear_button, 5)
00101         lc.height.AsIs()
00102         lc.width.PercentOf(self, wx.Width, 25)
00103         close_button.SetConstraints(lc)
00104 
00105         src_static = wx.StaticText(self, -1, 'Original Sequence',
00106                                    style=wx.ALIGN_CENTER)
00107         lc = wx.LayoutConstraints()
00108         lc.top.SameAs(self, wx.Top, 5)
00109         lc.left.SameAs(self, wx.Left, 5)
00110         lc.height.AsIs()
00111         lc.right.SameAs(self, wx.Right, 5)
00112         src_static.SetConstraints(lc)
00113 
00114         src_text = wx.TextCtrl(self, -1, '', style=wx.TE_MULTILINE)
00115         lc = wx.LayoutConstraints()
00116         lc.top.Below(src_static, 5)
00117         lc.left.SameAs(self, wx.Left, 5)
00118         lc.height.PercentOf(self, wx.Height, 30)
00119         lc.right.SameAs(self, wx.Right, 5)
00120         src_text.SetConstraints(lc)
00121         self.src_text = src_text
00122 
00123         dest_static = wx.StaticText(self, -1, 'Transformed Sequence',
00124                                     style=wx.ALIGN_CENTER)
00125         lc = wx.LayoutConstraints()
00126         lc.top.Below(src_text, 5)
00127         lc.left.SameAs(self, wx.Left, 5)
00128         lc.height.AsIs()
00129         lc.right.SameAs(self, wx.Right, 5)
00130         dest_static.SetConstraints(lc)
00131 
00132         dest_text = wx.TextCtrl(self, -1, '', style=wx.TE_MULTILINE)
00133         lc = wx.LayoutConstraints()
00134         lc.top.Below(dest_static, 5)
00135         lc.left.SameAs(self, wx.Left, 5)
00136         lc.height.PercentOf(self, wx.Height, 30)
00137         lc.right.SameAs(self, wx.Right, 5)
00138         dest_text.SetConstraints(lc)
00139         self.dest_text = dest_text


Member Function Documentation

Definition at line 177 of file SeqGui.py.

00177 
00178     def back_transcribe(self):
00179         seq = "".join(self.src_text.GetValue().split()) #remove whitespace
00180         print seq
00181         self.dest_text.Clear()
00182         self.dest_text.SetValue(back_transcribe(seq))
00183 

Here is the caller graph for this function:

def SeqGui.SeqPanel.OnApply (   self,
  event 
)

Definition at line 144 of file SeqGui.py.

00144 
00145     def OnApply(self, event):
00146         codon_table_lb = self.parent.params_panel.codon_table_lb
00147         selection = codon_table_lb.GetStringSelection()
00148         print selection
00149         codon_table = selection[:]
00150         transform_lb = self.parent.params_panel.transform_lb
00151         selection = transform_lb.GetStringSelection()
00152         transform = selection[:]
00153         print transform
00154         if(transform == 'Translate'):
00155             self.translate(codon_table)
00156         elif(transform == 'Transcribe'):
00157             self.transcribe()
00158         elif(transform == 'Back transcribe'):
00159             self.back_transcribe()

Here is the call graph for this function:

def SeqGui.SeqPanel.OnClear (   self,
  event 
)

Definition at line 160 of file SeqGui.py.

00160 
00161     def OnClear(self, event):
00162         self.src_text.Clear()
00163         self.dest_text.Clear()

def SeqGui.SeqPanel.OnClose (   self,
  event 
)

Definition at line 140 of file SeqGui.py.

00140 
00141     def OnClose(self, event):
00142         parent = self.GetParent()
00143         parent.Destroy()

Definition at line 171 of file SeqGui.py.

00171 
00172     def transcribe(self):
00173         seq = "".join(self.src_text.GetValue().split()) #remove whitespace
00174         print seq
00175         self.dest_text.Clear()
00176         self.dest_text.SetValue(transcribe(seq))
                                

Here is the caller graph for this function:

def SeqGui.SeqPanel.translate (   self,
  codon_table 
)

Definition at line 164 of file SeqGui.py.

00164 
00165     def translate(self, codon_table):
00166         seq = "".join(self.src_text.GetValue().split()) #remove whitespace
00167         print seq
00168         self.dest_text.Clear()
00169         self.dest_text.SetValue(translate(seq, table=codon_table,
00170                                           to_stop=True))
        

Here is the caller graph for this function:


Member Data Documentation

Definition at line 138 of file SeqGui.py.

Definition at line 74 of file SeqGui.py.

Definition at line 120 of file SeqGui.py.


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