[[TracNav(xQTL)]] = [wiki:xQTL xQTL workbench] - Cheat sheet for R scripting = === Get a parameter from server === `size <- getparameter("size",jobparams)` === Do a status update === `report(2,"Loading 5%...")` === Get a simple overview of all data matrices === `find.data()[,c("id","name")]` === Download a data matrix === `dataId <- 0`[[BR]] `data <- downloadmatrixascsvCURL(dataId)` === Upload a completely new data matrix, including annotations === `invId <- 0`[[BR]] `data <- NULL`[[BR]] `data <- rbind(data, c("A", "B"))`[[BR]] `data <- rbind(data, c("B", "A"))`[[BR]] `marker1 = add.marker(name="myMarker1", cm="10.0", investigation_id=invId)`[[BR]] `marker2 = add.marker(name="myMarker2", cm="20.0", investigation_id=invId)`[[BR]] `ind1 = add.individual(name="myInd1", investigation_id=invId)`[[BR]] `ind2 = add.individual(name="myInd2", investigation_id=invId)`[[BR]] `colnames(data) <- c("myInd1", "myInd2")`[[BR]] `rownames(data) <- c("myMarker1", "myMarker2")`[[BR]] `add.datamatrix(data, name="myResults", investigation_id=invId, rowtype="Marker", coltype="Individual", valuetype="Text")`[[BR]] === Upload a file === `uri <- paste(dbpath,"/uploadfile",sep="")`[[BR]] `path <- "testimage.png"`[[BR]] `postForm(uri,investigation_name=investigationname, name="my_image", type="InvestigationFile", file=fileUpload(filename=path), style='HTTPPOST')`