Class DataFormatRegistry


  • public class DataFormatRegistry
    extends Object
    this class register DataFormat to allow get the DataFormat of a file from its filename.
    Since:
    1.0
    Author:
    Laurent Jourdren
    • Method Detail

      • register

        public void register​(DataFormat[] array)
                      throws EoulsanException
        Register DataFormats.
        Parameters:
        array - Array with DataFormats to register
        Throws:
        EoulsanException - if the DataFormat is not valid
      • getDataFormatFromFilename

        public DataFormat getDataFormatFromFilename​(String prefix,
                                                    String extension)
        Get a DataFormat From a file prefix and extension
        Parameters:
        prefix - the prefix of the file
        extension - the extension of the file without compression extension
        Returns:
        a DataFormat or null if the DataFormat was not found
      • getDataFormatFromFilename

        public DataFormat getDataFormatFromFilename​(String filename)
        Get the DataFormat of a file from its filename
        Parameters:
        filename - the filename of the file
        Returns:
        a DataFormat or null if the DataFormat was not found
      • getDataFormatFromName

        public DataFormat getDataFormatFromName​(String dataFormatName)
        Get a DataFormat from its name.
        Parameters:
        dataFormatName - the name of the DataFormat to get
        Returns:
        a DataFormat if found or null
      • getDataFormatFromAlias

        public DataFormat getDataFormatFromAlias​(String dataFormatAlias)
        Get a DataFormat from its alias.
        Parameters:
        dataFormatAlias - the name of the DataFormat to get
        Returns:
        a DataFormat if found or null
      • getDataFormatFromGalaxyFormatName

        public DataFormat getDataFormatFromGalaxyFormatName​(String formatName)
        Get DataFormat from an Galaxy format name.
        Parameters:
        formatName - Galaxy name extension.
        Returns:
        DataFormat
      • getDataFormatFromNameOrAlias

        public DataFormat getDataFormatFromNameOrAlias​(String name)
        Get a DataFormat from its alias.
        Parameters:
        name - the name of the DataFormat to get
        Returns:
        a DataFormat if found or null
      • getDataFormatFromGalaxyFormatNameOrNameOrAlias

        public DataFormat getDataFormatFromGalaxyFormatNameOrNameOrAlias​(String name)
        Get a DataFormat from its Galaxy format name or its name or alias.
        Parameters:
        name - the name of the DataFormat to get
        Returns:
        a DataFormat if found or null
      • getDataFormatsFromExtension

        public Set<DataFormat> getDataFormatsFromExtension​(String extension)
        Get DataFormats from an extension.
        Parameters:
        extension - the extension of the file without compression extension
        Returns:
        a set of DataFormat
      • getAllFormats

        public Set<DataFormat> getAllFormats()
        Get all the registered formats.
        Returns:
        a set with all the registered formats
      • getDataFormatForDesignMetadata

        public DataFormat getDataFormatForDesignMetadata​(String key)
        Get the DataFormat that define a metadata entry in the design file.
        Parameters:
        key - the name of the metadata key
        Returns:
        a DataFormat
      • getDataFormatForSampleMetadata

        public DataFormat getDataFormatForSampleMetadata​(String key)
        Get the DataFormat that define a metadata entry of a sample in the design file.
        Parameters:
        key - the name of the metadata key
        Returns:
        a DataFormat
      • getDesignMetadataKeyForDataFormat

        public String getDesignMetadataKeyForDataFormat​(Design design,
                                                        DataFormat dataformat)
        Get the field name in a Design object that correspond to a dataformat.
        Parameters:
        design - design object
        dataformat - dataformat to search
        Returns:
        the field name if found or null
      • getSampleMetadataKeyForDataFormat

        public String getSampleMetadataKeyForDataFormat​(Sample sample,
                                                        DataFormat dataformat)
        Get the field name in a Sample object that correspond to a dataformat.
        Parameters:
        sample - sample object
        dataformat - dataformat to search
        Returns:
        the field name if found or null
      • reload

        public void reload()
        Reload the list of the available data types.
      • getInstance

        public static DataFormatRegistry getInstance()
        Get the singleton instance of DataFormatRegistry
        Returns:
        the DataFormatRegistry singleton