Class PrideObjectsFactory

java.lang.Object
com.compomics.util.pride.PrideObjectsFactory

public class PrideObjectsFactory extends Object
This factory manages the pride objects saved in the user folder.
Author:
Marc Vaudel
  • Field Details

    • extension

      public static final String extension
      The extension to use when saving objects. By default cus for compomics utilities serialization
      See Also:
  • Method Details

    • getInstance

      Method returning the instance of the factory.
      Returns:
      the instance of the factory
      Throws:
      FileNotFoundException - exception thrown whenever the file was not found
      IOException - exception thrown whenever an error occurred while writing the file
      ClassNotFoundException - exception thrown whenever an error occurred while serializing the file
    • addContactGroup

      public void addContactGroup(ContactGroup contactGroup) throws IOException
      Adds a contact group in the PRIDE objects.
      Parameters:
      contactGroup - the contact group to add
      Throws:
      IOException - exception thrown whenever an error occurred while saving
    • deleteContactGroup

      public void deleteContactGroup(ContactGroup contactGroup)
      Delete the given contact group.
      Parameters:
      contactGroup - the group to delete
    • addProtocol

      public void addProtocol(Protocol protocol) throws IOException
      Adds a protocol in the PRIDE objects.
      Parameters:
      protocol - the protocol to add
      Throws:
      IOException - exception thrown whenever an error occurred while saving
    • deleteProtocol

      public void deleteProtocol(Protocol protocol)
      Delete the given protocol.
      Parameters:
      protocol - the protocol to delete
    • addInstrument

      public void addInstrument(Instrument instrument) throws IOException
      Adds a instrument in the PRIDE objects.
      Parameters:
      instrument - the instrument to add
      Throws:
      IOException - exception thrown whenever an error occurred while saving
    • deleteInstrument

      public void deleteInstrument(Instrument instrument)
      Delete the given instrument.
      Parameters:
      instrument - the instrument to delete
    • addReferenceGroup

      public void addReferenceGroup(ReferenceGroup referenceGroup) throws IOException
      Adds a reference group in the PRIDE objects.
      Parameters:
      referenceGroup - the reference group to add
      Throws:
      IOException - exception thrown whenever an error occurred while saving
    • deleteReferenceGroup

      public void deleteReferenceGroup(ReferenceGroup referenceGroup)
      Delete the given reference group.
      Parameters:
      referenceGroup - the reference group to delete
    • addSample

      public void addSample(Sample sample) throws IOException
      Adds a sample in the PRIDE objects.
      Parameters:
      sample - the sample to add
      Throws:
      IOException - exception thrown whenever an error occurred while saving
    • deleteSample

      public void deleteSample(Sample sample)
      Delete the given sample.
      Parameters:
      sample - the sample to delete
    • setPtmToPrideMap

      public void setPtmToPrideMap(PtmToPrideMap ptmToPrideMap) throws FileNotFoundException, IOException
      Sets a new PTM to PRIDE map.
      Parameters:
      ptmToPrideMap - a new PTM to pride map
      Throws:
      FileNotFoundException - if a FileNotFoundException occurs
      IOException - if an IOException occurs
    • getContactGroups

      public HashMap<String,ContactGroup> getContactGroups()
      Returns the contact groups.
      Returns:
      the contact groups
    • getInstruments

      public HashMap<String,Instrument> getInstruments()
      Returns the instruments.
      Returns:
      the instruments
    • getProtocols

      public HashMap<String,Protocol> getProtocols()
      Returns the protocols.
      Returns:
      the protocols
    • getPtmToPrideMap

      public PtmToPrideMap getPtmToPrideMap()
      Returns the utilities PTM to pride map.
      Returns:
      the utilities PTM to pride map
    • getReferenceGroups

      public HashMap<String,ReferenceGroup> getReferenceGroups()
      Returns the reference groups.
      Returns:
      the reference groups
    • getSamples

      public HashMap<String,Sample> getSamples()
      Returns the samples.
      Returns:
      the samples
    • getPrideFolder

      public static String getPrideFolder()
      Returns the folder where pride annotation information should be saved.
      Returns:
      the folder where pride annotation information should be saved
    • setPrideFolder

      public static void setPrideFolder(String prideFolder)
      Sets the folder where pride annotation information should be saved.
      Parameters:
      prideFolder - the folder where pride annotation information should be saved