Class DataFileOptionsUtils

java.lang.Object
ubic.gemma.cli.options.DataFileOptionsUtils

public class DataFileOptionsUtils extends Object
Utilities to add and process options for data files (raw data, processed data, designs, etc.).
Author:
poirigui
  • Field Details

  • Constructor Details

    • DataFileOptionsUtils

      public DataFileOptionsUtils()
  • Method Details

    • addDataFileOptions

      public static void addDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation, BiConsumer<org.apache.commons.cli.OptionGroup,org.apache.commons.cli.Option> addSingleOption)
    • addDataFileOptions

      public static void addDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation, boolean allowFile, boolean allowDirectory, boolean allowCurrentDirectory, boolean allowStdout, BiConsumer<org.apache.commons.cli.OptionGroup,org.apache.commons.cli.Option> addSingleOption)
      Add options for writing data files, such as raw or processed data files.
      Parameters:
      allowStandardLocation - if true, the standard location option will be added
      allowFile - if true, the output file option will be added, otherwise only the output directory will be added
      allowDirectory - if true, the output directory option will be added
      allowCurrentDirectory - if true, writing to the current directory will be allowed
      allowStdout - if true, the standard output option will be added
      addSingleOption - a function that adds a single option to the given option group; this is needed because a CLI might want to track which options apply to individual entities separately.
      See Also:
      • ExpressionDataFileService
      • ExpressionDataFileUtils
    • addExpressionDataFileOptions

      public static void addExpressionDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation, BiConsumer<org.apache.commons.cli.OptionGroup,org.apache.commons.cli.Option> addSingleOption)
    • addSingleCellExpressionDataFileOptions

      public static void addSingleCellExpressionDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation, BiConsumer<org.apache.commons.cli.OptionGroup,org.apache.commons.cli.Option> addSingleOption)
    • addDesignFileOptions

      public static void addDesignFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation, BiConsumer<org.apache.commons.cli.OptionGroup,org.apache.commons.cli.Option> addSingleOption)
    • addCellMetadataFileOptions

      public static void addCellMetadataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation, BiConsumer<org.apache.commons.cli.OptionGroup,org.apache.commons.cli.Option> addSingleOption)
    • getDataFileOptionValue

      public static DataFileOptionValue getDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation, String forceOption, boolean force) throws org.apache.commons.cli.ParseException
      Throws:
      org.apache.commons.cli.ParseException
    • getDataFileOptionValue

      public static DataFileOptionValue getDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation, boolean allowStdout, boolean allowCurrentDirectory, String forceOption, boolean force) throws org.apache.commons.cli.ParseException
      Parameters:
      allowStandardLocation - if true, the standard location option will be considered and used as a default if no other destination is selected. Otherwise, standard output will be used as a default.
      allowStdout - if true, the standard output option will be considered and used as a default if no other destination is selected. Otherwise, the current directory will be used as a default.
      allowCurrentDirectory - if true, the current directory will be used as a default if no other destination is selected. Note that a file can be written to inside that directory via DataFileOptionValue.getOutputFile(String)
      Throws:
      org.apache.commons.cli.MissingOptionException - if no destination is selected and no default location is allowed.
      org.apache.commons.cli.ParseException
    • getExpressionDataFileOptionValue

      public static ExpressionDataFileOptionValue getExpressionDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation, String forceOption, boolean force) throws org.apache.commons.cli.ParseException
      Throws:
      org.apache.commons.cli.ParseException
    • getSingleCellExpressionDataFileOptionValue

      public static SingleCellExpressionDataFileOptionValue getSingleCellExpressionDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation, String forceOption, boolean force) throws org.apache.commons.cli.ParseException
      Throws:
      org.apache.commons.cli.ParseException
    • getDesignFileOptionValue

      public static DesignFileOptionValue getDesignFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation, String forceOption, boolean force) throws org.apache.commons.cli.ParseException
      Throws:
      org.apache.commons.cli.ParseException
    • getCellMetadataFileOptionValue

      public static CellMetadataFileOptionValue getCellMetadataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation, String forceOption, boolean force) throws org.apache.commons.cli.ParseException
      Throws:
      org.apache.commons.cli.ParseException