// TOOL annotate-intact.bsh: "Protein interactions from IntAct" (Maps the given list of genes to protein interactions using the IntAct database. This service is provided by the EBI. NOTE! Supports only Affymetrix and UniProt identifiers.)
// INPUT input.tsv: input.tsv TYPE GENERIC 
// OUTPUT intact.html: intact.html 
// OUTPUT intact.tsv: intact.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.queryIntact(JavaJobUtils.getProbes(new File(jobInfo.workDir + "/input.tsv")), alreadyUniprot);

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