Skip to content

Instantly share code, notes, and snippets.

@coela
Created July 10, 2012 10:50
Show Gist options
  • Save coela/3082638 to your computer and use it in GitHub Desktop.
Save coela/3082638 to your computer and use it in GitHub Desktop.
hoge.pl
use strict;
use G;
use Data::Dumper;
my $gb = new G ("ecoli", "no msg");
open my $FILE, $ARGV[0] || die;
my $bunkatu = int (length ($gb->{SEQ}) /20);
cai($gb);
my @feature;
my $i = 0;
while (<$FILE>) {
chomp;
my @matome;
if ($i == 0) {
@feature = split /\t/ if $i == 0;
}
else{
my @line = split /\t/;
for (my $j = 0 ;$j <=$#line; $j++){
my $class = int ($gb->{$feature[$j]}->{start} /$bunkatu);
push @{$matome[$class]}, $gb->{$feature[$j]}->{cai};
}
}
for (my $h = 0;$h <= $#matome;$h++) {
say $h. " " .mean($matome[$h]);
}
$i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment