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

View of /FigKernelScripts/just_inconsistent_sets.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Tue Sep 20 16:32:31 2011 UTC (8 years, 1 month ago) by overbeek
Branch: MAIN
CVS Tags: rast_rel_2014_0912, rast_rel_2014_0729, mgrast_release_3_1_2, rast_rel_2011_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_10262011, HEAD
show inconsistyent sets

#
use strict;
my $usage = "usage: just_inconsistent_sets < sets > inconsistent.sets";
#
# input is a sorted file of sets (set # is first field).
#
# inconsistent sets are those with a different value in the last field.
#
use Data::Dumper;

my $last = <STDIN>;
while ($last && ($last =~ /^(\S+)/))
{
    my $set = $1;
    my @set;
    while ($last && ($last =~ /^(\S+)/) && ($1 eq $set))
    {
	push(@set,$last);
	$last = <STDIN>;
    }
    
    my $consist = 1;
    if ($set[0] =~ /\t(\S[^\t]*)$/)
    {
	my $x = $1;
	my $i;
	for ($i=1; ($i < @set) && ($set[$i] =~ /\t(\S[^\t]*)$/) && ($1 eq $x); $i++) {}
	if ($i < @set)
	{
	    foreach $_ (@set)
	    {
		print $_;
	    }
	}
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3