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
gcskewanalysisenglish [2010/10/01 12:13]
ike
gcskewanalysisenglish [2010/10/01 12:14]
ike
Line 75: Line 75:
  
 Following script opens a graph with much more colorfully generated by gnuplot with attached gimv viewer. Following script opens a graph with much more colorfully generated by gnuplot with attached gimv viewer.
- 
 ====== STEP 4 - Done ====== ====== 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.txt · Last modified: 2014/01/18 07:44 (external edit)