Skip to content

Commit

Permalink
added script to remove identical matches from LAST alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
gringer committed May 1, 2016
1 parent 3eb4d6a commit 195d11a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions last-rmident.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/perl

my @lineBuffer = ();
my @ids = ();

while(<>){
my $line = $_;
if(/^([a-z])\s(.*?)\s/){
my ($flag, $id) = ($1, $2);
if($flag eq "s"){
push(@ids, $id);
} elsif($flag eq "a"){ # new alignment
if((scalar(@ids) != 2) || ($ids[0] ne $ids[1])){
print(join("",@lineBuffer));
}
# if(@ids){
# printf("a '%s' '%s' %d %d\n", $ids[0], $ids[1],
# scalar(@lineBuffer), scalar(@ids));
# } else {
# print("a\n");
# }
@lineBuffer = ();
@ids = ();
}
}
push(@lineBuffer, $line);
}

if((scalar(@ids) != 2) || ($ids[0] ne $ids[1])){
print(join("",@lineBuffer));
}

0 comments on commit 195d11a

Please sign in to comment.