Home > Class & module > 3.Collection > mRNApredict

mRNApredict

 

This class is used to predict mRNA secondary structure.

 


o Summary

 

o Prediction

 Module

 Description

 Function Calculate (SourceStr As String,  IsFastCalculation As Boolean) As String

 Calculate mRNA structure

 It return "" if no error occurs

 It is the first function to predict mRNA structure

 

 

o Visualization

 Module

 Description

 Sub ShowStructure ()

 Show mRNA structure image to 'mRNA structure viewer' window

 

 

o Hairpin structure

 Module

 Description

 Function Generate_Hairpin (Target_SequenceLength_Min As Integer, Target_SequenceLength_Max As Integer, UnPaired_SequenceLength As Integer, Target_Energy_Min As Single, Target_Energy_Max As Single, Max_Trials As Integer) As String

 Generate mRNA hairpin sequence that has specific Gibbs free energy and size.

 It return null string ("") if failed

 

 UnPaired_SequenceLength: number of basepair in the center

 Target_Energy_Min: optional parameter, default value is -500

 Target_Energy_Max: optional parameter, default value is 500

 Max_Trials: optional parameter, it specifies maximum number of trials to generate hairpin structure, default value is 30

 

 

 

o Information

 Module

 Description

 Sub ReadStructure ()

 Read mRNA structure to access basepair information

 It is the first function to call to retrieve information

(Alternative is ShowStructure)

 Property BasePair (Position As Integer) As String

 Get basepair of current sequence at 'Position'

 Function Calculate (SourceStr As String,  IsFastCalculation As Boolean) As String

 Calculate mRNA structure

 Return "" if no error occurs

 Property Coordinate_X (Position As Integer) As Single

 Get x coordinate of target basepair ('Position') from predicted mRNA structure

 Property Coordinate_Y (Position As Integer) As Single

 Get y coordinate of target basepair ('Position') from predicted mRNA structure

 Property DotStructure () As String

 Get dot expression of predicted mRNA secondary structure

 Calling ShowStructure or ReadStructure is not required

 Property Energy (Position As Integer) As Single

 Get binding energy of target basepair ('Position') of predicted mRNA secondary structure

 Function Get_AvgEnergy (Start_Position As Integer, End_Position As Integer) As Single

 Get average Gibbs free energy. Start_Position and End_Position are optional

 Returns 1 if error occurs

 Function Get_SumEnergy (Start_Position As Integer, End_Position As Integer) As Single

 Get total Gibbs free energy. Start_Position and End_Position are optional

 Returns 1 if error occurs

 Function Get_AvgProbability (Start_Position As Integer, End_Position As Integer) As Single

 Get average probability. Start_Position and End_Position are optional

 Returns -1 if error occurs

 Function Get_SumProbability (Start_Position As Integer, End_Position As Integer) As Single

 Get sum of probability. Start_Position and End_Position are optional

 Returns -1 if error occurs

 Property GibbsFreeEnergy () As Single

 Get overall Gibbs free energy of predicted mRNA secondary structure

 Calling ShowStructure or ReadStructure is not required

 Property Probability (Position As Integer) As Single

 Get probability of target basepair ('Position') of predicted mRNA secondary structure

 Property SequenceLength () As Integer

 Get length of source DNA sequence

 Calling ShowStructure or ReadStructure is not required

 Property OrgDNASequence (SourceSeq As String) As String

 Set source DNA sequence

 Calling ShowStructure or ReadStructure is not required

 

  

 


o Example 1

The following VBscript code calculates mRNA secondary structure and then plot it.

Function Main()

     Call  mRNApredict.Calculate("GCGGGCGGCGGCTATTGGCACACGAGCGCA",False)

     Call mRNApredict.ShowStructure

End Function

 

o Example 2

Calculate mRNA secondary structure and then export to clipboard

Function Main()

   SourceGene="GCGGGCGGCGGCTATTGGCACACGAGCGGCCGGGAGATCCTGGACGCG"

   Call mRNApredict.Calculate(SourceGene,False)

   Call mRNApredict.ShowStructure()

   GeneLength=mRNApredict.SequenceLength

 

    Temp="Basepair" & Chr(9) & "Energy" & Chr(9) & "Probability" & Chr(13) & Chr(10)

    For q=1 to GeneLength

         Temp=Temp+mRNApredict.BasePair(q) & Chr(9)

         Temp=Temp+CStr(mRNApredict.Energy(q)) & Chr(9)

         Temp=Temp+CStr(mRNApredict.Probability(q)) & Chr(13) & Chr(10)

    Next

    

    AppService.Clipboard_Copy(Temp)

End Function

 

o Example 3

Draw mRNA Gibbs free energy profile along source sequence

Function Main()

      '-------- Setting  ---------------------------------------------------------------------------------------------------------------------

      Window_Size=30      'Length of partial test sequence

      Step_Size=9             'Interval between partial test sequences through entire sequence

     '------------------------------------------------------------------------------------------------------------------------------------------

 

      SourceSeq=AppService.Workspace_Value

      If SourceSeq="" then

              Exit Function

      End If

      SourceSeq_Length=Len(SourceSeq)

      Start_Position=1

      End_Position=SourceSeq_Length

 

      Buf_Str=""  

 

 

     '**** Graphics **********************

     CustomUI.Define_Canvas 500,200

     CustomUI.Form_BringToFront

     CustomUI.Clear_Canvas

     CustomUI.Form_Caption="mRNA binding energy profile"

     CustomUI.DrawLine 30,95,490,95,"LightGray"

     CustomUI.DrawLine 30,10,30,180,"Black"

     CustomUI.DrawLine 30,180,490,180,"Black"

     CustomUI.DrawString 330,160,"G: Gibbs energy (kcal/mol/nt)","Blue"

     CustomUI.DrawString 15,85,"G","Blue"

     CustomUI.DrawString 250,180,"Location","Red"

     CustomUI.DrawString 15,10,"0","Blue"

     CustomUI.DrawString 1,170,"-0.5","Blue"

     CustomUI.Set_ForeColor_byName "Black"

 

 

      '*** Calculate mRNA Gibbs free energy ************************************************

      For Current_Position=Start_Position to End_Position - Window_Size step Step_Size

 

                AppService.InstantMsg "Calculating mRNA structure at " + CStr(Current_Position)

 

                TestSeq=Mid(SourceSeq,Current_Position,Window_Size)

                TestSeq_Length=Len(TestSeq)

                Call mRNApredict.Calculate(TestSeq,True)

 

                GibbsEnergy=mRNApredict.GibbsFreeEnergy()

 

                X2=(Current_Position-Start_Position )/SourceSeq_Length*480+30

                Y2=(-GibbsEnergy/TestSeq_Length)*170/0.5+10

                If Current_Position>Start_Position Then         

                     CustomUI.DrawLine X1,Y1,X2,Y2

                     CustomUI.DrawRectangle X2-1,Y2-1,2,2

                     CustomUI.Update_Canvas

                End If     

                X1=X2

                Y1=Y2

 

                Buf_Str=Buf_Str + CStr(Current_Position) + Chr(9) + CStr(GibbsEnergy/TestSeq_Length) + Chr(13) + Chr(10)       

 

     Next

 

     CustomUI.RawData=Buf_Str

     CustomUI.Make_Clone

 

End Function