Package cli

Class CLISequence

java.lang.Object
cli.CLISequence
All Implemented Interfaces:
CLI

public class CLISequence extends Object implements CLI
Handles the sequence task CLI parameters.

This class defines the command-line options and validation logic for the sequence task. See options() for details.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The content type to generate sequences of.
    static enum 
    The mode to split output files by.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
    Indicates whether to align sequences.
    The content type specified by the user.
    final Path
    The path to the input storage file.
    final Set<String>
    The set of loci (features or genomic ranges) provided by the user.
    final boolean
    Indicates whether to merge identical sequences.
    Generator for output paths per specified locus.
    final Set<String>
    The set of sample identifiers provided by the user.
    The mode to split output files by.
    final boolean
    Indicates whether only variable sites should be considered.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CLISequence(org.apache.commons.cli.CommandLine arguments)
    Constructs a new CLISequence instance and initializes its fields based on the provided command-line arguments.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.commons.cli.Options
    Defines the command-line options for the sequence task.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • input

      public final Path input
      The path to the input storage file.
    • content

      public final CLISequence.Content content
      The content type specified by the user.
    • split

      public final CLISequence.Split split
      The mode to split output files by.
    • outputGenerator

      public final Function<String,String> outputGenerator
      Generator for output paths per specified locus.
    • loci

      public final Set<String> loci
      The set of loci (features or genomic ranges) provided by the user.
    • samples

      public final Set<String> samples
      The set of sample identifiers provided by the user.
    • merge

      public final boolean merge
      Indicates whether to merge identical sequences.
    • align

      public final boolean align
      Indicates whether to align sequences.
    • variable

      public final boolean variable
      Indicates whether only variable sites should be considered.
  • Constructor Details

    • CLISequence

      public CLISequence(org.apache.commons.cli.CommandLine arguments) throws MusialException
      Constructs a new CLISequence instance and initializes its fields based on the provided command-line arguments.

      This constructor parses and validates the command-line arguments to initialize the fields required for the sequence task. It sets the input storage file, content type, loci, samples, merge and align options, and the output path generator.

      Parameters:
      arguments - The CommandLine object containing the parsed command-line arguments.
      Throws:
      MusialException - If there is an error parsing the output path or validating the input storage file.
  • Method Details

    • options

      public static org.apache.commons.cli.Options options()
      Defines the command-line options for the sequence task.

      The options include:

      • -I, --storage: The path to the input storage file (required).
      • -c, --content: Whether to generate NUCLEOTIDE or AMINOACID sequences (default: NUCLEOTIDE).
      • -l, --locations: One or more feature identifiers or genomic ranges to generate sequence data for (optional).
      • -s, --samples: One or more sample identifiers to retrieve sequences for (optional).
      • -m, --merge: Whether to merge identical sequences (optional, default: false).
      • -f, --split: How to split output files (optional, default: FEATURE).
      • -a, --align: Whether to align sequences (optional, default: false).
      • -v, --variable: Whether to consider only variable sites (optional, default: false).
      • -o, --output: Path to write the output. By default, files will be created in the input's directory (optional).
      Returns:
      An Options object containing the defined command-line options.