Question: (Closed) from blast xml to fasta file with python
0
gravatar for bio90029
3 months ago by
bio9002910
bio9002910 wrote:

I had carried out a local blast, and an I got an xml file with all my sequence. At the present, I trying to covert the xml.file into a fasta.file using Biopython. My code for the file conversion is the one I post below:

SearchIO.convert(blast.xml', 'blast-xml', 'results.fasta','fasta')

However I get the error message that fasta is no supported. The purpose of converting the blast file into fasta is to produce a multi fasta file that I intend to use for a multiple sequence alignment.

I have run of ideas on how to convert this. Could anyone kindly guide through this please? Thanks a lot.

blast biopython python • 265 views
ADD COMMENTlink modified 12 weeks ago • written 3 months ago by bio9002910

The purpose of converting the blast file into fasta is to produce a multi fasta file that I intend to use for a multiple sequence alignment.

Do you want the query hits?

ADD REPLYlink written 3 months ago by st.ph.n1.9k

I just one the sequence in a fasta format so I can work with them.

ADD REPLYlink written 3 months ago by bio9002910

This is unclear. You have sequences that your put into your local blast command. From these sequences, based on the blast results, what criteria defines what you want to keep in a new fasta file for a MSA?

ADD REPLYlink written 3 months ago by st.ph.n1.9k

I don't think that the criteria is relevant for the question. As that criteria has been previously sort out, and in my new blast file I only have genes I am interested in. So instead of having a file with ~10000 genes, I have one with just ~2000 genes of interest in my new file. And the new file is the one i would like to convert to a fasta format.

ADD REPLYlink written 3 months ago by bio9002910

Yes, based on the blast results, you'll need to take the original query file, and parse out those sequences per query id.

ADD REPLYlink written 3 months ago by st.ph.n1.9k

It has been answered

ADD REPLYlink modified 12 weeks ago • written 12 weeks ago by bio9002910
1
gravatar for bio90029
12 weeks ago by
bio9002910
bio9002910 wrote:

The answer to my question is NO. It need to be parsed in order to get the fasta file.

ADD COMMENTlink modified 12 weeks ago • written 12 weeks ago by bio9002910

Yes, see my comment above.

ADD REPLYlink written 12 weeks ago by st.ph.n1.9k

You were not answering the question I asked. I asked a simple question if something could be done, I was not asking anything about parsing, and I wasn't interesting in parsing. I was asking if a blast file could be converted to a fasta file with the script I had or similar.

ADD REPLYlink written 12 weeks ago by bio9002910
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1010 users visited in the last hour