Skip to content

Instantly share code, notes, and snippets.

@dbolser
Created May 23, 2012 14:22
Show Gist options
  • Save dbolser/2775493 to your computer and use it in GitHub Desktop.
Save dbolser/2775493 to your computer and use it in GitHub Desktop.
sub best_hit {
## Score
$b->score <=> $a->score ||
## Identity
$b->percent_id <=> $a->percent_id ||
## Length on query sequence
(($b->hend-$b->hstart) <=>
($a->hend-$a->hstart)) ||
## Whatever
rand() <=> rand()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment