[Bio] / FigKernelScripts / kp_get_properties_next_round.pl Repository:
ViewVC logotype

View of /FigKernelScripts/kp_get_properties_next_round.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Sun Oct 27 14:04:40 2013 UTC (6 years ago) by overbeek
Branch: MAIN
CVS Tags: rast_rel_2014_0729, rast_rel_2014_0912, HEAD
a little script to make next properties file in iterative training

use strict;
use Data::Dumper;

# usage: kp_get_properties_next_round < summarized > properties 
my %by_cat;
my @summaries = grep { ($_->[0] >= 0.7) && ($_->[4] > 500) } 
                sort { $b->[0] <=> $a->[0] } 
                map { chomp; [split(/\t/,$_)] } 
                <STDIN>;

foreach my $tuple (@summaries)
{
    push(@{$by_cat{$tuple->[2]}},$tuple);
}
my $best;
foreach my $p (keys(%by_cat))
{
    if ((! defined($best)) || (@{$by_cat{$p}} < $best)) { $best = @{$by_cat{$p}} }
}

print STDERR "training using $best genomes from each category\n";
my $i;
foreach my $p (keys(%by_cat))
{
    for ($i=0; ($i < $best); $i++)
    {
	print join("\t",($p,$by_cat{$p}->[$i]->[1])),"\n";
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3