Changeset 3379


Ignore:
Timestamp:
Jul 22, 2009, 1:28:32 PM (14 years ago)
Author:
olle
Message:

Refs #591. Refs #471. Refs #490. First version of support for
performing OMSSA search for input mzData files by using data
converted to MGF (Mascot Generic Format):

  1. OMSSA search properties template file conf/omssa.properties.in

in client/servlet/ updated with new parameters
omssa.web.convert.mzdata_to_mgf and omssa.local.convert.mzdata_to_mgf,
indicating if mzData data converted to MGF should be used for
OMSSA search. Valid values are "true" and "false", although
the software may be lenient and accept other alternatives.

  1. Class/file action/omssa/SearchOMSSA.java in client/servlet/

updated:

  1. New private static constant

Job.ExecutionTime ESTIMATED_EXECUTION_TIME added,
set to Job.ExecutionTime.SHORT.

  1. Protected method void runMe() updated by obtaining the values

of new configuration parameters omssa.web.convert.mzdata_to_mgf
and omssa.local.convert.mzdata_to_mgf from configuration file
omssa.properties, and the relevant one is used as value for
new variable Boolean convertMzDataToMgfFlag.
If input spectrum file should be converted before OMSSA search,
a conversion job is created, if the needed converted file does
not already exist. If a conversion job is created, it is set as
blocker for the created search job. The value of variable
Boolean convertMzDataToMgfFlag is transferred to the created
search job via job parameters.

  1. New private method

boolean convertedMzDataToMgfFileExists(DbControl dc, File spectrumFile)
added. It calls new private method
File fetchConvertedMzDataToMgfFile(DbControl dc, File spectrumFile)
to check if a converted mzData to MGF file exists.

  1. New private method

File fetchConvertedMzDataToMgfFile(DbControl dc, File spectrumFile)
added. It fetches the converted mzData to MGF file.

  1. New private method

Job createMzDataToMgfConvertJob(DbControl dc, File spectrumFile)
added. It creates an mzData file to MGF file conversion job.
The conversion job is set to the same estimated execution time
ESTIMATED_EXECUTION_TIME as the search job.

  1. Class/file plugins/SearchOMSSAPlugin.java in plugin/ updated:
  2. Private method

void execute(Request request, Response response, ProgressReporter progress)
updated by obtaining the value of variable
Boolean convertMzDataToMgfFlag from job parameters.
The value is transferred to private methods
void omssaSearchViaWebInterface(Request request, ...) and
void omssaSearchLocal(Request request, ...) via new arguments.

  1. Private method

void omssaSearchViaWebInterface(Request request, ...) updated
with new argument Boolean convertMzDataToMgfFlag.
If mzData data converted to MGF should be used for search,
the spectrum file is obtained by calling new private method
File fetchConvertedMzDataToMgfFile(DbControl dc, File spectrumFile),
and a note reporting that converted data is used for search is
added to the job message string.

  1. Private method

void omssaSearchLocal(Request request, ...) updated
with new argument Boolean convertMzDataToMgfFlag. If mzData data
converted to MGF should be used for search, the spectrum file is
obtained by calling new private method
File fetchConvertedMzDataToMgfFile(DbControl dc, File spectrumFile),
and a note reporting that converted data is used for search is
added to the job message string. When spectrum file data is copied
to a temporary local file to be used for the OMSSA search, the file
is given the same name as the original input spectrum file, even
if converted data from another file is copied.

  1. New private method

File fetchConvertedMzDataToMgfFile(DbControl dc, File spectrumFile)
added. It fetches the converted mzData to MGF file.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/conf/omssa.properties.in

    r2935 r3379  
    4040# omssa.web.server.timediff.hours = 0
    4141# omssa.web.server.timediff.correction.minutes = 0
     42# omssa.web.convert.mzdata_to_mgf = true
    4243#
    4344# Notes:
     
    7677# omssa.web.server.timediff.correction.minutes = 2
    7778#
     79# omssa.web.convert.mzdata_to_mgf is a flag variable,
     80# indicating if an mzData input file should be converted
     81# to an MGF file before an OMSSA search is performed.
     82# If set to `true`, the created MGF file will be placed
     83# in the same Proteios directory as the input mzData file.
     84# The OMSSA result file will refer to the original mzData
     85# file as the input file.
     86#
     87# omssa.web.convert.mzdata_to_mgf = true
     88#
    7889omssa.web.server.url = http://pubchem.ncbi.nlm.nih.gov
    7990omssa.web.script.path = /omssa/omssacgi.cgi
     
    8293omssa.web.server.timediff.hours = -9
    8394omssa.web.server.timediff.correction.minutes = 0
     95omssa.web.convert.mzdata_to_mgf = true
    8496#
    8597# Settings for OMSSA local installation - required
     
    93105omssa.local.database.directory.path = /omssa-2.1.4.linux/db
    94106omssa.local.input.basename = omssa_input.xml
     107omssa.local.convert.mzdata_to_mgf = true
    95108
  • trunk/client/servlet/src/org/proteios/action/omssa/SearchOMSSA.java

    r3288 r3379  
    3535import org.proteios.core.Directory;
    3636import org.proteios.core.File;
     37import org.proteios.core.FileParameterType;
     38import org.proteios.core.FileType;
    3739import org.proteios.core.IntegerParameterType;
    3840import org.proteios.core.ItemFactory;
     
    4042import org.proteios.core.ItemParameterType;
    4143import org.proteios.core.Job;
     44import org.proteios.core.Path;
    4245import org.proteios.core.PluginDefinition;
    4346import org.proteios.core.Project;
     
    7578  public static final VBoolean VSAVEASOMSSAPARAMETERSETFLAG = new VBoolean(
    7679    "saveAsOMSSAParameterSetFlag", false);
     80
     81  // Set estimated execution time to next fastest, SHORT
     82  private static final Job.ExecutionTime ESTIMATED_EXECUTION_TIME = Job.ExecutionTime.SHORT;
    7783 
    7884  /**
     
    131137    //String omssaWebServerTimediffCorrectionMinutes = "0";
    132138    String omssaWebServerTimediffCorrectionMinutes = pf.getProperty("omssa.web.server.timediff.correction.minutes");
     139    // OMSSA web mzData to MGF conversion flag
     140    //String omssaWebConvertMzDataToMgfFlagStr = "true";
     141    String omssaWebConvertMzDataToMgfFlagStr = pf.getProperty("omssa.web.convert.mzdata_to_mgf");
     142    Boolean omssaWebConvertMzDataToMgfFlag = false;
     143    if (omssaWebConvertMzDataToMgfFlagStr != null && (
     144        omssaWebConvertMzDataToMgfFlagStr.equals("true") ||
     145        omssaWebConvertMzDataToMgfFlagStr.equals("True") ||
     146        omssaWebConvertMzDataToMgfFlagStr.equals("TRUE") ||
     147        omssaWebConvertMzDataToMgfFlagStr.equals("yes") ||
     148        omssaWebConvertMzDataToMgfFlagStr.equals("Yes") ||
     149        omssaWebConvertMzDataToMgfFlagStr.equals("YES"))
     150      )
     151    {
     152      omssaWebConvertMzDataToMgfFlag = true;
     153    }
    133154    // OMSSA install path
    134155    //String omssaInstallPath = "/omssa-2.1.4.linux";
     
    143164    //String omssaInputBasename = "proteios_autogenerated_input.xml";
    144165    String omssaInputBasename = pf.getProperty("omssa.local.input.basename");
     166    // OMSSA local mzData to MGF conversion flag
     167    //String omssaLocalConvertMzDataToMgfFlagStr = "true";
     168    String omssaLocalConvertMzDataToMgfFlagStr = pf.getProperty("omssa.local.convert.mzdata_to_mgf");
     169    Boolean omssaLocalConvertMzDataToMgfFlag = false;
     170    if (omssaLocalConvertMzDataToMgfFlagStr != null && (
     171        omssaLocalConvertMzDataToMgfFlagStr.equals("true") ||
     172        omssaLocalConvertMzDataToMgfFlagStr.equals("True") ||
     173        omssaLocalConvertMzDataToMgfFlagStr.equals("TRUE") ||
     174        omssaLocalConvertMzDataToMgfFlagStr.equals("yes") ||
     175        omssaLocalConvertMzDataToMgfFlagStr.equals("Yes") ||
     176        omssaLocalConvertMzDataToMgfFlagStr.equals("YES"))
     177      )
     178    {
     179      omssaLocalConvertMzDataToMgfFlag = true;
     180    }
    145181    // Directory for temporary files
    146182    String tmpDir = null;
     
    155191    log.debug("omssaWebServerTimediffHours = \"" + omssaWebServerTimediffHours + "\"");
    156192    log.debug("omssaWebServerTimediffCorrectionMinutes = \"" + omssaWebServerTimediffCorrectionMinutes + "\"");
     193    log.debug("omssaWebConvertMzDataToMgfFlagStr = \"" + omssaWebConvertMzDataToMgfFlagStr + "\"");
     194    log.debug("omssaWebConvertMzDataToMgfFlag = " + omssaWebConvertMzDataToMgfFlag);
    157195    log.debug("omssaInstallPath = \"" + omssaInstallPath + "\"");
    158196    log.debug("omssaProgramName = \"" + omssaProgramName + "\"");
    159197    log.debug("omssaDatabaseDirectoryPath = \"" + omssaDatabaseDirectoryPath + "\"");
    160198    log.debug("omssaInputBasename = \"" + omssaInputBasename + "\"");
     199    log.debug("omssaLocalConvertMzDataToMgfFlagStr = \"" + omssaLocalConvertMzDataToMgfFlagStr + "\"");
     200    log.debug("omssaLocalConvertMzDataToMgfFlag = " + omssaLocalConvertMzDataToMgfFlag);
    161201    log.debug("tmpDir = \"" + tmpDir + "\"");
    162202    log.debug("uploadOutputFileFlag = " + uploadOutputFileFlag);
     
    185225    }
    186226    log.debug("useWebInterfaceFlag = " + useWebInterfaceFlag);
     227    // Get the convert mzData file to MGF file flag
     228    Boolean convertMzDataToMgfFlag = false;
     229    if (useWebInterfaceFlag)
     230    {
     231      convertMzDataToMgfFlag = omssaWebConvertMzDataToMgfFlag;
     232    }
     233    else
     234    {
     235      convertMzDataToMgfFlag = omssaLocalConvertMzDataToMgfFlag;
     236    }
     237    log.debug("convertMzDataToMgfFlag = " + convertMzDataToMgfFlag);
    187238    // Get the save OMSSA parameter set  flag
    188239    Boolean saveOMSSAParameterSetFlag = getValidBoolean(VSAVEOMSSAPARAMETERSETFLAG);
     
    252303      }
    253304      File spectrumFile = factory.getById(File.class, spectrumFileId);
     305      // Check if input spectrum file should be converted before OMSSA search
     306      Job convertJob = null;
     307      if (convertMzDataToMgfFlag)
     308      {
     309        // Select file conversion plug-in depending on type of spectrum file
     310        FileType fileType = spectrumFile.getFileType();
     311        if ((fileType != null && fileType.getSystemId().equals(
     312          FileType.MZDATA)) || spectrumFile.getName().endsWith(".mzData"))
     313        {
     314          // Create convert job if converted file does not already exist
     315          if (!convertedMzDataToMgfFileExists(dc, spectrumFile))
     316          {
     317            convertJob = createMzDataToMgfConvertJob(dc, spectrumFile);
     318            log.debug("created convert job: " + convertJob.getName());
     319          }
     320          else
     321          {
     322            log.debug("Converted mzData to MGF file already exist, no convert job created.");
     323          }
     324        }
     325      }
    254326      PluginDefinition plugin = PluginDefinition.getById(dc, pluginDefId);
    255327      Job job = factory.createJob(plugin, null);
    256       // Set estimated execution time to next fastest, SHORT
    257       job.setEstimatedExecutionTime(Job.ExecutionTime.SHORT);
     328      // Set estimated execution time
     329      job.setEstimatedExecutionTime(ESTIMATED_EXECUTION_TIME);
    258330      //job.setName(plugin.getName() + " File: " + file.getName());
    259331      //job.setDescription("Gel: " + gelId + " File: " + file.getName());
     
    311383      BooleanParameterType useWebInterfaceFlagParam = new BooleanParameterType();
    312384      job.setParameterValue("useWebInterfaceFlag", useWebInterfaceFlagParam, useWebInterfaceFlag);
     385      //
     386      BooleanParameterType convertMzDataToMgfFlagParam = new BooleanParameterType();
     387      job.setParameterValue("convertMzDataToMgfFlag", convertMzDataToMgfFlagParam, convertMzDataToMgfFlag);
    313388      //
    314389      ItemParameterType<Project> projectParam = new ItemParameterType<Project>(
     
    318393      //FileParameterType filesParam = new FileParameterType();
    319394      //job.setParameterValue("file", filesParam, file);
     395      //
     396      if (convertJob != null)
     397      {
     398        // Wait for conversion job to finish before starting search job
     399        job.setBlocker(convertJob);
     400      }
    320401      dc.saveItem(job);
    321402      dc.commit();
     
    379460
    380461
     462  /**
     463   * Checks if a converted mzData to MGF file
     464   * exists. The converted file is assumed to
     465   * be located in the same directory as the input
     466   * mzData file, and have the same name as the
     467   * latter, but with ".mgf" appended.
     468   * Returns true if the file can be found, else false.
     469   *
     470   * @param dc DbControl The DbControl to use.
     471   * @param spectrumFile File The input mzData spectrum file.
     472   * @return boolean Returns true if the file can be found, else false.
     473   */
     474  private boolean convertedMzDataToMgfFileExists(DbControl dc, File spectrumFile)
     475  {
     476    boolean fileExists = false;
     477    if (fetchConvertedMzDataToMgfFile(dc, spectrumFile) != null)
     478    {
     479      fileExists = true;
     480    }
     481    log.debug("fileExists = " + fileExists);
     482    return fileExists;
     483  }
     484
     485
     486  /**
     487   * Fetches the converted mzData to MGF file.
     488   * The converted file is assumed to already
     489   * exist, being located in the same directory
     490   * as the input mzData file, and have the same
     491   * name as the latter, but with ".mgf" appended.
     492   * Returns null if the file cannot be found.
     493   *
     494   * @param dc DbControl The DbControl to use.
     495   * @param spectrumFile File The input mzData spectrum file.
     496   * @return File The converted mzData to MGF file.
     497   */
     498  private File fetchConvertedMzDataToMgfFile(DbControl dc, File spectrumFile)
     499  {
     500    ItemFactory factory = getItemFactory(dc);
     501    // Get path for mzData file converted to MGF
     502    Path spectrumFilePath = spectrumFile.getPath();
     503    String spectrumFilePathStr = spectrumFilePath.toString();
     504    log.debug("spectrumFilePathStr = \"" + spectrumFilePathStr + "\"");
     505    // Construct converted file path by appending ".mgf"
     506    spectrumFilePathStr = spectrumFilePathStr + ".mgf";
     507    log.debug("spectrumFilePathStr = \"" + spectrumFilePathStr + "\"");
     508    spectrumFilePath = new Path(spectrumFilePathStr, Path.Type.FILE);
     509    // Get converted core spectrum file from path
     510    File convertedSpectrumFile = null;
     511    try
     512    {
     513      convertedSpectrumFile = factory.getByPath(spectrumFilePath, false);
     514    }
     515    catch (Exception e)
     516    {
     517      log.debug("Exception when trying to get core file from path \"" + spectrumFilePathStr + "\": " + e);
     518    }
     519    log.debug("convertedSpectrumFile = " + convertedSpectrumFile);
     520    return convertedSpectrumFile;
     521  }
     522
     523
     524  /**
     525   * Creates an mzData file to MGF file conversion job.
     526   *
     527   * @param dc DbControl The DbControl to use.
     528   * @param spectrumFile File The input mzData spectrum file.
     529   * @return Job The mzData file to MGF file conversion job.
     530   */
     531  private Job createMzDataToMgfConvertJob(DbControl dc, File spectrumFile)
     532  {
     533    PluginDefinition plugin = PluginDefinition.getByClassName(
     534      dc, "org.proteios.plugins.MzDataToMGF");
     535    ItemFactory factory = getItemFactory(dc);
     536    Job job = factory.createJob(plugin, null);
     537    // Set estimated execution time to same as for OMSSA search job
     538    job.setEstimatedExecutionTime(ESTIMATED_EXECUTION_TIME);
     539    job.setName(plugin.getName() + " mzData file: " + spectrumFile.getName());
     540    job.setDescription("Spectrum File: " + spectrumFile.getName() + "[" + spectrumFile.getId() + "]");
     541    FileParameterType filesParam = new FileParameterType();
     542    job.setParameterValue("file", filesParam, spectrumFile);
     543    dc.saveItem(job);
     544    return job;
     545  }
     546
     547
    381548  private void saveOMSSAInputFileLocal(java.io.File localFile, OMSSAParameterSet omssaParameterSet)
    382549    throws ActionException
  • trunk/plugin/src/org/proteios/plugins/SearchOMSSAPlugin.java

    r2961 r3379  
    4444import org.proteios.core.ItemFactory;
    4545import org.proteios.core.OMSSAParameterSetStorage;
     46import org.proteios.core.Path;
     47import org.proteios.core.Path.Type;
    4648import org.proteios.core.ProgressReporter;
    4749import org.proteios.core.SessionControl;
     
    316318    Boolean useWebInterfaceFlag = (Boolean) job
    317319      .getValue("useWebInterfaceFlag");
     320    // Get convert mzData file to MGF file flag
     321    Boolean convertMzDataToMgfFlag = (Boolean) job
     322      .getValue("convertMzDataToMgfFlag");
    318323    //
    319324    String omssaProgramPath = omssaInstallPath + "/" + omssaProgramName;
     
    363368    log.debug("uploadOutputFileFlag = " + uploadOutputFileFlag);
    364369    log.debug("useWebInterfaceFlag = " + useWebInterfaceFlag);
     370    log.debug("convertMzDataToMgfFlag = " + convertMzDataToMgfFlag);
    365371    //
    366372    // Default is OMSSA search via web interface
     
    372378        omssaWebArchivePath, omssaWebResultFilenamePrefix,
    373379        omssaWebServerTimediffMinutes, omssapssId, spectrumFileId, dirId,
    374         uploadOutputFileFlag);
     380        uploadOutputFileFlag, convertMzDataToMgfFlag);
    375381    }
    376382    else
     
    380386        omssaInstallPath, omssaProgramName, omssaDatabaseDirectoryPath,
    381387        omssaInputFilename, omssaOutputPath, omssapssId,
    382         spectrumFileId, dirId, uploadOutputFileFlag);
     388        spectrumFileId, dirId, uploadOutputFileFlag, convertMzDataToMgfFlag);
    383389    }
    384390    done();
     
    422428   * @param dirId Integer The directory id
    423429   * @param uploadOutputFileFlag Boolean The upload output file flag
     430   * @param convertMzDataToMgfFlag Boolean The convert mzData file to MGF file flag
    424431   */
    425432  private void omssaSearchViaWebInterface(Request request,
     
    429436      String omssaWebResultFilenamePrefix, double omssaWebServerTimediffMinutes,
    430437      Integer omssapssId, Integer spectrumFileId, Integer dirId,
    431       Boolean uploadOutputFileFlag)
     438      Boolean uploadOutputFileFlag, Boolean convertMzDataToMgfFlag)
    432439  {
    433440    log.debug("omssaWebServerURLStr = \"" + omssaWebServerURLStr + "\"");
     
    439446    log.debug("omssaWebServerTimediffMinutes = " + omssaWebServerTimediffMinutes);
    440447    log.debug("uploadOutputFileFlag = " + uploadOutputFileFlag);
     448    log.debug("convertMzDataToMgfFlag = " + convertMzDataToMgfFlag);
    441449    //
    442450    String omssaWebScriptURLStr = omssaWebServerURLStr + "/" + omssaWebScriptPath;
     
    462470    // Get spectrum file
    463471    File spectrumFile = factory.getById(File.class, spectrumFileId);
    464     log.debug("spectrumFile = " + spectrumFile);
     472    log.debug("spectrumFile (original) = " + spectrumFile);
     473    // Always use original spectrum filename, even if a converted file is used for OMSSA search
     474    String originalSpectrumFilename = spectrumFile.getName();
     475    // Check if converted spectrum file should be used for search
     476    boolean mzDataConvertedToMgfUsed = false;
     477    if (convertMzDataToMgfFlag != null && convertMzDataToMgfFlag)
     478    {
     479      FileType fileType = spectrumFile.getFileType();
     480      if ((fileType != null && fileType.getSystemId().equals(
     481        FileType.MZDATA)) || spectrumFile.getName().endsWith(".mzData"))
     482      {
     483        // Use converted spectrum file for OMSSA search
     484        mzDataConvertedToMgfUsed = true;
     485        spectrumFile = fetchConvertedMzDataToMgfFile(dc, spectrumFile);
     486        log.debug("spectrumFile (converted from mzData to MGF) = " + spectrumFile);
     487      }
     488    }
    465489    // Get OMSSA input data from OMSSA parameters XML file
    466490    OMSSAParameterSet omssaParameterSet = omssapss
     
    850874    {
    851875      // Construct job done message
     876      String convertMessage = new String("");
     877      if (mzDataConvertedToMgfUsed)
     878      {
     879        convertMessage = new String(" - mzData data converted to MGF used for search");
     880      }
    852881      String doneMessage = new String("OMSSA search finished");
     882      doneMessage = doneMessage + convertMessage;
    853883      // Add OMSSA data input filename
    854884      // doneMessage = doneMessage + "\n" + "OMSSA input file: " +
     
    10691099   * @param dirId Integer The directory id
    10701100   * @param uploadOutputFileFlag Boolean The upload output file flag
     1101   * @param convertMzDataToMgfFlag Boolean The convert mzData file to MGF file flag
    10711102   */
    10721103  private void omssaSearchLocal(Request request, Response response,
     
    10751106      String omssaInputFilename, String omssaOutputPath,
    10761107      Integer omssapssId, Integer spectrumFileId, Integer dirId,
    1077       Boolean uploadOutputFileFlag)
     1108      Boolean uploadOutputFileFlag, Boolean convertMzDataToMgfFlag)
    10781109  {
    10791110    String omssaProgramPath = omssaInstallPath + "/" + omssaProgramName;
     
    10891120    log.debug("omssaOutputPath = \"" + omssaOutputPath + "\"");
    10901121    log.debug("uploadOutputFileFlag = " + uploadOutputFileFlag);
     1122    log.debug("convertMzDataToMgfFlag = " + convertMzDataToMgfFlag);
    10911123    // Create output file in directory for temporary files
    10921124    omssaOutputPath = new String("omssa_output_" + job.getId() + ".xml");
     
    11061138    // Get spectrum file
    11071139    File spectrumFile = factory.getById(File.class, spectrumFileId);
    1108     log.debug("spectrumFile = " + spectrumFile);
     1140    log.debug("spectrumFile (original) = " + spectrumFile);
     1141    // Always use original spectrum filename, even if a converted file is used for OMSSA search
     1142    String originalSpectrumFilename = spectrumFile.getName();
     1143    // Check if converted spectrum file should be used for search
     1144    boolean mzDataConvertedToMgfUsed = false;
     1145    if (convertMzDataToMgfFlag != null && convertMzDataToMgfFlag)
     1146    {
     1147      FileType fileType = spectrumFile.getFileType();
     1148      if ((fileType != null && fileType.getSystemId().equals(
     1149        FileType.MZDATA)) || spectrumFile.getName().endsWith(".mzData"))
     1150      {
     1151        // Use converted spectrum file for OMSSA search
     1152        mzDataConvertedToMgfUsed = true;
     1153        spectrumFile = fetchConvertedMzDataToMgfFile(dc, spectrumFile);
     1154        log.debug("spectrumFile (converted from mzData to MGF) = " + spectrumFile);
     1155      }
     1156    }
    11091157    // Get OMSSA input data from OMSSA parameters XML file
    11101158    OMSSAParameterSet omssaParameterSet = omssapss
    11111159      .fetchOMSSAParameterSet();
    11121160    // Copy spectrum file item to local file used for OMSSA input
    1113     String spectrumPath = new String(tmpDir + "/" + spectrumFile.getName());
    1114     log.debug("spectrumPath = " + spectrumPath);
     1161    String spectrumPath = new String(tmpDir + "/" + originalSpectrumFilename);
     1162    log.debug("spectrumPath for temporary file used for local OMSSA search = " + spectrumPath);
    11151163    java.io.File spectrumFileTmp = new java.io.File(spectrumPath);
    11161164    try
     
    14471495      log.debug("option = \"" + option + "\" (Flag set that input parameter values should be included in result file)");
    14481496      cmd = cmd + " " + option;
     1497      //
     1498      /*
     1499       * Note: OMSSA uses the option stored in
     1500       * string "spectrumFileOption" to decide
     1501       * how to parse a spectrum file, and if OMSSA
     1502       * supports the file type at all. The input local
     1503       * file path stored in string "spectrumFileTmp"
     1504       * may have a file extension indicating a
     1505       * different type of file, but this is
     1506       * not used by OMSSA.
     1507       */
    14491508      //
    14501509      log.debug("spectrum file");
     
    15331592      */
    15341593      // Construct job done message
     1594      String convertMessage = new String("");
     1595      if (mzDataConvertedToMgfUsed)
     1596      {
     1597        convertMessage = new String(" - mzData data converted to MGF used for search");
     1598      }
    15351599      String doneMessage = new String("OMSSA search finished");
     1600      doneMessage = doneMessage + convertMessage;
    15361601      //
    15371602      doneMessage = doneMessage + "\n" + "OMSSA input file: " + omssaInputFilename;
     
    15911656
    15921657  /**
     1658   * Fetches the converted mzData to MGF file.
     1659   * The converted file is assumed to already
     1660   * exist, being located in the same directory
     1661   * as the input mzData file, and have the same
     1662   * name as the latter, but with ".mgf" appended.
     1663   * Returns null if the file cannot be found.
     1664   *
     1665   * @param dc DbControl The DbControl to use.
     1666   * @param spectrumFile File The input mzData spectrum file.
     1667   * @return File The converted mzData to MGF file.
     1668   */
     1669  private File fetchConvertedMzDataToMgfFile(DbControl dc, File spectrumFile)
     1670  {
     1671    ItemFactory factory = new ItemFactory(dc);
     1672    // Get path for mzData file converted to MGF
     1673    Path spectrumFilePath = spectrumFile.getPath();
     1674    String spectrumFilePathStr = spectrumFilePath.toString();
     1675    log.debug("spectrumFilePathStr = \"" + spectrumFilePathStr + "\"");
     1676    // Construct converted file path by appending ".mgf"
     1677    spectrumFilePathStr = spectrumFilePathStr + ".mgf";
     1678    log.debug("spectrumFilePathStr = \"" + spectrumFilePathStr + "\"");
     1679    spectrumFilePath = new Path(spectrumFilePathStr, Path.Type.FILE);
     1680    // Get converted core spectrum file from path
     1681    File convertedSpectrumFile = null;
     1682    try
     1683    {
     1684      convertedSpectrumFile = factory.getByPath(spectrumFilePath, false);
     1685    }
     1686    catch (Exception e)
     1687    {
     1688      log.debug("Exception when trying to get core file from path \"" + spectrumFilePathStr + "\": " + e);
     1689    }
     1690    log.debug("convertedSpectrumFile = " + convertedSpectrumFile);
     1691    return convertedSpectrumFile;
     1692  }
     1693
     1694
     1695  /**
    15931696   * Update command line with new option and value,
    15941697   * provided that the value differs from null and
Note: See TracChangeset for help on using the changeset viewer.