Thank you so much ; And what's your idea to do the same in Perl ?
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="">
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.
Thanks for helping
Log in to answer this question.
what is a "search reason" ?
probably search results