Skip to content

Commit

Permalink
Fix sorting of blat results (#101)
Browse files Browse the repository at this point in the history
* Fix sorting of blat results 

Sort blat results based on alignments score first; then sort based on chr name. This fix solved the issue that some EWSR1-FLI1 fusions are missed in final fusion file instead of reporting EWSR1 speudogene and FLI1 fusion.

* Add additional documentation

* Fix typo

Co-authored-by: Andrew Thrasher <[email protected]>
  • Loading branch information
liqingti and adthrasher committed Jul 18, 2022
1 parent 3edcd38 commit 8f57992
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/perllib/CiceroExtTools.pm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ sub run {
croak "Please check BLAT server is correctly configured or running.\n" if($test != 0);
print STDERR "\ntest=$test\t", join(" ", ($self->{PRG}, $self->{BIT2_DIR}, $param{-QUERY}, $unsorted_psl, $options)), "\n" if($debug);
# Sort the output PSL file from BLAT.
`sort -k 11,11nr -k 10,10d -k 14,14d -k 1,1nr $unsorted_psl -o $psl_file`;
# Sort by query sequence, score, chromosome
`sort -k 11,11nr -k 10,10d -k 1,1nr -k 14,14d $unsorted_psl -o $psl_file`;
if ($?){
my $err = $!;
print STDERR "Error sorting blat output: $err\n";
Expand Down Expand Up @@ -968,7 +969,8 @@ sub overhang_remapping {
print STDERR "test=$test\t", join(" ", ($blat_prefix, $contig_file, $unsorted_psl, $options)), "\n" if($debug);

return unless(-s $unsorted_psl);
`sort -k 10,10d -k 14,14d -k 1,1nr $unsorted_psl -o $psl_file`;
# Sort by query sequence, score, chromosome
`sort -k 10,10d -k 1,1nr -k 14,14d $unsorted_psl -o $psl_file`;
if ($?){
my $err = $!;
print STDERR "Error sorting blat output: $err\n";
Expand Down

0 comments on commit 8f57992

Please sign in to comment.