This is a test version of Biostars. For the public version, visit https://www.biostars.org.
collecting 50 most frequent proteins from tabular blastX result

Dear Friends, Hi

I have done a blastX against NCBI nr database (using Diamond and keeping -max_target_seqs = 1) with outfmt 6.

I want to collect 50 proteins with the most frequent occurance in my results.

Is there any command line sccript or program for doing this task?

(I have tried cutting the column of the IDs and then openning it in Microsoft excel and count the duplicates and . . . but opening such file and running the duplicate count in my Windows system computer which is not very powerful is very difficult)

Thank you in advance

blast

Dear genomax2, Hi & thank you.

but I could not understand that what is the final correct python script ?

Simple: cut -f 1 blast_out.tbl | sort | uniq -c | sort -k1gr |head -50

Dear Asef, Hi

It seems that it is magically working!

Thank you

No magic, just simple unix command liners

Dear Asef,

it seems that your script has two sort commands in it, can we reduce it to just one ?

~ Best

Probably not. You can start at left and keep running the commands, every-time adding one more term (from the pipes) to see why not.

 cut -f 1 blast_out.tbl | less
 cut -f 1 blast_out.tbl | sort | less
 cut -f 1 blast_out.tbl | sort | uniq -c | less

You get the idea.

0 answers

No answers yet.

Log in to answer this question.