最終更新日:2016.7.14.

WABI MAFFT の使用方法

MAFFT の jobの投入
MAFFT の結果の取得
サンプルスクリプト
例1:複数配列の multiple alignment
例2:2つの整列済みデータの統合(Group-to-group alignment)
例3:整列済みデータに新規配列を追加

MAFFT の job の投入

以下のパラメーターを POST します。
format, result は必須です。
result に mail を指定した場合は address も必須となります。

パラメーター 説明
format request ID を返す際の応答データの形式。
text, json, xml, bigfile, imagefile, requestfile が受け付けられますが、job投入時に意味があるのは text, json, xml の3つです。
querySequence multiple alignment 実行時に mafft に渡す配列 fasta ファイル。
profile1 Group-to-group alignment 実行時に mafft に --seed で渡す1つめの整列済み配列ファイル。
profile2 Group-to-group alignment 実行時に mafft に --seed で渡す2つめの整列済み配列ファイル。
aaMatrix multiple alignment 実行時に mafft に --aamatrix で渡すアミノ酸のカスタム weight matrix ファイル。
addSequence multiple alignment実行時にmafftに--addで渡す配列fastaファイル。
addfragmentsSequence multiple alignment実行時にmafftに--addfragmentsで渡す配列fastaファイル。
addprofileProfile multiple alignment実行時にmafftに--addprofileで渡す配列fastaファイル。
addfullSequence multiple alignment実行時にmafftに--addfullで渡す配列fastaファイル。
parameters mafft実行時のコマンドラインオプションのうち、--seed, --aamatrix, --add, --addfragments, --addprofile, --addfull 以外のものを記述する。
result 結果通知方法。www, mail のいずれか。
mail の場合、job 完了時に address に記述したメールアドレスに対して検索終了の通知が送信されます。
www の場合は何もしないので、POST 時に返された request ID を使って GET で job の状態を調べます。
address result で mail を指定した場合に検索終了の通知を受け取るメールアドレス。

MAFFT の結果の取得

パラメータ 説明
GET mafft/{id}?info=status job が走っている、キューにたまっている、終わっている、存在しない、ということを返します。
GET mafft/{id}?info=request プログラム実行条件を返します。
存在しない場合は、エラーを返します。
GET mafft/{id}?info=result job が終わっていたら結果(multiple alignment, Group-to-group alignmentの結果)を返します。
終わってない・存在しない場合は、エラーを返します。

サンプルスクリプト

mafft-client.pl


#!/usr/bin/perl
 
# usage: perl wabi-client conf.json
 
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON qw/encode_json decode_json/;
 
&main;
 
sub main {
    my $json_file = $ARGV[0];
 
    # JSONファイルから値を取り出す。
    my $json_data = &read_json_file($json_file);
 
    # 入力ファイルを読む。
    my $post_data = &read_data($json_data);
 
    # 取り出した値をPOSTする。
    my $request_id = &post_data($$json_data{'url'}, $post_data);
 
    # 処理が終了するまで待つ。
    &check_status($$json_data{'url'}, $request_id);
 
    # mafftの出力結果を取得する。
    &get_result($$json_data{'url'}, $request_id);
}
 
sub read_json_file {
    my $json_file = $_[0];
 
    open IN, $json_file or die;
    my $json_in = '';
    while (<IN>) {
        chomp;
        $json_in .= $_;
    }
    close IN;
    my $data_ref = decode_json($json_in);
    return $data_ref;
}
 
sub read_data {
    my $json_data = $_[0];
 
    my %post_data = (
        'querySequence' => '',
        'profile1' => '',
        'profile2' => '',
        'aaMatrix' => '',
        'addSequence' => '',
        'addfragmentsSequence' => '',
        'addprofileProfile' => '',
        'addfullSequence' => '',
        'format' => 'text',
        'parameters' => $$json_data{'parameters'},
        'result' => $$json_data{'result'},
        'address' => $$json_data{'address'},
    );
 
    my @params = (
        'querySequence',
        'profile1',
        'profile2',
        'aaMatrix',
        'addSequence',
        'addfragmentsSequence',
        'addprofileProfile',
        'addfullSequence'
    );
 
    foreach my $param (@params) {
        if (exists $$json_data{$param}) {
            $post_data{$param} = &open_read($$json_data{$param});
        }
    }
 
    return \%post_data;
}
 
sub post_data {
    my $url = $_[0];
    my $post_data_ref = $_[1];
 
    my $request = POST($url, $post_data_ref);
    my $ua = LWP::UserAgent -> new;
    my $res = $ua -> request( $request );
 
    my $request_id = '';
    if ($res->is_success) {
        my $content = $res->content;
        if ($content =~ /requestId: (.*)/) {
            $request_id = $1;
        }
    } else {
        my $content = $res->content;
        print "$content\n";
        die $res->status_line;
    }
    print "request-ID: $request_id\n";
    return $request_id;
}
 
sub check_status {
    my $url = $_[0];
    my $request_id = $_[1];
 
    my $status = '';
    while (1) {
        my $request = GET($url . $request_id);
        my $ua = LWP::UserAgent -> new;
        my $res = $ua -> request( $request );
        if ($res->is_success) {
            my $content = $res->content;
            if ($content =~/status: (.*)/) {
                $status = $1;
            }
        } else {
            die $res->status_line;
        }
        print "$status\n";
        if ($status eq 'waiting') {
            sleep(10);
        } elsif ($status eq 'running') {
            sleep(10);
        } elsif ($status eq 'finished') {
            last;
        }
    }
}
 
sub get_result {
    my $url = $_[0];
    my $request_id = $_[1];
 
    my $request = GET($url . $request_id . '?info=result');
    my $ua = LWP::UserAgent -> new;
    my $res = $ua -> request( $request );
    if ($res->is_success) {
        open OUT, ">${request_id}.txt" or die;
        print OUT $res->content;
        close OUT;
        print "mafft result is outputed to ${request_id}.txt\n";
    } else {
        die $res->status_line;
    }
}
 
sub open_read {
    my $file = $_[0];
    my $content = '';
    open FILE, $file or die;
    while (<FILE>) {
        $content .= $_;
    }
    close FILE;
    return $content;
}

例1:複数配列の multiple alignment

conf.json

{
  "url": "http://ddbj.nig.ac.jp/wabi/mafft/",
  "querySequence": "/home/hoge/cyc_aa.fasta",
  "parameters": "--globalpair --maxiterate 1000",
  "result": "www",
  "address": ""
}

cyc_aa.fasta

>mms:mma_0447
MYRFTKTVVALLLATSGTMALAQAAYTNIGRPATAKEIAAWDIDVRPDFKGLPPGSGTVA
KGMAVWEGKCASCHGTFGESNEVFTPIVGGTTKEDIKSGHVAALSNNKQPQRTTIMKVPT
VSTLWDYINRAMPWTAPKSLTTEEVYAVTAYILNMAEILPDDFTLSDKNIAEVQQLMPNR
NGMTRNHGMWDIKGKPDVKSVACMKDCKTSTDLRSTLPEPSRNAHGNIQLQNRTFGEVRG
VDTTKPASTKPISAISADQKLAMATPAKPAAPAKVDGLALAKQYACVACHGVSNKIIGPG
FNEIAAKYKGDAAAPAALTAKIKNGSTGAWGPIPMPAQAHVKDEDIKTLVGWIIGGAK
>har:HEAR1189
MSRFTKTVVALALVATGAIACAQTAYPHIGRTATEKEIAAWDIDVRPDFKGLPKGSGTVS
KGMEVWEGK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SFENFKGVGRQATPAEVKAWDIDVRPDFKGLPKGKGNVE
RGNELFEEKCASCHGSFGESNEVFTPLAGGTTKDDIKTGRVKGLSSGELPQRTTFTKVAT
ISTVFDYIQRAMPWTAPKSLKPDDVYAILAYLLNLQEIVPADFELSDRNIADVQKLLPNR
NGMTTDHGLWPGASAKKGGIGNGGIPDVKNVACMKNCKPEVQIGSTLPEYARTAHGELAD
QNRNFGAVRGTRTLGPEAAKKAADAGTLELATKSGCMACHGMKSKIVGPGYSEVVARYQG
QPDAESRLIAKVKAGGQGVWGSIPMPPNAHVKDEDLKTLVQWILAGSK

multi fasta データから global pairwise alignment で multiple alignment を行う場合のサンプル

実行されるコマンド

$ mafft --globalpair --maxiterate 1000 /home/hoge/cyc_aa.fasta > outfile

実行の様子

$ perl mafft-client.pl conf.json
Execute multiple sequence alignment.
request-ID: wabi_mafft_2013-1015-1123-50-232-114016
waiting
finished
mafft result is outputed to wabi_mafft_2013-1015-1123-50-232-114016.txt
$ cat wabi_mafft_2013-1015-1123-50-232-114016.txt 
>mms:mma_0447
MYRFTKTVVALLLAT----SGTMALAQ---AAYTNIGRPATAKEIAAWDIDVRPDFKGLP
PGSGTVAKGMAVWEGKCASCHGTFGESNEVFTPIVGGTTKEDIKSGHVAALSNNKQPQRT
TIMKVPTVSTLWDYINRAMPWTAPKSLTTEEVYAVTAYILNMAEILPDDFTLSDKNIAEV
QQLMPNRNGMTRNHGMW----------DIKGKPDVKSVACMKDCKTSTDLRSTLPEPSRN
AHGNIQLQNRTFGEVRGVDTTKPASTKPISAISADQKLAMATPAKPA-APAKVDGLALAK
QYACVACHGVSNKIIGPGFNEIAAKYKGDAAAPAALTAKIKNGSTGAWGPIPMPAQAHVK
DEDIKTLVGWIIGGAK
>har:HEAR1189
MSRFTKTVVALALVA----TGAIACAQ---TAYPHIGRTATEKEIAAWDIDVRPDFKGLP
KGSGTVSKGMEVWEGKCASCHGTFGESNEVFTPIVGGTTKEDVKTGRVAALATNKQPQRT
TMMKVAT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LP
KGKGNVERGNELFEEKCASCHGSFGESNEVFTPLAGGTTKDDIKTGRVKGLSSGELPQRT
TFTKVATISTVFDYIQRAMPWTAPKSLKPDDVYAILAYLLNLQEIVPADFELSDRNIADV
QKLLPNRNGMTTDHGLWPGASAKKGGIGNGGIPDVKNVACMKNCKPEVQIGSTLPEYART
AHGELADQNRNFGAVRGTRTLGPEA---------------------AKKAADAGTLELAT
KSGCMACHGMKSKIVGPGYSEVVARYQGQPDAESRLIAKVKAGGQGVWGSIPMPPNAHVK
DEDLKTLVQWILAGSK

例2:2つの整列済みデータの統合(Group-to-group alignment)

conf.json

{
  "url": "http://ddbj.nig.ac.jp/wabi/mafft/",
  "profile1": "/home/hoge/wabi_mafft_2013-1015-1123-50-232-114016.txt",
  "profile2": "/home/hoge/wabi_mafft_2013-1015-1136-16-420-058820.txt",
  "parameters": "--maxiterate 1000 --clustalout",
  "result": "www",
  "address": ""
}

例1の結果と、もうひとつ別の multiple alignment の結果の2つを統合する場合のサンプル。

この例では出力ファイル形式を CLUSTAL 形式に指定。
実行されるコマンド

$ mafft --maxiterate 1000 --clustalout --seed /home/hoge/wabi_mafft_2013-1015-1123-50-232-114016.txt --seed /home/hoge/wabi_mafft_2013-1015-1136-16-420-058820.txt > out.txt

実行の様子

$ perl mafft-client.pl conf2.json
Execute multiple sequence alignment.
request-ID: wabi_mafft_2013-1015-1137-15-648-960788
waiting
finished
mafft result is outputed to wabi_mafft_2013-1015-1137-15-648-960788.txt
$ cat wabi_mafft_2013-1015-1137-15-648-960788.txt 
CLUSTAL format alignment by MAFFT FFT-NS-i (v6.864b)
 
 
_seed_mms:mma_0 MYRFTK--TVVALLLAT----SGTMALAQ---AAYTNIGRPATAKEIAAWDIDVRPDFKG
_seed_har:HEAR1 MSRFTK--TVVALALVA----TGAIACAQ---TAYPHIGRTATEKEIAAWDIDVRPDFKG
_seed_pnu:Pnuc_ MFKLAK--VAKFTLFAVTTFFAVGSVVAQNSSTHYPGIGRDATPAEVAAWDIDVRPDFKG
_seed_bprc:D521 MFKLDK--FSISLGFAALIAITAQAALAQSGSAKFPGIGRAATPAEVAAWDIDVRPDFKG
_seed_dar:Daro_ MSRFSK--TILVLALLG----ASSTGFSF---ENFKGVGRQATPAEVKAWDIDVRPDFKG
_seed_lch:Lcho_ MSSSPKWLAAAVLALAA----AGSLAQVTA-----VGIGRAATEKEIKAWDIDVRPDFKG
_seed_reh:H16_A MSMWAELRTAAALVLAA----VSAAPAWAGTADARAALGRTATPAEVAAWDIDVRPDFQG
                *    :        :                      :** **  *: **********:*
 
_seed_mms:mma_0 LPPGSGTVAKGMAVWEGKCASCHGTFGESNEVFTPIVGGTTKEDIKSGHVAALSNNKQPQ
_seed_har:HEAR1 LPKGSGTVSKGMEVWEGKCASCHGTFGESNEVFTPIVGGTTKEDVKTGRVAALATNKQPQ
_seed_pnu:Pnuc_ LPKGSGSVEKGQQLWEAKCSVCHGTFGESNEIFTPIIGGTTTDDIKTGRVASLSDRKQPQ
_seed_bprc:D521 LPKGSGSVEKGQVIWEAKCASCHGTFGESNEIFTPIAGGTTKDDVKTGRVASLKDMKQPQ
_seed_dar:Daro_ LPKGKGNVERGNELFEEKCASCHGSFGESNEVFTPLAGGTTKDDIKTGRVKGLSSGELPQ
_seed_lch:Lcho_ LPKGSGTVEQGMEVWEAKCAHCHGVFGESNEVFSPLVGGTTADDVKTGHVARLNDPTFPG
_seed_reh:H16_A LPRGSGTVAQGQKVWDGKCASCHGDFGESNEVFTPLVGGTTAEDIRRGRVAGMTGNQ-PY
                ** *.*.* :*  ::: **: *** ******:*:*: **** :*:: *:*  :     * 
 
_seed_mms:mma_0 RTTIMKVPTVSTLWDYINRAMPWTAPKSLTTEEVYAVTAYILNMAEILPDDFTLSDKNIA
_seed_har:HEAR1 RTTMMKVATVSTLWDYINRAMPWTAPKSLTTEEVYAVTAYILNMSEVLPDDFTLSDKNIA
_seed_pnu:Pnuc_ RTTIMKVATVSSLWDYIYRAMPWNAPRSLTPDDTFALVAYLLNMAEVVPDDFVLSNTNIA
_seed_bprc:D521 RTTLMKVPTVSTLWDYIYRAMPWNAPRSLTPDDTYALVAFILSLGEIVPDDFVLSDKNIA
_seed_dar:Daro_ RTTFTKVATISTVFDYIQRAMPWTAPKSLKPDDVYAILAYLLNLQEIVPADFELSDRNIA
_seed_lch:Lcho_ RTTLMKVATVSTLWDYINRAMPWTAPKSLKTDEVYAVTAYLLNMGDVLPAGFVLSDQTIA
_seed_reh:H16_A RTTLMKVSTVSTLWDYIHRAMPWNAPKSLSVGDVYAVTAYMLHLGEVVPADFTLSDANIA
                ***: **.*:*:::*** *****.**:**.  :.:*: *::* : :::* .* **: .**
 
_seed_mms:mma_0 EVQQLMPNRNGMTRNHGMW----------DIKGKPDVKSVACMKDCKTSTDLRSTLPEPS
_seed_har:HEAR1 EVQKLMPNRNGMTQKHGMW----------DVKGKPDVKSVACMKDCQVSGDIRSSLPEPS
_seed_pnu:Pnuc_ EVQKRMPNRNGMTLKHGLW----------NSKGTPDVHATACMTNCVQFVQIGSELPDYA
_seed_bprc:D521 EVK--MPNRNGMTTKHGFW----------SVSGKPDVNGNACMHNCVPFVQIGSTLPDFA
_seed_dar:Daro_ DVQKLLPNRNGMTTDHGLWPGASAKKGGIGNGGIPDVKNVACMKNCKPEVQIGSTLPEYA
_seed_lch:Lcho_ QAQARMPNRNGMTLDHGMWPGRGL-----KTAAKPDVKVAACMSNCEAEPKVASFLPDFA
_seed_reh:H16_A EIQRRMPNRDGMTTGHGLWPGRG----------RPDTRNTACMKDCAGKVAITSSIPDYA
                : :  :***:***  **:*               **..  *** :*     : * :*: :
 
_seed_mms:mma_0 RNAHGNIQLQNRTFGEVRGVDTTKPASTKPISAISADQKLAMATPAKPA-APAKVDGLAL
_seed_har:HEAR1 RNAHGNIQEQNRSFGEVRGVNTTVPASTTPISSATRKSVVATAATTAPAEAAAKPKALGL
_seed_pnu:Pnuc_ RNAHGNIAEQNRQYGPFRGSDSTKP----PLTKLPGASAEGLAHASETH-AS-KKGPAEL
_seed_bprc:D521 RNAHENIAEQNRMYGPYRGADTSKP----PIKQLPGASGEGLAHAADTH-TSAAKGPAAL
_seed_dar:Daro_ RTAHGELADQNRNFGAVRGTRTLGPEA---------------------AKKAADAGTLEL
_seed_lch:Lcho_ RNAHGNLAEQTRMVGAQHGVDTTRP---------PGAAPTLAAAPVVAKATDEGAAALAL
_seed_reh:H16_A RDAHGELAQQQRSFGPVRGV----------------AAGNTVSKSAASAPSEPAAPGARL
                * ** ::  * *  *  :*                                        *
 
_seed_mms:mma_0 AKQYACVACHGVSNKIIGPGFNEIAAKYKGDAAAPAALTAKIKNGSTGAWGPIPMPAQAH
_seed_har:HEAR1 AKQYACIACHGVSNKIVGPGFNEIAAKYKGDSAAATTLFDKVKNGSSGAWGPVPMPGQAH
_seed_pnu:Pnuc_ FKSENCTACHAMSTKLVGPSVADIAAKYQGQSGALDTLMAKVKNGGSGVWGPIPMPAQSQ
_seed_bprc:D521 FKNENCSACHAPNAKLVGPSIADIAKKYEGQSGAVDRLMAKVKNGGAGVWGSIPMPPQAQ
_seed_dar:Daro_ ATKSGCMACHGMKSKIVGPGYSEVVARYQGQPDAESRLIAKVKAGGQGVWGSIPMPPNAH
_seed_lch:Lcho_ AAKHTCTACHAVDAKLVGPAFREIGKKHGSRADAVAYLTGKIKSGGTGVWGAIPMPAQ-T
_seed_reh:H16_A TSQYQCMACHAMDRKLVGPSFADIAGKYKGQ-DAHGALARKVKAGGQGAWGSVPMPAQPQ
                  .  * ***. . *::**.  ::  :: .   *   *  *:* *. *.**.:*** :  
 
_seed_mms:mma_0 VKDEDIKTLVGWIIGGA-K
_seed_har:HEAR1 VKDEDVKTLVSWILSGA-K
_seed_pnu:Pnuc_ LSDEDRKALVTWVLSGG-K
_seed_bprc:D521 LSDDDRKTLVVWMLSGG-K
_seed_dar:Daro_ VKDEDLKTLVQWILAGS-K
_seed_lch:Lcho_ LPDADAKLIANWLAAGAKK
_seed_reh:H16_A IPDSDVQAMVGWILEA--K
                : * * : :. *:  .  *

例3:整列済みデータに新規配列を追加

conf.json

{
  "url": "http://ddbj.nig.ac.jp/wabi/mafft/",
  "querySequence": "/home/hoge/wabi_mafft_2013-1015-1123-50-232-114016.txt",
  "addSequence": "/home/hoge/cyc_aa2.fasta",
  "parameters": "--globalpair --maxiterate 1000 --clustalout",
  "result": "www",
  "address": ""
}

cyc_aa2.fasta

>lch:Lcho_3783
MSSSPKWLAAAVLALAAAGSLAQVTAVGIGRAATEKEIKAWDIDVRPDFKGLPKGSGTVE
QGMEVWEAKCAHCHGVFGESNEVFSPLVGGTTADDVKTGHVARLNDPTFPGRTTLMKVAT
VSTLWDYINRAMPWTAPKSLKTDEVYAVTAYLLNMGDVLPAGFVLSDQTIAQAQARMPNR
NGMTLDHGMWPGRGLKTAAKPDVKVAACMSNCEAEPKVASFLPDFARNAHGNLAEQTRMV
GAQHGVDTTRPPGAAPTLAAAPVVAKATDEGAAALALAAKHTCTACHAVDAKLVGPAFRE
IGKKHGSRADAVAYLTGKIKSGGTGVWGAIPMPAQTLPDADAKLIANWLAAGAKK
>reh:H16_A3571
MSMWAELRTAAALVLAAVSAAPAWAGTADARAALGRTATPAEVAAWDIDVRPDFQGLPRG
SGTVAQGQKVWDGKCASCHGDFGESNEVFTPLVGGTTAEDIRRGRVAGMTGNQPYRTTLM
KVSTVSTLWDYIHRAMPWNAPKSLSVGDVYAVTAYMLHLGEVVPADFTLSDANIAEIQRR
MPNRDGMTTGHGLWPGRGRPDTRNTACMKDCAGKVAITSSIPDYARDAHGELAQQQRSFG
PVRGVAAGNTVSKSAASAPSEPAAPGARLTSQYQCMACHAMDRKLVGPSFADIAGKYKGQ
DAHGALARKVKAGGQGAWGSVPMPAQPQIPDSDVQAMVGWILEAK

例1の結果に、新規の multi fasta データを追加する場合のサンプル

この例では出力ファイル形式を CLUSTAL 形式に指定。

実行されるコマンド

$ mafft --globalpair --maxiterate 1000 --clustalout --add /home/hoge/cyc_aa2.fasta /home/hoge/wabi_mafft_2013-1015-1123-50-232-114016.txt > out.txt

実行の様子

$ perl mafft-client.pl conf2.json 
request-ID: wabi_mafft_2016-0704-1739-30-54-065372
waiting
finished
mafft result is outputed to wabi_mafft_2016-0704-1739-30-54-065372.txt
$ cat wabi_mafft_2016-0704-1739-30-54-065372.txt
CLUSTAL format alignment by MAFFT G-INS-1 (v7.299b)
 
 
mms:mma_0447    MYRFTKTVVALLLA-----T----SGTMALAQ---AAYTNIGRPATAKEIAAWDIDVRPD
har:HEAR1189    MSRFTKTVVALALV-----A----TGAIACAQ---TAYPHIGRTATEKEIAAWDIDVRPD
pnu:Pnuc_0802   MFKLAKVAKFTLFA-----VTTFFAVGSVVAQNSSTHYPGIGRDATPAEVAAWDIDVRPD
bprc:D521_0984  MFKLDKFSISLGFA-----ALIAITAQAALAQSGSAKFPGIGRAATPAEVAAWDIDVRPD
dar:Daro_3133   MSRFSKTILVLALL-----G----ASSTGFSF---ENFKGVGRQATPAEVKAWDIDVRPD
lch:Lcho_3783   MSSSPKWLAAAVLA-----L----AAAGSLAQ---VTAVGIGRAATEKEIKAWDIDVRPD
reh:H16_A3571   MSMWAELRTAAALVLAAVSA----APAWAGTA---DARAALGRTATPAEVAAWDIDVRPD
                *    :      :           :     :         :** **  *: *********
 
mms:mma_0447    FKGLPPGSGTVAKGMAVWEGKCASCHGTFGESNEVFTPIVGGTTKEDIKSGHVAALSNNK
har:HEAR1189    FKGLPKGSGTVSKGMEVWEGKCASCHGTFGESNEVFTPIVGGTTKEDVKTGRVAALATNK
pnu:Pnuc_0802   FKGLPKGSGSVEKGQQLWEAKCSVCHGTFGESNEIFTPIIGGTTTDDIKTGRVASLSDRK
bprc:D521_0984  FKGLPKGSGSVEKGQVIWEAKCASCHGTFGESNEIFTPIAGGTTKDDVKTGRVASLKDMK
dar:Daro_3133   FKGLPKGKGNVERGNELFEEKCASCHGSFGESNEVFTPLAGGTTKDDIKTGRVKGLSSGE
lch:Lcho_3783   FKGLPKGSGTVEQGMEVWEAKCAHCHGVFGESNEVFSPLVGGTTADDVKTGHVARLNDPT
reh:H16_A3571   FQGLPRGSGTVAQGQKVWDGKCASCHGDFGESNEVFTPLVGGTTAEDIRRGRVAGMTG-N
                *:*** *.*.* :*  ::: **: *** ******:*:*: **** :*:: *:*  :    
 
mms:mma_0447    QPQRTTIMKVPTVSTLWDYINRAMPWTAPKSLTTEEVYAVTAYILNMAEILPDDFTLSDK
har:HEAR1189    QPQRTTMMKVATVSTLWDYINRAMPWTAPKSLTTEEVYAVTAYILNMSEVLPDDFTLSDK
pnu:Pnuc_0802   QPQRTTIMKVATVSSLWDYIYRAMPWNAPRSLTPDDTFALVAYLLNMAEVVPDDFVLSNT
bprc:D521_0984  QPQRTTLMKVPTVSTLWDYIYRAMPWNAPRSLTPDDTYALVAFILSLGEIVPDDFVLSDK
dar:Daro_3133   LPQRTTFTKVATISTVFDYIQRAMPWTAPKSLKPDDVYAILAYLLNLQEIVPADFELSDR
lch:Lcho_3783   FPGRTTLMKVATVSTLWDYINRAMPWTAPKSLKTDEVYAVTAYLLNMGDVLPAGFVLSDQ
reh:H16_A3571   QPYRTTLMKVSTVSTLWDYIHRAMPWNAPKSLSVGDVYAVTAYMLHLGEVVPADFTLSDA
                 * ***: **.*:*:::*** *****.**:**.  :.:*: *::* : :::* .* **: 
 
mms:mma_0447    NIAEVQQLMPNRNGMTRNHGMW----------DIKGKPDVKSVACMKDCKTSTDLRSTLP
har:HEAR1189    NIAEVQKLMPNRNGMTQKHGMW----------DVKGKPDVKSVACMKDCQVSGDIRSSLP
pnu:Pnuc_0802   NIAEVQKRMPNRNGMTLKHGLW----------NSKGTPDVHATACMTNCVQFVQIGSELP
bprc:D521_0984  NIAEVK--MPNRNGMTTKHGFW----------SVSGKPDVNGNACMHNCVPFVQIGSTLP
dar:Daro_3133   NIADVQKLLPNRNGMTTDHGLWPGASAKKGGIGNGGIPDVKNVACMKNCKPEVQIGSTLP
lch:Lcho_3783   TIAQAQARMPNRNGMTLDHGMWPGR-----GLKTAAKPDVKVAACMSNCEAEPKVASFLP
reh:H16_A3571   NIAEIQRRMPNRDGMTTGHGLW----------PGRGRPDTRNTACMKDCAGKVAITSSIP
                .**: :  :***:***  **:*             . **..  *** :*     : * :*
 
mms:mma_0447    EPSRNAHGNIQLQNRTFGEVRGVDTTKPASTKPISAISADQKLAMATPAKPA-APAKVDG
har:HEAR1189    EPSRNAHGNIQEQNRSFGEVRGVNTTVPASTTPISSATRKSVVATAATTAPAEAAAKPKA
pnu:Pnuc_0802   DYARNAHGNIAEQNRQYGPFRGSDSTKP----PLTKLPGASAEGLAHASETH-AS-KKGP
bprc:D521_0984  DFARNAHENIAEQNRMYGPYRGADTSKP----PIKQLPGASGEGLAHAADTH-TSAAKGP
dar:Daro_3133   EYARTAHGELADQNRNFGAVRGTRTLGPEA---------------------AKKAADAGT
lch:Lcho_3783   DFARNAHGNLAEQTRMVGAQHGVDTTRPPGAAP----TLAAAPVVAKATDEG-AA----A
reh:H16_A3571   DYARDAHGELAQQQRSFGPVRGVAAGNTVS-----------KSAASAPSEPA-AP----G
                : :* ** ::  * *  *  :*  :  .                          .     
 
mms:mma_0447    LALAKQYACVACHGVSNKIIGPGFNEIAAKYKGDAAAPAALTAKIKNGSTGAWGPIPMPA
har:HEAR1189    LGLAKQYACIACHGVSNKIVGPGFNEIAAKYKGDSAAATTLFDKVKNGSSGAWGPVPMPG
pnu:Pnuc_0802   AELFKSENCTACHAMSTKLVGPSVADIAAKYQGQSGALDTLMAKVKNGGSGVWGPIPMPA
bprc:D521_0984  AALFKNENCSACHAPNAKLVGPSIADIAKKYEGQSGAVDRLMAKVKNGGAGVWGSIPMPP
dar:Daro_3133   LELATKSGCMACHGMKSKIVGPGYSEVVARYQGQPDAESRLIAKVKAGGQGVWGSIPMPP
lch:Lcho_3783   LALAAKHTCTACHAVDAKLVGPAFREIGKKHGSRADAVAYLTGKIKSGGTGVWGAIPMPA
reh:H16_A3571   ARLTSQYQCMACHAMDRKLVGPSFADIAGKYKGQD-AHGALARKVKAGGQGAWGSVPMPA
                  *  .  * ***. . *::**.  ::  :: .   *   *  *:* *. *.**.:*** 
 
mms:mma_0447    QAHVKDEDIKTLVGWIIGGA-K
har:HEAR1189    QAHVKDEDVKTLVSWILSGA-K
pnu:Pnuc_0802   QSQLSDEDRKALVTWVLSGG-K
bprc:D521_0984  QAQLSDDDRKTLVVWMLSGG-K
dar:Daro_3133   NAHVKDEDLKTLVQWILAGS-K
lch:Lcho_3783   QT-LPDADAKLIANWLAAGAKK
reh:H16_A3571   QPQIPDSDVQAMVGWILE-A-K
                :. : * * : :. *:   . *
ページの先頭へ戻る