Created
January 15, 2009 14:44
-
-
Save olas/47421 to your computer and use it in GitHub Desktop.
Predict drug susceptibility for HIV mutant using XMPP service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Script to predict the susceptibility of an HIV protease sequence for seven | |
* drugs based on the proteochemometric model described in: | |
* Lapins M, Eklund M, Spjuth O, Prusis P, Wikberg JE. | |
* Proteochemometric modeling of HIV protease susceptibility, | |
* BMC Bioinformatics. 2008 Apr 10;9:181. . | |
* | |
* Script accepts a 99 aa sequence as input and delivers susceptbiliy values | |
* for the drugs Amprenavir, Atazanavir, Indinavir, Lopinavir, Nelfinavir, | |
* Ritonavir, and Saquinavir. | |
* | |
* Script author: Ola Spjuth <ola.spjuth@farmbio.uu.se> | |
* | |
******************************************************************************/ | |
//Define input sequence and XMPP service and -function | |
var seq="PQITLWQRPIVTIKIGGQLREALLDTGADNTVLEEMNLPGRWKPKMIVGIGGFIKVRQYDQILIEICGHKAIGTVLVGPTPVNIIGRDLLTQIGCTLNF"; | |
var predictionServer="hivpred.ws1.bmc.uu.se"; | |
var predictionFunction="predictSusceptibility"; | |
//Connect if not connected (requires JID and password in preferences) | |
if (!(xmpp.isConnected())) | |
xmpp.connect(); | |
//Set up function | |
var func = xmpp.getFunction(predictionServer, predictionFunction); | |
var iof; | |
if (xmpp.existsIoFactory(func)) //Check if binding exists | |
iof=xmpp.getIoFactory(func); //Try to load generated binding | |
if (iof==null){ | |
var ios = func.getIoSchemataSync(20000); //Get schema from service | |
iof = xmpp.getIoFactory(ios); //Generate binding | |
} | |
//Create input document | |
var inputDoc=iof.createHIVPredInputDocument(); | |
var inputObject = inputDoc.addNewHIVPredInput(); | |
inputObject.setSequence(seq); | |
//Invoke service on document | |
var result = func.invokeSync(inputDoc, 20000); | |
//Handle results | |
var resultDoc = iof.getOutputObject(result); | |
js.print("Predicted susceptibility:\n\n " + resultDoc.toString()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment