Extraction of best alignment in blast out put
2
0
Entering edit mode
8.9 years ago
Eva_Maria ▴ 190

Hey everyone

I have about 4000 blast tab limited output, from thees output I want to extract best alignment (first line only) and want to store another different 4000 files. How is it possible using awk or some other programme

Please help me

perl awk sequence blast • 2.7k views
ADD COMMENT
0
Entering edit mode

Hi,

Can you post the first 10 lines or so from your tab limited output?

ADD REPLY
0
Entering edit mode
GCF_000196095n.fasta_2    GCF_001270975n.fasta_3470    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_001270945n.fasta_718    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_001270905n.fasta_1870    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_001270885n.fasta_614    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_001270825n.fasta_533    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_001270815n.fasta_2554    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_001006105n.fasta_866    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_000975195n.fasta_1323    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_000972045n.fasta_4282    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_000960685n.fasta_1698    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_000958595n.fasta_2383    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_000951795n.fasta_4194    100.00    1362    0    0    1    1362    1    1362    0.0    2516
ADD REPLY
0
Entering edit mode

output am expecting like this

GCF_000196095n.fasta_2    GCF_001270975n.fasta_3470    100.00    1362    0    0    1    1362    1    1362    0.0    2516
ADD REPLY
0
Entering edit mode

Caution: there is no 'best' alignment in your example, all alignments you show have equal score, identity, e-value etc. The first one is by no means the best. I don't know what you want to do with the output, but using only the first line is often not a good strategy.

ADD REPLY
0
Entering edit mode

Showing some sample data in your hand and how you are expecting the output file would help to figure it out and more importantly 'posting what you have tried so far is a good practice'.

ADD REPLY
0
Entering edit mode

input file

GCF_000196095n.fasta_2    GCF_001270975n.fasta_3470    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_001270945n.fasta_718    100.00    1362    0    0    1    1362    1    1362    0.0    2516
GCF_000196095n.fasta_2    GCF_001270905n.fasta_1870    100.00    1362    0    0    1    1362    1    1362    0.0    2516

then expected out put

GCF_000196095n.fasta_2    GCF_001270975n.fasta_3470    100.00    1362    0    0    1    1362    1    1362    0.0    2516
ADD REPLY
0
Entering edit mode

Do you need each of the line in different file? (Please edit your question instead of using comment box)

ADD REPLY
3
Entering edit mode
8.9 years ago
Michael 55k

you could have simply used head -1

ADD COMMENT
0
Entering edit mode
8.9 years ago
Eva_Maria ▴ 190

i got a awk comment like this

 awk 'NR==1' inputfile > outputfile

this ll work for my problem

ADD COMMENT
1
Entering edit mode

So, you want only the first line, and then discard the remaining lines? Or, do you want each of your 4000 lines in 4000 different files?

Edit: Never mind. If you got a solution, that's good enough!

ADD REPLY

Login before adding your answer.

Traffic: 2454 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6