Changeset 4089


Ignore:
Timestamp:
Dec 22, 2010, 12:34:38 PM (12 years ago)
Author:
olle
Message:

Refs #668. Refs #287. Support for running msInspect feature detection from Proteios SE updated to allow user selected strategy option:

  1. Class/file action/file/UseSpectrumFileForMsInspectSearchExtension.java in client/servlet/ updated by adding a menu select box for selecting a strategy option. The option string parameter is coupled to new valid parameter VString RunMsInspect.VMSINSPECTSTRATEGY. The default option is marked "default", and corresponds to no strategy option being used.
  1. Class/file action/msInspect/RunMsInspect.java in client/servlet/ updated to retrieve the string from new valid parameter VString VMSINSPECTSTRATEGY and transferring it as a job parameter to plug-in class RunMsInspectPlugin.
  1. Class/file plugins/RunMsInspectPlugin.java in plugin/ updated to retrieve the strategy string from the job parameter. If the string is null or an empty string (corresponding to the default option), no changes are made to the msInspect command line. Otherwise, the retrieved string is used as value for an extra option --strategy=value in the msInspect command line.
  1. English dictionary file locale/en/dictionary in client/servlet/ updated with new string key.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/locale/en/dictionary

    r4082 r4089  
    425425MsInspect=msInspect
    426426MsInspectFeatureDetection=msInspect Feature Detection
     427MsInspectStrategySelect=Strategy
    427428MwInDaltons=Molecular weight (Da)
    428429MyFiles=My Files
  • trunk/client/servlet/src/org/proteios/action/file/UseSpectrumFileForMsInspectSearchExtension.java

    r4082 r4089  
    3636import org.proteios.gui.form.Form;
    3737import org.proteios.gui.form.FormFactory;
     38import org.proteios.gui.form.Option;
     39import org.proteios.gui.form.Select;
    3840import org.proteios.gui.layout.RowLayout;
    3941
    4042import se.lu.thep.waf.ActionException;
    4143import se.lu.thep.waf.constraints.InvalidParameterValue;
     44import se.lu.thep.waf.constraints.VString;
    4245
    4346import java.util.ArrayList;
     
    129132    Fieldset fs = new Fieldset("MsInspect");
    130133    form.addFieldset(fs);
     134    // Select box variables
     135    VString validStringParam = null;
     136    List<Option> optionList = null;
     137    String selected = null;
     138    // Add strategy menu
     139    validStringParam = RunMsInspect.VMSINSPECTSTRATEGY;
     140    optionList = new ArrayList<Option>();
     141    optionList.add(new Option("", "default"));
     142    optionList.add(new Option("BaseFeatureStrategy", "BaseFeatureStrategy"));
     143    optionList.add(new Option("BaseFeatureStrategyModular", "BaseFeatureStrategyModular"));
     144    optionList.add(new Option("FeatureStrategy", "FeatureStrategy"));
     145    optionList.add(new Option("FeatureStrategyPeakClusters", "FeatureStrategyPeakClusters"));
     146    optionList.add(new Option("FeatureStrategyPeakClustersNegCharge", "FeatureStrategyPeakClustersNegCharge"));
     147    optionList.add(new Option("FeatureStrategySmallMolecule", "FeatureStrategySmallMolecule"));
     148    optionList.add(new Option("FeatureStrategySmallMoleculeNeg", "FeatureStrategySmallMoleculeNeg"));
     149    optionList.add(new Option("FeatureStrategyWindow", "FeatureStrategyWindow"));
     150    selected = new String("");
     151    Select<VString> strategySelectBox = new Select<VString>(validStringParam, optionList);
     152    strategySelectBox.selectOption(selected);
     153    strategySelectBox.setLabel("MsInspectStrategySelect");
     154    strategySelectBox.setHelp("Note: The installed version of msInspect might not support all strategy options");
     155    fs.add(strategySelectBox);
    131156    /*
    132157     * Add the tool bar with 'Next' button(s) to the form.
  • trunk/client/servlet/src/org/proteios/action/msInspect/RunMsInspect.java

    r4082 r4089  
    5353import se.lu.thep.waf.constraints.VBoolean;
    5454import se.lu.thep.waf.constraints.VInteger;
     55import se.lu.thep.waf.constraints.VString;
    5556
    5657
     
    6667  public static final VBoolean VMSINSPECTUSEWEBINTERFACEFLAG = new VBoolean(
    6768      "active.msinspectusewebinterfaceflag", false);
     69  public static final VString VMSINSPECTSTRATEGY = new VString(
     70      "active.msinspectstrategy", 0, 255, false);
    6871 
    6972  @Override
     
    118121    log.debug("tmpDir = \"" + tmpDir + "\"");
    119122    log.debug("uploadOutputFileFlag = " + uploadOutputFileFlag);
     123    // Get the msInspect parameters to use for the feature detection
     124    String strategy = getValidString(VMSINSPECTSTRATEGY);
     125    log.debug("strategy = \"" + strategy + "\"");
    120126    /***********************************************************************
    121127     * Get MsInspect feature detection plugin definition
     
    203209        Project.class, null);
    204210      job.setParameterValue("project", projectParam, activeProject);
     211      //
     212      StringParameterType strategyParam = new StringParameterType();
     213      job.setParameterValue("strategy", strategyParam, strategy);
    205214      //
    206215      dc.saveItem(job);
  • trunk/plugin/src/org/proteios/plugins/RunMsInspectPlugin.java

    r4088 r4089  
    329329    Boolean uploadOutputFileFlag;
    330330    String timeStampStr;
     331    String strategy;
    331332
    332333    msInspectInstallPath = (String) job.getValue("msInspectInstallPath");
     
    338339    uploadOutputFileFlag = (Boolean) job.getValue("uploadOutputFileFlag");
    339340    timeStampStr = (String) job.getValue("timeStampStr");
     341    strategy = (String) job.getValue("strategy");
    340342
    341343    // Perform msInspect feature detection using local search engine
    342344    msInspectSearchLocal(request, response, progress, tmpDir,
    343345      msInspectInstallPath, msInspectProgramName, msInspectMemoryInMegaBytes,
    344       spectrumFileId, dirId, uploadOutputFileFlag, timeStampStr);
     346      spectrumFileId, dirId, uploadOutputFileFlag, timeStampStr, strategy);
    345347    done();
    346348  }
     
    384386   * @param uploadOutputFileFlag Boolean The upload output file flag
    385387   * @param timeStampStr String Time stamp string in YYYY_MM_DD_hh_mm_ss format
     388   * @param strategy String Strategy algorithm option for the feature detection
    386389   */
    387390  private void msInspectSearchLocal(Request request, Response response,
     
    389392      String msInspectInstallPath, String msInspectProgramName, Integer msInspectMemoryInMegaBytes,
    390393      Integer spectrumFileId, Integer dirId,
    391       Boolean uploadOutputFileFlag, String timeStampStr)
     394      Boolean uploadOutputFileFlag, String timeStampStr, String strategy)
    392395  {
    393396    log.debug("msInspectInstallPath = \"" + msInspectInstallPath + "\"");
     
    399402    log.debug("uploadOutputFileFlag = " + uploadOutputFileFlag);
    400403    log.debug("timeStampStr = \"" + timeStampStr + "\"");
     404    log.debug("strategy = \"" + strategy + "\"");
    401405    // Create msInspect program path
    402406    String delimiter = "/";
     
    485489      cmdList.add(msInspectProgramPath);
    486490      cmdList.add("--findpeptides");
     491      if (strategy != null && !strategy.equals(""))
     492      {
     493        // Add strategy algorithm option
     494        String strategyOption = new String("--strategy=" + strategy);
     495        cmdList.add(strategyOption);
     496      }
    487497      cmdList.add("--outdir=" + msInspectOutputDirPath);
    488498      cmdList.add(spectrumFileTmp.getPath());
Note: See TracChangeset for help on using the changeset viewer.