I have a blast output in outfmt 6 format, like this:
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 20.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
JXPU01010214 XP_021704425.1 91.21 182 16 0 3548 152 333 2e-91 287
But I have a zillion of lines, each subject has more than 100 matches, how I can extract only the first 10 matches of each subject?
Thanks.
If you are running ncbi blastn from the command line you can limit the number of results displayed per query using the -num_descriptions (or possibly its -num_alignments ... one controls the one-line summaries and the other controls the ascii alignment views that are output in the default format). The default setting is pretty high, like 250-500 results per query. It will show the best scoring hits first, reporting as many as you request. If you have many tied, top scoring hits I think its arbitrary which amongst those hits gets shown.
If you are running it from the NCBI website you'll have to poke around their blast page. I don't recall if those are settings you can set using their web tool.
I am running a local BLAST, but the parameter num_descriptions works only with outmft 4 our less, and the parameter num_alignments return a variable number of matches, for example, I put the parameter num_alignments 10 and several subjects returner 13 or more matches...