Q.and has asked for the wisdom of the Perl Monks concerning the following question:
I have BLAST tabular output with an added second column, such that each line of the data looks like:
[0] queryspecies [1] subjspecies [2] subjID [3] percentidentity ...
The query species column contains multiple species and was blast against a multi-species database; column 2, subject species is non-unique, but the identifier for that subject species sequence in the 3rd col is unique.
For each query species, I want to return the subject identifier with the highest percent identity out of all those with the same subject species--query species pair.
I think this will involve a hash of hashes, using query species as keys for subject species, whose values are subject identifiers, plus some conditional evaluation of the percent identity and somewhere to store the highest percent ID. I'm not sure how to begin writing this, but would prefer to do so without using BioPerl. Any guidance would be of great assistance!
Mock Input:
qspecies1 subjectspecies1 subjsp1.seqA 30Desired Output:
qspecies1 subjectspecies1 subjsp1.seqC 100
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing multispecies database BLAST output
by poj (Abbot) on Mar 24, 2016 at 20:09 UTC | |
by Q.and (Novice) on Mar 24, 2016 at 20:20 UTC | |
|
Re: Parsing multispecies database BLAST output -- oneliner
by Discipulus (Canon) on Mar 25, 2016 at 08:25 UTC |