Yes, see my comment above.
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.
1 answer
The answer to my question is NO. It need to be parsed in order to get the fasta file.
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.
Log in to answer this question.
Do you want the query hits?
I just one the sequence in a fasta format so I can work with them.
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?
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.
Yes, based on the blast results, you'll need to take the original query file, and parse out those sequences per query id.
It has been answered
Try https://github.com/Amit-Harita/blastxmltofasta.git