Convert Tblastn result in .txt to .fasta
2
0
Entering edit mode
6.1 years ago
jaqx008 ▴ 110

Hey Guys, I was wondering if there is a command I can run to help generate a .fasta file from the .txt output I generated from tblastn. Or how is this done?

Thanks

fasta Tblastn Blast • 3.2k views
ADD COMMENT
0
Entering edit mode

A fasta file containing what? Query sequences? Subject sequences? Matched subject sequences?

ADD REPLY
0
Entering edit mode

a .txt file containing tblastn results is the input

ADD REPLY
0
Entering edit mode

we understand that, but what do you want to see end up in the fasta file?

ADD REPLY
0
Entering edit mode

If you run your blast and request tab output format as such: -outfmt '6 std qseq sseq' you will get the sequence back as separate fields in the tabulated files, which then can be easily parsed out. Then you're already half way ;)

As far as I know there does not exist an off-the-shelf tool to get this. It will require some ad hoc scripting I'm afraid

ADD REPLY
0
Entering edit mode

My professor gave me a perl script that can do this. I will try and see then let y'all know.

ADD REPLY
0
Entering edit mode

Please whats wrong with this command. Trying to use the perl script but its not working.

% perlscripttblastn2GFF.Blast2gff.pl --Ago1Drosophila.txt --out
perl    (wd: ~/Desktop/oyster)

I am in a different directory, why does it keep saying wd:~/Desktop/oyster

ADD REPLY
0
Entering edit mode

open the script in a text editor (or do cat or more or so on cdmline) and check whether that path is not hard-coded (== it is literally written in the script) in the script.

ADD REPLY
0
Entering edit mode

you mean this?

#!/usr/local/bin/perl -w
ADD REPLY
0
Entering edit mode

can you paste you cmdline using the code tag formatting?

is this perl (wd: ~/Desktop/oyster) part of your cmdline?

you could also do a grep with "Desktop/oyster" on that perl script to check is it is anyway mentioned in it.

ADD REPLY
0
Entering edit mode

No it is not part of my command line.

ADD REPLY
0
Entering edit mode

How can we know what is wrong, if we don't know the script? You should ask your professor how to use it, if he wrote it. Or, if you post the script somewhere (here if short, or pastebin if long), then we can have a look at it. But it difficult, and take lots of back-and-forth, to troubleshoot programs without having access to them.

ADD REPLY
0
Entering edit mode

% blast2gff.pl --blast_result_file [blast result file] --reference_sequence_file [file with reference sequences (optional)] --gff_output_file [gff file name (optional)]

the command is found on this link. https://metacpan.org/pod/distribution/GBrowse/contrib/blast2gff.pl

ADD REPLY
0
Entering edit mode

I am doing

% B.pl --tblasnresult.txt

ADD REPLY
0
Entering edit mode

looking at the script name it will anyway only produce a GFF format of the blast output and will not give you a fasta file in one go. You'll need to create the fasta file from the gff file in a second step.

ADD REPLY
0
Entering edit mode

Yes I plan to first generate the GFF then use this make a .bed then get faster from it., let me try the above as you said.

ADD REPLY
0
Entering edit mode

There is no reason to go over a bed intermediate if you want to end up with fasta output. There are tools around that will create you a fasta file based on a GFF input file

ADD REPLY
0
Entering edit mode

THanks a lot. it worked well with perl in front of the command. Thanks again Lieven.

ADD REPLY
0
Entering edit mode
6.1 years ago

you need to run the script as such:

perl blast2gff.pl --blast_result_file Ago1Drosophila.txt --gff_output_file out

so type the parameter name followed by a space and then the file-name you want to process (don't do --filename ! )

ADD COMMENT

Login before adding your answer.

Traffic: 1781 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