From: Chris M. <cmu...@us...> - 2005-01-14 01:20:57
|
Update of /cvsroot/gmod/schema/chado/chaos-xml/lib/Bio/Chaos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23505/lib/Bio/Chaos Modified Files: ChaosGraph.pm Log Message: fixed problem with duplicate feature_relationships Index: ChaosGraph.pm =================================================================== RCS file: /cvsroot/gmod/schema/chado/chaos-xml/lib/Bio/Chaos/ChaosGraph.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ChaosGraph.pm 23 Dec 2004 16:43:55 -0000 1.4 --- ChaosGraph.pm 14 Jan 2005 01:20:42 -0000 1.5 *************** *** 530,537 **** my $self = shift; my $f = shift; my $g = $self->graph; ! my @e = $g->in_edges(ref($f) ? $f->get_feature_id : $f); my @frs = (); while (@e) { --- 530,538 ---- my $self = shift; my $f = shift; + my $fid = ref($f) ? $f->get_feature_id : $f; my $g = $self->graph; ! my @e = $g->in_edges($fid); my @frs = (); while (@e) { *************** *** 567,571 **** --- 568,575 ---- my $iterator = $self->feature_iterator($topfid); my @cfids = (); + my %got_idh = (); while (my $fid = $iterator->next_vertex) { + next if $got_idh{$fid}; + $got_idh{$fid} = 1; push(@cfids, $fid) unless $fid eq $topfid; } *************** *** 634,638 **** printf "Making island $island_name\n"; } ! my $island = $self->new_feature( feature_id=>$island_id, --- 638,642 ---- printf "Making island $island_name\n"; } ! my $island = $self->new_feature( feature_id=>$island_id, |