This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Save A Mirbase Search Result Into A Fasta File

Hi every body

I need to save some search results from miRBase as a FASTA file .

I get the FASTA format html page ; but I don't know how to save it as a FASTA file

2 answers

If the HTML page store the FASTA sequence in a table you can easily scrap the html using R, for example. In the example below I grab the data about all the earthquake in the last 30 days.

library(XML)
eq <- readHTMLTable("http://www.iris.edu/seismon/last30.html")
# extract the second element of the list into a data.frame
eq <- eq[[2]]

Sorry for the irrelevance of the example but I could not find search result in miRBase that display fasta sequences...

You can also do that in Perl, Ruby, Python, Google Docs etc... Search Google for: scrape html table <your programming="" language="" here="">

Thank you so much ; And what's your idea to do the same in Perl ?

You are right , thank you

Do you mean the "Get sequence" button on the page for each entry? Look out for it. The result is actually already a text file, just save (right click, save link as) the result. The link is of the form: http://www.mirbase.org/cgi-bin/get_seq.pl?acc=MI0000223 You can also use wget or curl e.g. wget http://www.mirbase.org/cgi-bin/get_seq.pl?acc=MI0000223 should do it. That way you can also download multiple entries if you have the accessions.

Log in to answer this question.