Skip to content
Snippets Groups Projects
Commit 3bc94684 authored by Eduardo Eyras's avatar Eduardo Eyras
Browse files

add_Supporting_Feature() now checks whether a feature has been added before

parent c90a996c
No related branches found
No related tags found
No related merge requests found
......@@ -738,7 +738,6 @@ sub _genscan_peptide{
=cut
sub add_Supporting_Feature {
my ($self,$feature) = @_;
......@@ -747,11 +746,25 @@ sub add_Supporting_Feature {
$self->{_supporting_evidence} = [] unless defined($self->{_supporting_evidence});
push(@{$self->{_supporting_evidence}},$feature);
# check whether this feature object has been added already
my $found = 0;
if ( $feature && $self->{_supporting_evidence} ){
foreach my $added_feature ( @{ $self->{_supporting_evidence} } ){
# compare objects
if ( $feature == $added_feature ){
$found = 1;
# no need to look further
last;
}
}
}
if ( $found == 0 ){
push(@{$self->{_supporting_evidence}},$feature);
}
}
=head2 each_Supporting_Feature
Title : each_Supporting_Feature
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment