Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts

Tuesday, February 05, 2008

BLAST performance analysis configuration

All the files needed for BLAST performance testing (e.g., perl scripts, databases, different versions of BLAST software, ...) are located under my account on everest under ~/BLASTanalysis.
In order to run a BLAST test, a properties file (e.g., propertyFile) needs to be edited/provided. Properties file specifies the following data: database, input file, program, I/O params are specified, number of fragments and threads, and execution host.
Once configured, run run.pl script. This script will split the input file into specified number of fragments, generate LRM scripts, and submit the job:
perl run.pl {properties file}

Tuesday, July 10, 2007

Numerical sort in Perl

If trying to sort a hash based on key where keys are numerical, using just
foreach $Key (sort keys %Output_Hash) will sort/output values as follows:
1
10
11
...
2
20
21
...

In order to get proper numerical sort, modify above code as this:
foreach $Key (sort {$a <=> $b} keys %Output_Hash)
This will make a comparison on each of the keys and result will be what is needed:
1
2
3
...
10
11