Skip to content

Commit

Permalink
Updates neccessary for new InterPro Scan version 5 SOAP API
Browse files Browse the repository at this point in the history
git-svn-id: svn://rarepos.cs.uni-tuebingen.de/tfpredict@100 71221333-9ef9-431f-bb7f-117e0a61b720
  • Loading branch information
mroemer committed Apr 23, 2015
1 parent d35d9f5 commit 659d2d5
Show file tree
Hide file tree
Showing 19 changed files with 1,524 additions and 24 deletions.
Binary file added lib/IPRScan5_Axis1.jar
Binary file not shown.
Binary file removed lib/IPRScan_JAXWS.jar
Binary file not shown.
Binary file added lib/ebiws-lib/activation-1.1.1.jar
Binary file not shown.
Binary file added lib/ebiws-lib/axis-1.4.jar
Binary file not shown.
Binary file added lib/ebiws-lib/axis-jaxrpc-1.4.jar
Binary file not shown.
Binary file added lib/ebiws-lib/axis-saaj-1.4.jar
Binary file not shown.
Binary file added lib/ebiws-lib/axis-wsdl4j-1.5.1.jar
Binary file not shown.
File renamed without changes.
Binary file added lib/ebiws-lib/commons-codec-1.2.jar
Binary file not shown.
Binary file added lib/ebiws-lib/commons-discovery-0.2.jar
Binary file not shown.
Binary file added lib/ebiws-lib/commons-httpclient-3.1.jar
Binary file not shown.
Binary file added lib/ebiws-lib/commons-logging-1.0.4.jar
Binary file not shown.
Binary file added lib/ebiws-lib/mail-1.4.1.jar
Binary file not shown.
880 changes: 880 additions & 0 deletions src/ipr/AbstractWsToolClient.java

Large diffs are not rendered by default.

625 changes: 625 additions & 0 deletions src/ipr/IPRScan5Client.java

Large diffs are not rendered by default.

23 changes: 8 additions & 15 deletions src/ipr/IPRextract.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ public static Map<String, IprEntry> getSeq2DomainMap(List<String[]> IPRoutput, B
Map<String, IprEntry> seq2domain = new HashMap<String, IprEntry>();

for (int i=0; i < IPRoutput.size(); i++) {

String[] domain_entry = IPRoutput.get(i);
if (domain_entry.length < 12) continue;
String sequence_id = domain_entry[0].trim();
String domain_id = domain_entry[11].trim();
int domain_start = Integer.parseInt(domain_entry[6]);
int domain_end = Integer.parseInt(domain_entry[7]);
int curr_domain_length = domain_end - domain_start + 1;

String domain_interval = domain_id + " " + domain_start + "\t" + domain_end;

// skip domains for which no InterPro-ID is given
if (domain_id.equals("NULL")) {
continue;
System.out.println("WARNING: Skipped domain " + domain_id + " with missing InterPro-ID");
continue;
}

IprEntry curr_entry;
Expand Down Expand Up @@ -146,11 +146,11 @@ public static Map<String, IprRaw> parseIPRoutput(List<String[]> IPRoutput) {

String[] domain_entry = IPRoutput.get(i);

if (domain_entry.length < 13) {
continue;
}
String domain_id = domain_entry[11].trim();
// skip domains for which no InterPro-ID is given
if (domain_id.equals("NULL")) {
continue;
}
// skip domain IDs which were already added
if (ipr_domains.containsKey(domain_id)) {
continue;
Expand All @@ -174,15 +174,8 @@ public static Map<String, IprRaw> parseIPRoutput(List<String[]> IPRoutput) {

// parse GO terms for current InterPro domain entry
domain_GOterms = new ArrayList<String>();
for (String go_entry : domain_go.split(",")) {

if (go_entry.contains("GO:")) {
int start_pos = go_entry.indexOf("(GO:")+1;
int end_pos = go_entry.indexOf(")", start_pos);

go_entry = go_entry.substring(start_pos, end_pos);
domain_GOterms.add(go_entry);
}
for (String go_entry : domain_go.split("\\|")) {
domain_GOterms.add(go_entry);
}
}
IprRaw ipr_domain = new IprRaw(domain_id, domain_names, domain_GOterms);
Expand Down
16 changes: 9 additions & 7 deletions src/ipr/IPRrun.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

import javax.xml.rpc.ServiceException;

import uk.ac.ebi.webservices.jaxws.IPRScanClient;
import uk.ac.ebi.webservices.axis1.stubs.iprscan5.WsResultType;

/**
*
Expand All @@ -54,7 +54,7 @@
*/
public class IPRrun {

public static boolean addSpacerLine = true;
public static boolean addSpacerLine = false;

// fixes bug in current version of InterProScan which removes first line of sequence if header is given
private static void addSpacerLine(String seqfile) {
Expand Down Expand Up @@ -134,7 +134,7 @@ public ArrayList<String[]> run(String seqfile, String iprpath, String basedir, b

// submit job
try {
IPRScanClient.main(param);
IPRScan5Client.main(param);
} catch (Exception e) { }

// restore System.exit
Expand All @@ -146,14 +146,15 @@ public ArrayList<String[]> run(String seqfile, String iprpath, String basedir, b
// restore System.out
System.setOut(orig_stdout);

IPRScanClient webIPR = new IPRScanClient();
IPRScan5Client webIPR = new IPRScan5Client();

if (!silent) System.out.println("Waiting for " + jobs.size() + " job(s) to finish ...");
for (String jobid : jobs) {
if (!silent) System.out.println("Polling job \"" + jobid + "\" ...");
try {
webIPR.getResults(jobid, basedir + jobid, "out");
webIPR.getResults(jobid, basedir + jobid, "visual-png");
new File(basedir).mkdirs();
webIPR.getResults(jobid, basedir + jobid, "tsv");
webIPR.getResults(jobid, basedir + jobid, "svg");
} catch (IOException e) {
e.printStackTrace();
} catch (ServiceException e) {
Expand All @@ -166,6 +167,7 @@ public ArrayList<String[]> run(String seqfile, String iprpath, String basedir, b
if (silent) {
System.setErr(orig_stderr);
}

IPRoutput = readIPROutput(basedir, jobs);

} else { // local
Expand Down Expand Up @@ -199,7 +201,7 @@ private static ArrayList<String[]> readIPROutput(String basedir, ArrayList<Strin

for (String job : jobs) {
try {
BufferedReader br = new BufferedReader(new FileReader(basedir+job+".out.txt"));
BufferedReader br = new BufferedReader(new FileReader(basedir+job+".tsv.txt"));
while ((line = br.readLine()) != null) {
String[] tabpos = line.split("\t");
String seqID = tabpos[0].trim();
Expand Down
2 changes: 1 addition & 1 deletion src/main/TFpredictMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class TFpredictMain {
private static boolean trainMode = false;

private static final String[] validClassifiers = new String[] {"SVM_linear", "KNN", "NaiveBayes"};
private static final String version = "1.2";
private static final String version = "1.3";

public static final String sabineSpeciesList = "organism_list.txt";
public static final String classMappingFile = "class_mapping.txt";
Expand Down
2 changes: 1 addition & 1 deletion src/modes/Predict.java
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ private void writeHTMLoutput() {
if (!seq2job.isEmpty() && seq2job.containsKey(seq)) {
String job = seq2job.get(seq);
bw.write("<table>\n");
bw.write(" <tr><th> <img src=\"" + job + ".visual-png.png\"/>" + "</th></tr>\n");
bw.write(" <tr><th> <img src=\"" + job + ".svg.svg\"/>" + "</th></tr>\n");
bw.write(" <tr><th> Illustration generated by <a href=https://www.ebi.ac.uk/Tools/services/web/toolresult.ebi?jobId="+job+"&tool=iprscan&analysis=visual target=\"_blank\"> InterProScan </a> </th></tr>\n");
bw.write("</table>\n\n");
bw.write("<br>\n\n");
Expand Down

0 comments on commit 659d2d5

Please sign in to comment.