お知らせ

電子会議

ライブラリ

パレット

Delphi FAQ検索

Delphi FAQ一覧

サンプル蔵





FDelphi FAQ
16番会議室「玉石混淆みんなで作るSample蔵」に寄せられたサンプル

"コドンのアミノ酸翻訳関数"

この発言に対し以下のコメントが寄せられています
#00933 ひの さん RE:コドンのアミノ酸翻訳関数

function TranslateCodonToAA(S:String;AAMode:Boolean):String; 説明 ユニバーサルコドンをアミノ酸記号に翻訳する関数です。 引数のSの中身は大文字でも小文字でもかまいません。 また、T(t)とU(u)はどちらでもかまいません。 引数のAAModeがTrueのときは3文字標記のアミノ酸記号が返され、 Falseのときは1文字標記のアミノ酸記号が返されます。 function TranslateCodonToAA(S:String;AAMode:Boolean):String; begin if Length(S) <> 3 then raise Exception.Create('トリプレットではありません'); S:=LowerCase(S); while Pos('t',S) > 0 do S[Pos('t',S)]:='u'; Result:= 'X'; if AAMode then Result:= ' X '; if (S = 'uuu') or (S = 'uuc') then if AAMode then Result:= 'Phe' else Result:= 'F'; if (S = 'uua') or (S = 'uug') then if AAMode then Result:= 'Leu' else Result:= 'L'; if (S = 'ucu') or (S = 'ucc') or (S = 'uca') or (S = 'ucg') then if AAMode then Result:= 'Ser' else Result:= 'S'; if (S = 'uau') or (S = 'uac') then if AAMode then Result:= 'Tyr' else Result:= 'Y'; if (S = 'uaa') or (S = 'uag') then if AAMode then Result:= ' * ' else Result:= '*'; if (S = 'ugu') or (S = 'ugc') then if AAMode then Result:= 'Cys' else Result:= 'C'; if (S = 'uga') then if AAMode then Result:= ' * ' else Result:= '*'; if (S = 'ugg') then if AAMode then Result:= 'Trp' else Result:= 'W'; if (S = 'cuu') or (S = 'cuc') or (S = 'cua') or (S = 'cug') then if AAMode then Result:= 'Leu' else Result:= 'L'; if (S = 'ccu') or (S = 'ccc') or (S = 'cca') or (S = 'ccg') then if AAMode then Result:= 'Pro' else Result:= 'P'; if (S = 'cau') or (S = 'cac') then if AAMode then Result:= 'His' else Result:= 'H'; if (S = 'caa') or (S = 'cag') then if AAMode then Result:= 'Gln' else Result:= 'Q'; if (S = 'cgu') or (S = 'cgc') or (S = 'cga') or (S = 'cgg') then if AAMode then Result:= 'Arg' else Result:= 'R'; if (S = 'auu') or (S = 'auc') or (S = 'aua') then if AAMode then Result:= 'Ile' else Result:= 'I'; if (S = 'aug') then if AAMode then Result:= 'Met' else Result:= 'M'; if (S = 'acu') or (S = 'acc') or (S = 'aca') or (S = 'acg') then if AAMode then Result:= 'Thr' else Result:= 'T'; if (S = 'aau') or (S = 'aac') then if AAMode then Result:= 'Asn' else Result:= 'N'; if (S = 'aaa') or (S = 'aag') then if AAMode then Result:= 'Lys' else Result:= 'K'; if (S = 'agu') or (S = 'agc') then if AAMode then Result:= 'Ser' else Result:= 'S'; if (S = 'aga') or (S = 'agg') then if AAMode then Result:= 'Arg' else Result:= 'R'; if (S = 'guu') or (S = 'guc') or (S = 'gua') or (S = 'gug') then if AAMode then Result:= 'Val' else Result:= 'V'; if (S = 'gcu') or (S = 'gcc') or (S = 'gca') or (S = 'gcg') then if AAMode then Result:= 'Ala' else Result:= 'A'; if (S = 'gau') or (S = 'gac') then if AAMode then Result:= 'Asp' else Result:= 'D'; if (S = 'gaa') or (S = 'gag') then if AAMode then Result:= 'Glu' else Result:= 'E'; if (S = 'ggu') or (S = 'ggc') or (S = 'gga') or (S = 'ggg') then if AAMode then Result:= 'Gly' else Result:= 'G'; end; by 六角 Original document by 六角三房 氏 ID:(CXE02604)



ここにあるドキュメントは NIFTY SERVEの Delphi Users' Forum の16番会議室「玉石混淆みんなで作るSample蔵」に投稿されたサンプルです。これらのサンプルはボーランド株式会社がサポートする公式のものではありません。また、必ずしも動作が検証されているものではありません。これらのサンプルを使用したことに起因するいかなる損害も投稿者、およびフォーラムスタッフはその責めを負いません。使用者のリスクの範疇でご使用下さい。

Copyright 1996-2002 Delphi Users' Forum