5
$\begingroup$

ChemicalData["AminoAcids"] returns the 20 amino acids. There are some properties available, like the molar mass:

ChemicalData["L-Alanine", "MolarMass"]

Is there a way to refer to amino-acids using their single-letter abbreviation? For example, L-Alanine is A. I know that

ChemicalData["A", "MolarMass"]

is too ambiguous. I also tried

ChemicalData[{"AminoAcids", A"}, "MolarMass"]

but it doesn't work.

The problem is that I have a protein sequence in single-letter form and I want to calculate its molar mass. I could build a dictionary by hand to translate from single-letter to full amino-acid name. But I'm wondering if it is implemented already.

$\endgroup$
  • 1
    $\begingroup$ Of course, to get the true molecular weight of a peptide with your proposal, you will have to subtract an appropriate multiple of 18 (that is, water's molecular weight) from the result of adding up the molecular weights of the component amino acids. $\endgroup$ – J. M. will be back soon Apr 20 '16 at 11:17
9
$\begingroup$

Well, I guess the only way is to build up a rule to do the conversion for you. I've done just that, so here it is:

abb = {"A" -> "L-Alanine", "R" -> "L-Arginine", "N" -> "LAsparagine", 
       "D" -> "LAsparticAcid", "C" -> "LCysteine", "E" -> "L-GlutamicAcid",
       "Q" -> "L-Glutamine", "G" -> "Glycine", "H" -> "L-Histidine", 
       "I" -> "L-Isoleucine", "L" -> "L-Leucine", "K" -> "Lysine", 
       "M" -> "L-Methionine", "F" -> "L-Phenylalanine", "P" -> "L-Proline",
       "S" -> "L-Serine", "T" -> "L-Threonine", "W" -> "L-Tryptophan", 
       "Y" -> "L-Tyrosine", "V" -> "L-Valine", "U" -> "Selenocysteine", 
       "O" -> "LPyrrolysine" }

Now let's use it:

Map[ChemicalData[#, "MolarMass"] &, {"Y", "A", "R", "F"} /. abb]

(* {181.189g/mol, 89.0932g/mol, 174.201g/mol, 165.189g/mol} *)
$\endgroup$
  • $\begingroup$ Thanks! I was about to do that. Just wanted to be sure it wasn't already implemented in Mathematica's data. $\endgroup$ – becko Apr 19 '16 at 22:11
  • $\begingroup$ @becko. Well, I'm glad I saved you the trouble. :) $\endgroup$ – RunnyKine Apr 20 '16 at 2:44
  • $\begingroup$ If need be, one can also add entries for selenocysteine and pyrrolysine. $\endgroup$ – J. M. will be back soon Apr 20 '16 at 6:16
  • $\begingroup$ @J.M. I just added them. Thanks. $\endgroup$ – RunnyKine Apr 20 '16 at 6:31
4
$\begingroup$

Not an answer (community wiki)

Thanks to J.M. for a correction to the 3-letter abbreviations.

aaList = {"LAlanine", "LCysteine", "LAsparticAcid", "LGlutamicAcid","LPhenylalanine", "Glycine", "LHistidine", "LIsoleucine", "LLysine", "LLeucine", "LMethionine", "LAsparagine","LPyrrolysine", "LProline", "LGlutamine", "LArginine", "LSerine", "LThreonine", "Selenocysteine", "LValine", "LTryptophan","LTyrosine"};

Standard Amino Acids (22) incorporated on ribosome

stdAA = ChemicalData[#, "StandardName"] & /@ aaList;

and

nameAA = ChemicalData[#, "Name"] & /@ aaList;

Accepted Amino Acid 1-Letter and 3-Letter Abbreviations

oneLetterAA = Delete[CharacterRange["A", "Z"], {{2}, {10}, {24}, {26}}];
threeLetterAA = ReplacePart[StringTake[#, 3] & /@ (StringTrim[#, "L"] & /@ stdAA) /. {"Pyr" -> 
 "Pyl", "Sel" -> "Sec", "Iso" -> "Ile", "Try" -> "Trp"}, {12 -> 
"Asn", 15 -> "Gln"}]

1-Letter to Standard

oneToStdAA = Thread[oneLetterAA -> stdAA]

{A->LAlanine,C->LCysteine,D->LAsparticAcid,E->LGlutamicAcid,F->LPhenylalanine,

G->Glycine,H->LHistidine,I->LIsoleucine,K->LLysine,L->LLeucine,

M->LMethionine,N->LAsparagine,O->LPyrrolysine,P->LProline,Q->LGlutamine,R->LArginine,

S->LSerine,T->LThreonine,U->Selenocysteine,V->LValine,W->LTryptophan,

Y->LTyrosine}

3-Letter to Standard

threeToStdAA = Thread[threeLetterAA -> stdAA]

{Ala->LAlanine,Cys->LCysteine,Asp->LAsparticAcid,Glu->LGlutamicAcid,

Phe->LPhenylalanine,Gly->Glycine,His->LHistidine,Ile->LIsoleucine,

Lys->LLysine,Leu->LLeucine,Met->LMethionine,Asn->LAsparagine,

Pyl->LPyrrolysine,Pro->LProline,Gln->LGlutamine,Arg->LArginine,Ser->LSerine,

Thr->LThreonine,Sec->Selenocysteine,Val->LValine,Trp->LTryptophan,

Tyr->LTyrosine}

Example One

Transpose[{oneLetterAA, threeLetterAA, stdAA, nameAA, 
 Map[ChemicalData[#, "MolarMass"] &, oneLetterAA /. oneToStdAA]}] //
 TableForm

enter image description here

Example Two. The molecular weight of bovine serum albumin (bsa)

aaToMMass = Thread[oneLetterAA -> Map[ChemicalData[#, "MolarMass"] &, oneLetterAA /. oneToStdAA]];

Import Sequence

importedSequence = Import["http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=
protein&id=3336842&rettype=fasta&retmode=text", "Data"]; 

{bsaSequenceHeading, bsaSequenceData} = {First@#, Rest@#} &@importedSequence;

bsaSequenceHeading

>gi|3336842|emb|CAA76847.1| bovine serum albumin [Bos taurus]

Sequence molar mass of bovine serum albumin

bsaMolarMass = Total[# /. aaToMMass]  - (Length@# - 1) ChemicalData["Water", "MolarMass"] &@
Flatten@Characters@StringReplace[bsaSequenceData, Whitespace -> ""]

69323.  g/mol

69332.0 g/mol

Thanks to J.M. for suggesting ChemicalData["Water", "MolarMass"]. I had originally just multiplied by 18.

If "MolecularMass" is preferred to "MolarMass" (see here)

aaMolecularMass = Thread[ChemicalData["AminoAcids", "StandardName"] ->  
ChemicalData["AminoAcids", "MolecularMass"]];

bsaMolecularMass = Total[# /. aaMolecularMass]  - (Length@# - 1) ChemicalData["Water", 
  "MolecularMass"] &@(Flatten@
 Characters@StringReplace[bsaSequenceData, Whitespace -> ""] /. 
oneToStdAA)

69323. u

As pointed out by J.M., an advantage of using "MolecularMass" is that the result may converted to kilodaltons

UnitConvert[%, "Kilodaltons"]

69.323 kDa

Example Three

Putting it all together:

importedSequence2 = Import["http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=
protein&id=AAS66653&rettype=fasta&retmode=text", "Data"];

Flatten@{{UnitConvert[#, "Kilodaltons"] &@(Total[# /. aaMolecularMass] 
- (Length@# - 1) ChemicalData["Water","MolecularMass"]), Quantity[Length@# , 
IndependentUnit["amino acids"]]} &@(Flatten@Characters@StringReplace[#, Whitespace -> ""] /. 
oneToStdAA) &@Rest@# , First@#} &@importedSequence2

51.2581kDa, 472 amino acids,

>gi|45479207|gb|AAS66653.1| variable surface glycoprotein [Trypanosoma evansi]

$\endgroup$
  • $\begingroup$ Asparagine and glutamine should be "Asn" and "Gln", respectively; otherwise, nicely done. :) $\endgroup$ – J. M. will be back soon Apr 20 '16 at 13:15
  • 2
    $\begingroup$ I was going to suggest a further unit change to kilodaltons to match tradition with proteins of that size, but it seems Mathematica treats "Kilodaltons" as a unit of mass as opposed to molecular weight. How annoying... anyway, for readability, using (Length[#] - 1) ChemicalData["Water", "MolarMass"] to remove the equivalent amount of water might be better. $\endgroup$ – J. M. will be back soon Apr 20 '16 at 23:12
  • $\begingroup$ @ J.M. That is a nice suggestion. Have updated accordingly. Once again, thanks! $\endgroup$ – user1066 Apr 21 '16 at 11:09
  • 1
    $\begingroup$ Ah, so "MolecularMass" is the one that can be converted to kilodaltons! Now it is clear... $\endgroup$ – J. M. will be back soon Apr 21 '16 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.