User Tools

Site Tools


tutorialcodonusageenglish

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorialcodonusageenglish [2007/10/22 23:56]
gaou
tutorialcodonusageenglish [2014/01/18 07:44] (current)
Line 12: Line 12:
 For example, if you use the data file “bsub” (the complete genome of //Bacillus subtilis// in the GenBank format bundled with G-language System) under the current directory to analyze, you only need to input the next two lines to get ready. For example, if you use the data file “bsub” (the complete genome of //Bacillus subtilis// in the GenBank format bundled with G-language System) under the current directory to analyze, you only need to input the next two lines to get ready.
  
 +<code perl>
   use G;    use G; 
   $gb = new G("​bsub"​); ​   $gb = new G("​bsub"​); ​
 +</​code>​
 Let’s try and execute the following ​ Perl script. (Please set the file name to “test.pl”) Let’s try and execute the following ​ Perl script. (Please set the file name to “test.pl”)
  
Line 72: Line 73:
 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. 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.
  
 +<code perl>
   use G;    use G; 
   $gb = new G("​bsub"​); ​   $gb = new G("​bsub"​); ​
   codon_usage($gb); ​   codon_usage($gb); ​
 +</​code>​
  
 If you execute the sript, codon usage percentage should be shown on the display, and the following codon table should be displayed. If you execute the sript, codon usage percentage should be shown on the display, and the following codon table should be displayed.
Line 110: Line 113:
 Please rewrite the script in Step one to the following example. Please rewrite the script in Step one to the following example.
  
 +<code perl>
   use G;    use G; 
   $gb = new G("​bsub"​); ​   $gb = new G("​bsub"​); ​
   codon_usage($gb,​ -CDSid=>'​CDS113'​); ​   codon_usage($gb,​ -CDSid=>'​CDS113'​); ​
 +</​code>​
  
 “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. “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.
Line 237: Line 242:
 In the script written in Step 0, rewrite the following line that outputs the beginning and ending position for ‘CDS1’, and execute the file. In the script written in Step 0, rewrite the following line that outputs the beginning and ending position for ‘CDS1’, and execute the file.
  
 +<code perl>
   print "​$gb->​{CDS1}->​{start}..$gb->​{CDS1}->​{end}"; ​   print "​$gb->​{CDS1}->​{start}..$gb->​{CDS1}->​{end}"; ​
 +</​code>​
  
 Confirm the outcome corresponds to the data file above. Confirm the outcome corresponds to the data file above.
Line 249: Line 256:
 $gb->​cds() relays all CDS object names stored inside $gb in a sequence. For example, the script made in Question2 which analyzes codon usage percentage for the DnaA gene, should get the same result as above, even if you rewrite $gb->​cds() like the following. $gb->​cds() relays all CDS object names stored inside $gb in a sequence. For example, the script made in Question2 which analyzes codon usage percentage for the DnaA gene, should get the same result as above, even if you rewrite $gb->​cds() like the following.
  
 +<code perl>
   use G;    use G; 
   $gb = new G("​bsub"​); ​   $gb = new G("​bsub"​); ​
Line 257: Line 265:
     }      } 
   }    } 
 +</​code>​
  
 Now, let me explain the script. Now, let me explain the script.
 (1) The foreach line has the following structure. (1) The foreach line has the following structure.
  
 +<code perl>
   foreach $variable (@array){ ​   foreach $variable (@array){ ​
-       some process here.+       #some process here.
    ​} ​    ​} ​
 +</​code>​
 From the top, the element of the sequence is substituted with a variable, and is processed each time there is a substitution. Therefore, ​ From the top, the element of the sequence is substituted with a variable, and is processed each time there is a substitution. Therefore, ​
 “foreach $cds ($gb->​cds()){” means to substitute sequence element(the object name of CDS)  to a variable called $cds in order and process it. This is the basic way to process by each gene in the G-language System. “foreach $cds ($gb->​cds()){” means to substitute sequence element(the object name of CDS)  to a variable called $cds in order and process it. This is the basic way to process by each gene in the G-language System.
Line 271: Line 281:
 This is written “variable=~/​regular expression/​. This is written “variable=~/​regular expression/​.
  
 +<code perl>
   if($gb->​{$cds}->​{gene} =~ /​dnaA/​){ ​   if($gb->​{$cds}->​{gene} =~ /​dnaA/​){ ​
         codon_usage($gb,​ -CDSid=>​$cds); ​         codon_usage($gb,​ -CDSid=>​$cds); ​
    ​} ​    ​} ​
 +</​code>​
 +
 In the script above, it means if a gene($gb->​{$cds}->​{gene}) matches “dnaA”, it is to calculate the codon usage in the CDS.  In the script above, it means if a gene($gb->​{$cds}->​{gene}) matches “dnaA”, it is to calculate the codon usage in the CDS. 
    
tutorialcodonusageenglish.txt · Last modified: 2014/01/18 07:44 (external edit)