User Tools

Site Tools


gcskewanalysisenglish

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
gcskewanalysisenglish [2010/10/01 12:11]
ike
gcskewanalysisenglish [2014/01/18 07:44] (current)
Line 58: Line 58:
  
 Primary principle of G-langugae GAE is to make analysis more efficient. So G-language GAE provides a method grapher() to automatically draw a graph which save up user’s time.  Primary principle of G-langugae GAE is to make analysis more efficient. So G-language GAE provides a method grapher() to automatically draw a graph which save up user’s time. 
- 
  
  
Line 66: Line 65:
   x x-axis label   x x-axis label
   y y-axis label   y y-axis label
-  x1, x2, ... @value1, @value2, ... のラベル+  x1, x2, ... @value1, @value2, ...
   filename Filename   filename Filename
   title title   title title
 </​code>​ </​code>​
  
 +There are many more options available. For further options see reference.
 +This is it for generating a graph.
  
 +
 +Following script opens a graph with much more colorfully generated by gnuplot with attached gimv viewer.
 +====== STEP 4 - Done ======
 +<code perl>
 +  use strict;
 +  use warnings;
 +  use G; 
 +   
 +  my $gb = load("​ecoli"​); ​
 +   
 +  my @gcskew = &​gcskew($gb,​ 10000); ​
 +   
 +  sub gcskew{ ​
 +     my $gb = shift; ​
 +     my $window = shift; ​
 +     my @gcskew = (); 
 +   
 +     my @location = ();  ​
 +     my $i = 0;   
 +     for ($i = 0; $i * $window < length($gb->​{SEQ});​ $i ++){      ​
 +           my $sequence = substr($gb->​{SEQ},​ $i * $window, $window); ​  
 +           my $c = $sequence =~ tr/​c/​c/;  ​
 +           my $g = $sequence =~ tr/​g/​g/; ​  
 +           my $skew = ($c-$g)/​($c+$g); ​   ​
 +           push (@location, $i * $window);  ​
 +           push (@gcskew, $skew); ​     ​
 +     ​} ​
 +   
 +     my $j = 0; 
 +     ​open(OUT,​ '>​gcskew.csv'​); ​
 +     print OUT "​location,​GC skew¥n"; ​
 +     for ($j = 0; $j <= $i; $j++){ ​
 +           print OUT $location[$j],​ ",",​ $gcskew[$j],​ "​¥n"; ​
 +     ​} ​
 +     ​close(OUT); ​
 +   
 +   
 +     ​grapher(¥@location,​ ¥@gcskew, -x=>'​bp',​ -y=>'​GC skew', ​
 +                              -title=>'​GC skew', -filename=>'​gcskew.png'​); ​
 +   
 +     ​msg_gimv("​graph/​gcskew.png"​); ​
 +     ​return @gcskew; ​
 +  } 
 +      ​
 +</​code>​
gcskewanalysisenglish.1285935099.txt.gz · Last modified: 2014/01/18 07:44 (external edit)