4. Usage
|
Sierra is a standard web service. You can take advantage of it in any language
that provides web service libraries. To assist users, we have supplied examples
in Java and Perl. Choose the language that interests you, then download and
extract the contents. Each language bundle has included instructions on how to use
the contents.
For almost all users, this will be as simple as just running the code.
Sierra should work for you right out of the box!
- Java bundle (version 0.9.5)
- Perl bundle (version 0.9.5)
For those that would rather use another language, you can find the
WSDL underlying the service
here. We hope to make a C# client available soon, for those that use
the .NET environment.
As of version 0.9.5, Sierra exposes two methods:
processSequence: The method expects as input arguments two strings: your authorization key and a nucleic acid sequence. The sequence should be nucleic acids only and can only contain the characters A-Z and a-z (i.e., no titles etc. should be included in this argument).
Sierra will return an XML document containing the result of processing the sequence. In the event that there is some error (e.g., invalid key, invalid sequence, etc.), an error document will be returned. An example of an error document is:
<?xml version="1.0" standalone="yes"?>
<Stanford_Algorithm_Interpretation>
<algorithmVersion>java-beta-0.9.1</algorithmVersion>
<webServiceVersion>beta-0.9.2</webServiceVersion>
<failure>
<errorMessage>Invalid key.</errorMessage>
</failure>
</Stanford_Algorithm_Interpretation>
If the sequence is acceptably processed, the returned document
looks like this.
processSequences: Version 0.9.5 of Sierra exposes the processSequences method that allows you to process multiple nucleic acid sequences in a single call to the webservice. In addition to this, you can specify the type of report you want Sierra to return. A Simple Report contains output similar to the previous versions of Sierra while a Detailed Report is a verbose report containing all the information required to recreate the result generated by the web-based HIVdb program.
processSequences expects as input arguments three parameters: your authorization key, the type of report you need (0 for simple, 1 for detailed) and a string array containing nucleic acid sequences. Each sequence should be nucleic acids only and should be specified in the FASTA format (i.e. you can provide an optional identifier with each sequence string).
The result of calling processSequences looks like this. Note that the xml results have an associated XSL stylesheet. Opening the detailed report xml file in a browser will display the results in a format similar to the web-based HIVdb program. If you would like to design your own custom stylesheet, you can download and modify the Sierra stylesheet located here.
|