This post A: Blast+ results file parsing to fasta file ?
Hi all!
I'm doing local blasts on contigs and I'm looking for results with a tabular output.
I have already tried -outfmt with 6, 7 or 10, playing with different output format options. However I'm looking for something like this (obtained with blastn -query inputContigs.fasta -db nt -task blastn > output.txt) but with tabulation between references/organisms/bits/evalues:
Query= ha-1_denovo_c1 cov=5.25 len=454 gc=23.79
nseq=16
Length=454
Score E
Sequences producing significant alignments: (Bits) Value
gb|AC270265.1| Homo sapiens chromosome 8 clone CH17-194A21, comp... 57.2 3e-04
gb|KP249663.1| Eucommia ulmoides microsatellite EU-IV43S4101EQ75... 57.2 3e-04
ref|XM_010093073.1| Morus notabilis Ethylene-responsive transcri... 57.2 3e-04
emb|LL711914.1| Elaeophora elaphi genome assembly E_elaphi ,scaf... 57.2 3e-04
Does anybody knows how to solve my problem?
3 answers
I am not sure I get what you're trying to achieve but it may be that what you're missing is simply the custom formatting option for the tabular output. Have a look at blastn -help.
Alternatively, you can try the xml output and reformat it to tabular output using XSLT
Edit: (there was a previous post on this but I can't seem to find it). here is Pierre Lindenbaum's post with his blast2tsv stylesheet.
Thanks, just found it again while you were writing.
Thank you for your answer, it works either with blast2tsv.xsl or blast_xml_parse.py!
However, it stops when my file is too big. So I split my files. I was also thinking about filtering my input file, something like grep -e Homo -e Query= file.txt > filt_file.txt
It works with my original input file but not with xml. How can I filter such a file?
You can do -outfmt 6, then on the command-line do cut -f 1,2,11,12 output.txt > output2.txt to get the query, subject, e-val, and bit score columns.
Log in to answer this question.