It works now... Thanks.
I know this question has been asked and also answered but it didn't work for me, so...
Basically, I blast a nucleotide sequence against nr database on NCBI website (I also specify the organism). Now, I would like to extract hit (subject) sequences in fasta so I can align them later.
I tried parsing the XML file with Pierre's blast2fasta stylesheet but got numerous errors.
Could someone point me to an alternative way to parse XML alignment file or another way of extracting subject hits following blast.
Thanks, TP
2 answers
you have downloaded a web page, not the 'raw' stylesheet itself : https://raw.githubusercontent.com/lindenb/xslt-sandbox/master/stylesheets/bio/ncbi/blast2fasta.xsl
...
How are your Perl skills? I have done this by using the "Bio" package of Bioperl
https://metacpan.org/pod/distribution/BioPerl/BioPerl.pm
To set blast parameters --> use Bio::Seq;
To run a remote blast search --> use Bio::Tools::Run::RemoteBlast;
To parse the blast report --> use Bio::SearchIO;
To retrieve the hit sequences --> use Bio::DB::GenBank;
Of course, if you know how to download the BLAST report in the correct format direct from the website...then just use the last 2 (Bio::SearchIO; and Bio::DB::GenBank;)
My Perl skills are non-existant, but I thanks anyway, I can still try and run it.
Log in to answer this question.
which errors ?
For example:
And so on. I downloaded XML file after running blastn and then used