best_minimap_hit.pl 318 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/perl -w
  2. #
  3. #Author: Jue Ruan
  4. #
  5. use strict;
  6. my $rs = [""];
  7. while(<>){
  8. my @ts = split;
  9. if($ts[0] ne $rs->[0]){
  10. if(length $rs->[0]){
  11. print join("\t", @{$rs}), "\n";
  12. }
  13. $rs = \@ts;
  14. } else {
  15. if($ts[9] > $rs->[9]){
  16. $rs = \@ts;
  17. }
  18. }
  19. }
  20. if(length $rs->[0]){
  21. print join("\t", @{$rs}), "\n";
  22. }
  23. 1;