User Tools

Site Tools


This is an old revision of the document!


タンパク質を構成するアミノ酸の配列順序を決めるのは、核酸塩基の配列順序です。 それぞれのアミノ酸は、4種の核酸塩基(A, T/U, G, C)のうち3塩基の連鎖(コドン) でコードされています。アミノ酸の種類が20種類であるのに対し、3個の塩基の並び方は 4x4x4で64通り考えられます。実際、1つのアミノ酸に複数のコドンが対応すること が知られており、このように、同一のアミノ酸をコードするコドンを 同義コドン (synonym codon)と呼びます。 同義コドンの使用頻度には、生物種固有の偏りが存在することが知られています。

ここでは、初心者向けにG-language System の使い方を解説していきます。 前提として、以上の生物学的知識と、UNIXの基本的な操作法が身についているものとします。

Step 0 - Starting up the G-language System

Here, I will explain how to use the G-language System for beginners. As a precondition, it is expected that the biological knowledge shown above, and basic UNIX operating skills are already mastered.

Now, before we start to analyze codon usage, let’s start the G-language System. If you use the G-language System, genome analysis is very simple.

For example, if you use the data file “bsub.gbk” (the complete genome of Bacillus subtilis in the Genbank form) under the current directory to analyze, you only need to input the next two lines to get ready.

use G; 
$gb = new G("bsub.gbk"); 

Let’s try and execute the following Perl script. (Please set the file name to “”)

perl  [ENTER] 

Did you get the following output?

                 G-language  Genome Analysis Environment v.1.6.10


            Please cite: 
               Arakawa et al. (2003) Bioinformatics.
               Arakawa et al. (2006) Journal of Pestice Science.

            License: GNU General Public License
            Copyright (C) 2001-2007 G-language Project
            Institute for Advanced Biosciences, Keio University, JAPAN 


Accession Number: AL009126 

  Length of Sequence :   4214814 
         A Content :   1187757 (28.18%) 
         T Content :   1192867 (28.30%) 
         G Content :    915023 (21.71%) 
         C Content :    919167 (21.81%) 
            Others :         0 (0.00%) 
        AT Content :    56.48% 
        GC Content :    43.52% 

With the output of the Accession Number and the base content statistic, the G-language System informs that it has successfully read the data file (“bsub.gbk”).

Now, we will explain the script.

  • use G: imports module G
  • $gb = new G("bsub.gbk"); loads the file “bsub.gbk” under the current directory, and stores the annotation and the base sequence under the variable ”$gb”.

Exercise 0:

Load the complete genome data for other bacteria (such as “ecoli.gbk”, “hbsp.gbk”, and “mgen.gbk”).

{Hint} Rewrite the line $gb→new G("bsub.gbk"); on the above script.

Step1: Examples of standard function usage (1): Analyzing of codon usage among entire genes.

In the G-language System, there are several functions set for genome analysis. Now, let’s analyze codon usage for B.subtilis, using one of the standard functions “codon usage()”. Please rewrite a line using the codon usage() function in the Perl script you have created in Step0.

use G; 
$gb = new G("bsub.gbk"); 

If you execute the sript, codon usage percentage should be shown on the display, and the following codon table should be displayed.

This is the chart of the calculation of the frequency of synonym codons in the B.subtilis genome. Each amino acids sum of synonym codons frequancy equals one. For example, for phenylalanine(code:F), the percentage of TTC is 0.315 compared to 0.685 for TTT. Of the two synonym codons, it heavily uses TTT. Of the three synonym codons that exist, Isoleucine(code :i) heavily uses ATT. As you can see, there is a pattern in which each amino acid is biased upon a peculiar codon.

Excercise 1:

Compare and examine the deflection of each amino acids synonym codon usage for mycoplasma genitalium (“mgen.gbk”) and B.subtilis.

[Hint] Rewrite the line $gb→new G("bsub.gbk"); in the above script.

Step2 Examples of standard function usage(2) : Analyzing of codon usage for each gene

The standard functions for the G-language System has several options.

The function “codon usage()” has the following options.

-CDSid specifies the ID for CDS in codon usage calculations. Calculates all genes for default.
-output specifies the output point. “stdout” outputs to the display, “f” ouputs to a file. The default is “stdout”.
-filename specifies the output file name. The default is “codon_usage.csv”.

The option, as you can see in the following example, puts “-” in front of the name of the option and “⇒”ties it with the value.

In Step 1, we calculated codon usage percentage in the whole genome universe, but now lets try calculating codon usage percentage in a certain gene.

Please rewrite the script in Step one to the following example.

use G; 
$gb = new G("bsub.gbk"); 
codon_usage($gb, -CDSid=>'CDS113'); 

“CDS113” corresponds with the gene (tufA) that codes with the elongation factor (TU, EF-Tu). If you execute the above script, the codon usage percentage for the tufA gene should be shown on the display like the following example.

/ -> taa -> 1   1.000 
A -> gca -> 2   0.074 
A -> gcc -> 2   0.074 
A -> gcg -> 3   0.111 
A -> gct -> 20   0.741 
C -> tgc -> 2   1.000 
D -> gac -> 15   0.600 
D -> gat -> 10   0.400 
E -> gaa -> 32   0.762 
E -> gag -> 10   0.238 
F -> ttc -> 13   1.000 
G -> gga -> 9   0.243 
G -> ggc -> 5   0.135 
G -> ggt -> 23   0.622 
H -> cac -> 7   0.583 
H -> cat -> 5   0.417 
I -> atc -> 19   0.760 
I -> att -> 6   0.240 
K -> aaa -> 19   0.864 
K -> aag -> 3   0.136 
L -> cta -> 1   0.043 
L -> ctt -> 20   0.870 
L -> tta -> 2   0.087 
M -> atg -> 14   1.000 
N -> aac -> 8   0.889 
N -> aat -> 1   0.111 
P -> cca -> 14   0.824 
P -> cct -> 3   0.176 
Q -> caa -> 7   0.875 
Q -> cag -> 1   0.125 
R -> cgc -> 6   0.300 
R -> cgt -> 14   0.700 
S -> agc -> 2   0.118 
S -> tca -> 3   0.176 
S -> tcc -> 1   0.059 
S -> tct -> 11   0.647 
T -> aca -> 13   0.394 
T -> act -> 20   0.606 
V -> gta -> 13   0.342 
V -> gtc -> 1   0.026 
V -> gtt -> 24   0.632 
W -> tgg -> 1   1.000 
Y -> tac -> 9   0.818 
Y -> tat -> 2   0.182 
total -> 397 

It shows from the left, the abbreviation of the amino acid → the codon → the codon sum → percentage of synonym codons. You can tell from this output, the deflection of synonym codons for the tufA gene, differs greatly from the pattern of the entire genome universe. For example, of the two synonym codons it possesses, phenylalanine (code: F) uses only TTC as a synonym codon. Of the four synonym codons it possesses, alanine (code :A) only uses GCT.

Excercise 2:

Please calculate the codon usage percentage for the gene (dnaA), witch codes DnaA protein and relates to DNA replication.

Hint: rewrite the line “codon_usage($gb, -CDSid⇒'CDS113');” in the above script.

Step 3 Access to genome data

The data read into the G-lanbuage System upon mobilization, is saved inside “$gb”. Now, we will explain simply how to access to each genome data inside “$gb”. For further explanations, use perldoc command to view the manuals,

perldoc G [ENTER]

and refer to the perldoc documentation of Now, I will show a part of the data file (“bsub.gbk”) that we have used.

LOCUS AL009126 4214814 bp circular BCT 10-MAY-1999

DEFINITION  Bacillus subtilis complete genome. 
FEATURES             Location/Qualifiers 
   source          1..4214814 
                   /organism="Bacillus subtilis" 
   gene            410..1750 
   CDS             410..1750 
                   /function="initiation of chromosome replication (DNA 
                   /note="alternate gene name: dnaH, dnaJ, dnaK" 
BASE COUNT  1187757 a 919167 c 915023 g1192867 t 
      1 atctttttcg gcttttttta gtatccacag aggttatcga caacattttc acattaccaa 
4214761 ttacggaaaa aagacaaatt caaacaattt gcccctaaaa tcacgcatgt ggat 

$gb has the following structures.


For example, information for each CDS is inside structures named CDS1, CDS2, …, CDS4100(CDS+num.). For information for each structure, you access hierarchically like below.


All base sequences from Origin onward, are inside


Excercise 3:

In the script written in Step 0, rewrite the following line that outputs the beginning and ending position for ‘CDS1’, and execute the file.

print "$gb->{CDS1}->{start}..$gb->{CDS1}->{end}"; 

Confirm the outcome corresponds to the data file above.

Step 4-より高度な解析のために

G-language System にはゲノム解析関数が標準で多数用意されており、それらの 標準関数のみでも幅広い解析を行うことが可能です。しかし、実際の研究においては、 より高度な解析を行う場面も想定されます。そのためには、ある程度のプログラミング 能力は不可欠です。Perl初心者は、初心者用講座や新人勉強会などの テキストを参考にして下さい。

G-language System はゲノム解析のための関数だけでなく、ゲノムデータベースを 扱い易くするためのプラットフォームを提供します。そのプラットフォームとは、 $gb というG-language System のインスタンスから呼び出せる関数であり、 遺伝子毎の処理、開始コドン・終止コドン周辺の処理、イントロン・エキソン処理 など多岐に渡ります。 詳しくは、 のperldocドキュメンテーション(Prelude-manual )を参照して下さい。

$gb→cds() は、$gb に格納されている全CDSのオブジェクト名を配列で返します。 例えば、課題2で作成したdnaA 遺伝子のコドン使用頻度解析用のスクリプトは、 $gb→cds() を使って以下のように書き換えても同じ結果が得られるはずです。

use G; 
$gb = new G("bsub.gbk"); 
foreach $cds ($gb->cds()){ 
  if($gb->{$cds}->{gene} =~ /dnaA/){ 
      codon_usage($gb, -CDSid=>$cds); 

では、スクリプトの説明をしましょう。 (1) foreach文は次のような構造をしています。

foreach $variable (@array){ 
     some process here.


 foreach $cds ($gb->cds()){ 

は、配列の要素(CDSのオブジェクト名)を順次 $cds という変数に代入して処理せよ という意味です。これは、G-language Systemにおいて遺伝子毎の処理をする基本的な方法の一つです。

(2) Perlでは正規表現と呼ばれる強力な表現を使うことができます。よくある使い方としては、 「ある正規表現は、ある文字列にマッチするか?」というものです。これは、変数 =~ /正規表現/ と記述します。

 if($gb->{$cds}->{gene} =~ /dnaA/){ 
      codon_usage($gb, -CDSid=>$cds); 

は、もし遺伝子名($gb→{$cds}→{gene})が"dnaA"にマッチするなら、そのCDSのコドン使用頻度を計算せよ という意味です。


tutorialcodonusagejapanese.1188210610.txt.gz · Last modified: 2014/01/18 07:44 (external edit)