Package model

Record Class VariantCall.CallAlternative

java.lang.Object
java.lang.Record
model.VariantCall.CallAlternative
Record Components:
reference - The reference allele.
alternative - The alternative allele.
depth - The number of reads supporting the alternative allele.
Enclosing class:
VariantCall

public static record VariantCall.CallAlternative(String reference, String alternative, short depth) extends Record
Represents one alternative in the context of a variant call.

This record encapsulates the details of an alternative allele, including:

  • The reference nucleotide sequence as a String.
  • The alternative nucleotide sequence as a String.
  • The allelic depth (number of reads supporting the alternative allele) as an Integer.

Call alternatives are stored in the VariantCall.alternatives property of the model.

  • Constructor Details

    • CallAlternative

      public CallAlternative(String reference, String alternative, short depth)
      Creates an instance of a CallAlternative record class.
      Parameters:
      reference - the value for the reference record component
      alternative - the value for the alternative record component
      depth - the value for the depth record component
  • Method Details

    • toString

      public String toString()
      Converts the alternative allele to its string representation.

      This method generates a string representation of the alternative allele by concatenating the reference and alternative allele separated by Constants.GREATER_THAN.

      Specified by:
      toString in class Record
      Returns:
      A String representing the alternative allele.
    • hashCode

      public int hashCode()
      Computes the hash code for this alternative allele.

      This method calculates the hash code of the alternative allele based on its string representation.

      Specified by:
      hashCode in class Record
      Returns:
      The hash code of the alternative allele.
    • equals

      public boolean equals(Object obj)
      Compares this alternative allele to another object for equality.

      This method checks if the provided object is the same instance as this object. If not, it verifies that the object is of the same class and compares their string representations for equality.

      Specified by:
      equals in class Record
      Parameters:
      obj - The object to compare with this VariantCall.CallAlternative instance.
      Returns:
      true if the objects are the same instance or if their string representations are equal; false otherwise.
    • reference

      public String reference()
      Returns the value of the reference record component.
      Returns:
      the value of the reference record component
    • alternative

      public String alternative()
      Returns the value of the alternative record component.
      Returns:
      the value of the alternative record component
    • depth

      public short depth()
      Returns the value of the depth record component.
      Returns:
      the value of the depth record component