Class SimpleMzIdentMLExporter

java.lang.Object
com.compomics.util.experiment.io.identification.writers.SimpleMzIdentMLExporter
All Implemented Interfaces:
Closeable, AutoCloseable

public class SimpleMzIdentMLExporter
extends Object
implements Closeable
Simple mzIdentML exporter for PSM-level results.
Author:
Marc Vaudel
  • Field Details

  • Constructor Details

    • SimpleMzIdentMLExporter

      public SimpleMzIdentMLExporter​(String softwareName, String softwareVersion, String softwareUrl, File tempFolder, File destinationFile, ArrayList<File> spectrumFiles, File searchEngineFile, HashMap<String,​ArrayList<String>> searchEngines, File fastaFile, IdentificationParameters identificationParameters, SequenceProvider sequenceProvider, ProteinDetailsProvider proteinDetailsProvider, SpectrumProvider spectrumProvider, ModificationProvider modificationProvider, FastaSummary fastaSummary, String contactFirstName, String contactLastName, String contactAddress, String contactEmail, String contactOrganizationName, String contactOrganizationAddress, String contactOrganizationEmail, boolean peptideInference) throws FileNotFoundException, IOException
      Constructor.
      Parameters:
      softwareName - The name of the software used to write the mzIdentML file.
      softwareVersion - The version of the software used to write the mzIdentML file.
      softwareUrl - The URL of the software used to write the mzIdentML file.
      tempFolder - The folder to use to write temporary files.
      destinationFile - The mzIdentML file to write.
      spectrumFiles - The spectrum files.
      searchEngineFile - The search engine file used to identify the spectra.
      searchEngines - Map of the search engine(s) and their version used to identify the spectra.
      fastaFile - The fasta file containing the peptide/protein sequences.
      identificationParameters - The identification parameters used to identify the spectra.
      sequenceProvider - A sequence provider for the given fasta file.
      proteinDetailsProvider - A protein details provider for the given fasta file.
      spectrumProvider - A spectrum provider for the given spectrum file.
      modificationProvider - A modification provider.
      fastaSummary - A summary for the given fasta file.
      contactFirstName - Contact first name.
      contactLastName - Contact last name.
      contactAddress - Contact address.
      contactEmail - Contact email.
      contactOrganizationName - Contact organization name.
      contactOrganizationAddress - Contact organization address.
      contactOrganizationEmail - Contact organization email.
      peptideInference - Boolean indicating whether peptide inference was performed, in which case matching keys will be used for the peptides.
      Throws:
      FileNotFoundException - Exception thrown if a file is not found.
      IOException - Exception thrown if an error occurred while reading or writing a file.
  • Method Details

    • init

      public void init​(String contactFirstName, String contactLastName, String contactAddress, String contactEmail, String contactOrganizationName, String contactOrganizationAddress, String contactOrganizationEmail)
      Initializes the writing of the file. Writes up to the peptide section. Note: Protein details are written in a separate thread.
      Parameters:
      contactFirstName - Contact first name.
      contactLastName - Contact last name.
      contactAddress - Contact address.
      contactEmail - Contact email.
      contactOrganizationName - Contact organization name.
      contactOrganizationAddress - Contact organization address.
      contactOrganizationEmail - Contact organization email.
    • finalizeFile

      public void finalizeFile()
      Finalizes the writing of the mzIdentML file.
    • addSpectrum

      public void addSpectrum​(String spectrumFile, String spectrumTitle, ArrayList<PeptideAssumption> peptideAssumptions, ArrayList<TreeMap<Double,​HashMap<Integer,​Double>>> modificationLocalizationScores, PeptideSpectrumAnnotator peptideSpectrumAnnotator)
      Adds a peptide-spectrum match to the file.
      Parameters:
      spectrumFile - The spectrum file.
      spectrumTitle - The spectrum title.
      peptideAssumptions - The peptide assumptions for this spectrum.
      modificationLocalizationScores - The modification localization scores for the given peptide assumptions.
      peptideSpectrumAnnotator - The annotator to use for the spectra.
    • getPeptideEvidenceKey

      public static String getPeptideEvidenceKey​(String accession, int peptideStart, long peptideKey)
      Returns the peptide evidence key as string for the given peptide attributes.
      Parameters:
      accession - the protein accession
      peptideStart - the index of the peptide on the protein sequence
      peptideKey - the peptide match key
      Returns:
      the peptide evidence key as string for the given peptide attributes
    • getModificationName

      public String getModificationName​(double modMass, Peptide peptide, int modSite)
      Returns the name of the modification corresponding to he given modification mass at the given site on the given peptide. Note: modification masses are matched by exact mass as reported by the modification localization scorer, no tolerance is used.
      Parameters:
      modMass - The modifification mass.
      peptide - The peptide.
      modSite - The modification site.
      Returns:
      The name of the modification.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable