uk.ac.ebi.intact.application.intSeq.business
Class CallingSrs

java.lang.Object
  |
  +--uk.ac.ebi.intact.application.intSeq.business.CallingSrs
All Implemented Interfaces:
CallingSrsIF

public class CallingSrs
extends java.lang.Object
implements CallingSrsIF

This class allows to retrieve AC and Description fields from the SRS engine, with the SPTr database. So, it executes first the Wgetz command to call SRS, with the user request. Results are record in a file. The first request returns a list of AC and Description. Afterwards, the second request returns one sequence which corresponds to an AC.

Version:
: $Id: CallingSrs.java,v 1.4 2003/11/14 15:06:43 skerrien Exp $
Author:
shuet (shuet@ebi.ac.uk)

Field Summary
protected  boolean matchWithIntactId
           
protected  java.lang.String proteinTopic
          protein feature which has been captured by the user
protected  ManagerFilesSrs resultWgetzQuery
           
protected  java.lang.String srsCommand
           
protected  boolean srsError
          the first idea is that there will be none error during the SRS running
protected  IntactUserI theUser
           
 
Constructor Summary
CallingSrs()
          constructor by default
CallingSrs(java.lang.String id)
          constructor which allows to check if the protein topic exists in IntAct.
CallingSrs(java.lang.String proteintopic, java.lang.String command)
          constructor which allows to call the SRS engine in case of lack of the request in IntAct
 
Method Summary
protected  void ExecFinalCommand(boolean acOrSeqRequest)
          This method decides which command will be executed (Wgetz or Getz) and put the file in the provided directory: to organize the numerous generated files into two separate directories.
 boolean GetBooleanIntactId()
          later, a method will allow to look for an IntAct entry from a protein topic (no SRS process in this case)
static long getId()
          Returns the unique id based on the current time; the ids are unique for a session.
 java.lang.String GetSequenceFasta()
          Wgetz execution + parsing of the WGETZ output file get the sequence one by one in a fasta format string because the SequenceSimilarityAction requires a protein sequence in a String format (don't forget that the Fasta Format is required)
 java.util.ArrayList RetrieveAccDes()
          Wgetz execution + parsing of the WGETZ output file
protected  void WebSrs(java.lang.String path)
          This method manages the execution of the Wgetz URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theUser

protected IntactUserI theUser

proteinTopic

protected java.lang.String proteinTopic
protein feature which has been captured by the user


srsCommand

protected java.lang.String srsCommand

srsError

protected boolean srsError
the first idea is that there will be none error during the SRS running


resultWgetzQuery

protected ManagerFilesSrs resultWgetzQuery

matchWithIntactId

protected boolean matchWithIntactId
Constructor Detail

CallingSrs

public CallingSrs()
constructor by default


CallingSrs

public CallingSrs(java.lang.String id)
constructor which allows to check if the protein topic exists in IntAct. (later)

Parameters:
id - String which represents a protein feature (protein reference or simply a word)

CallingSrs

public CallingSrs(java.lang.String proteintopic,
                  java.lang.String command)
constructor which allows to call the SRS engine in case of lack of the request in IntAct

Parameters:
proteintopic - String which represents a protein feature (protein reference or simply a word)
command - String the Wgetz command to make a request on SRS
Method Detail

getId

public static long getId()
Returns the unique id based on the current time; the ids are unique for a session.


GetBooleanIntactId

public boolean GetBooleanIntactId()
later, a method will allow to look for an IntAct entry from a protein topic (no SRS process in this case)

Specified by:
GetBooleanIntactId in interface CallingSrsIF
Returns:
the boolean answer.

RetrieveAccDes

public java.util.ArrayList RetrieveAccDes()
                                   throws IntactException
Wgetz execution + parsing of the WGETZ output file

Specified by:
RetrieveAccDes in interface CallingSrsIF
Returns:
a list of Accession Number and Description got from the SRS request
IntactException

GetSequenceFasta

public java.lang.String GetSequenceFasta()
                                  throws IntactException
Wgetz execution + parsing of the WGETZ output file get the sequence one by one in a fasta format string because the SequenceSimilarityAction requires a protein sequence in a String format (don't forget that the Fasta Format is required)

Specified by:
GetSequenceFasta in interface CallingSrsIF
Returns:
a list of Accession Number and Description got from the SRS request
IntactException

ExecFinalCommand

protected void ExecFinalCommand(boolean acOrSeqRequest)
                         throws IntactException
This method decides which command will be executed (Wgetz or Getz) and put the file in the provided directory: to organize the numerous generated files into two separate directories.

Parameters:
acOrSeqRequest - the boolean which will put the generated file in the good directory. true means that it is the AC-Description result file
IntactException

WebSrs

protected void WebSrs(java.lang.String path)
               throws IntactException
This method manages the execution of the Wgetz URL.

Parameters:
path - the string which will add the good extension for the temporary file of which name is rendered randomly.
IntactException


IntAct Project - EMBL-EBI 2004 - intact-help@ebi.ac.uk