// TOOL annotate-reactome.bsh: "Associations to Reactome pathways" (Maps the given list of genes to pathways using the Reactome database. This service is provided by the EBI. NOTE! Supports only Affymetrix and UniProt identifiers.)
// INPUT input.tsv: input.tsv TYPE GENERIC 
// OUTPUT reactome.html: reactome.html 
// OUTPUT reactome.tsv: reactome.tsv 
// PARAMETER input.type: input.type TYPE [affyid: affyid, uniprot: uniprot] (What kind of identifiers input data contains)

import fi.csc.microarray.analyser.bsh.*;
import fi.csc.microarray.analyser.ws.*;
import fi.csc.microarray.analyser.ws.impl.*;


// query the web service
boolean alreadyUniprot = "uniprot".equals(jobInfo.parameters.get("input.type")); 
ResultTableCollector annotations = EnfinWsUtils.queryReactome(JavaJobUtils.getProbes(new File(jobInfo.workDir + "/input.tsv")), alreadyUniprot);

// create output files
File htmlFile = new File(jobInfo.workDir + "/reactome.html");
File textFile = new File(jobInfo.workDir + "/reactome.tsv");
EnfinWsUtils.writeReactomeResult(annotations, htmlFile, textFile, alreadyUniprot);
