I'm working on the C. elegans model organism, for which there exists an online biological information database: Wormbase.
I'm able to manually search for a transcript (say "K06C4.12") and this gets me the following URL: http://www.wormbase.org/species/c_elegans/cds/K06C4.12
Say I have this transcript ID: "F08G2.2". I guess that I can form a valid similar URL, as follows: http://www.wormbase.org/species/c_elegans/cds/F08G2.2
Indeed, it works as expected.
Now, I would like to go further and be able to download in an automated way what can be obtained by clicking on one of the "download" buttons in the "Sequence" section of the above pages. More specifically, I'm interested in the "spliced + UTR" and "conceptual translation" fasta sequences.
If I use the DOM inspector in Firefox (Shift-Ctrl-C), I can locate things like the following:
<div class="button ui-corner-all generate-file-download sequence-download">
<span class="ui-icon ui-icon-arrowthickstop-1-s"></span>
<span>download</span>
<div id="content" class="ui-helper-hidden">
>K06C4.12 spliced + UTR
ATGGCCCCACCAAAGCCGTCTGCTAAAGGAGCAAAGAAAGCCGCCAAGACCGTCACCAAGCCAAAGGACGGAAAGAAGAG
ACGTCATGCCCGTAAAGAATCCTACTCCGTGTACATCTACCGTGTGCTCAAGCAGGTTCATCCAGACACTGGAGTCTCTT
CCAAGGCTATGTCCATCATGAACTCTTTCGTCAACGACGTCTTCGAGCGTATCGCTGCTGAGGCATCTCGTCTTGCTCAC
TACAACAAGAGATCCACCATCTCTTCTCGCGAAATTCAAACTGCCGTCCGTTTGATTCTTCCAGGAGAGCTTGCCAAGCA
CGCCGTCTCTGAGGGAACCAAGGCTGTCACCAAGTACACCTCTAGCAAGTAA
</div>
<div id="filename" class="ui-helper-hidden">K06C4.12conceptual translation.fasta</div>
<div id="content" class="ui-helper-hidden">
>conceptual translation
MAPPKPSAKGAKKAAKTVTKPKDGKKRRHARKESYSVYIYRVLKQVHPDTGVSSKAMSIMNSFVNDVFERIAAEASRLAH
YNKRSTISSREIQTAVRLILPGELAKHAVSEGTKAVTKYTSSK*
</div>
</div>
<div class="toggle ">
<span style="float:left" class="ui-icon ui-icon-triangle-1-s"></span>
view conceptual translation (123 aa)
</div>
<div class="returned sequence-container" style="display:block">
>conceptual translation
<br>
MAPPKPSAKGAKKAAKTVTKPKDGKKRRHARKESYSVYIYRVLKQVHPDTGVSSKAMSIMNSFVNDVFERIAAEASRLAH
<br>
YNKRSTISSREIQTAVRLILPGELAKHAVSEGTKAVTKYTSSK*
</div>
I don't find these if I simply download the page with wget
and search in the source code, so they must be dynamically generated.
How could I proceed to get the sequences?
The documentation about Wormbases's REST API is not very detailed, so I don't understand how to form an URL that would give me the desired sequences.