Nucweight

Cette macro a été publiée dans

Useful Microsoft Word Macros for MolecularBiologists and Protein Chemists

Cette macro calcule le poids des séquences DNA. Pour les séquences RNA, il faut modifier les lignes 9,11,13,15 en suivant les informations données à la ligne 4.

Sub Nucweight()
'Nucweight Macro
'Macro recorded 07/02/99 by Gerry Shaw
'This version for DNA sequences: for RNA MW for A =329.2, U = 306.1, G = 345.2, C= 305.2 '
X = Len(Selection.Text)
For Y = 1 To X
Select Case Mid$(Selection.Text, Y, 1)
    Case "A"
    MW = MW + 313.2
    Case "T"
    MW = MW + 304.2
    Case "G"
    MW = MW + 329.2
    Case "C"
    MW = MW + 289.2
    Case Else
    Z = Z + 1
 
End Select
Next
MW = MW + 18
If (MW > 18) Then
MsgBox ("Selection includes " & X - Z & " bases, Molecular Weight= " & MW & " Daltons")
End If
 
If (MW = 18) Then
 MsgBox ("No sequence selected")
End If
 
End Sub

Il faudra demander à un biologiste de vérifier les lignes 21 à 28 pour le cas RNA.

Sub NucweightForRNA()
'Nucweight Macro
'Macro recorded 07/02/99 by Gerry Shaw
'This version for DNA sequences: for RNA MW for A =329.2, U = 306.1, G = 345.2, C= 305.2 '
X = Len(Selection.Text)
For Y = 1 To X
Select Case Mid$(Selection.Text, Y, 1)
    Case "A"
    MW = MW + 329.2
    Case "U"
    MW = MW + 306.1
    Case "G"
    MW = MW + 345.2
    Case "C"
    MW = MW + 305.2
    Case Else
    Z = Z + 1
 
End Select
Next
MW = MW + 18
If (MW > 18) Then
MsgBox ("Selection includes " & X - Z & " bases, Molecular Weight= " & MW & " Daltons")
End If
 
If (MW = 18) Then
 MsgBox ("No sequence selected")
End If
 
End Sub