Package model

Class Proteoform


public class Proteoform extends SequenceType
Represents a proteoform, which is a specific sequence type associated with a set of alleles.

This class extends SequenceType and provides functionality to manage relationships between the proteoform and associated alleles.

  • Constructor Details

    • Proteoform

      public Proteoform(List<Variant.Stub> variants)
      Constructs a Proteoform instance with the specified variants.

      This constructor initializes the proteoform by processing a list of Variant.Stub objects.

      Parameters:
      variants - A List of Variant.Stub objects representing the variants that define this proteoform.
  • Method Details

    • hasRelation

      public boolean hasRelation(String identifier)
      Checks if this proteoform is associated with a specific allele by its identifier.
      Parameters:
      identifier - The unique identifier of the allele to check.
      Returns:
      true if the allele is associated with this proteoform, false otherwise.
    • getRelatedAlleles

      public Set<String> getRelatedAlleles()
      Retrieves a collection of allele identifiers associated with this proteoform.

      This method returns an unmodifiable view of the set of allele identifiers associated with the proteoform. The unmodifiable set ensures that the original set cannot be modified externally, preserving data integrity.

      Returns:
      A Set of allele identifiers related to this proteoform.
    • addRelation

      public void addRelation(String alleleIdentifier)
      Associates an allele with this proteoform.
      Parameters:
      alleleIdentifier - The unique identifier of the allele to associate with this proteoform.
    • isDisrupted

      public boolean isDisrupted()
      Determines if the proteoform is disrupted based on its sequence ontology (SO) effects.
      Returns:
      true if the proteoform is disrupted (i.e., has "start_lost" or "stop_gained" SO effects), false otherwise.
    • toString

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

      This method returns the unique identifier of the proteoform as its string representation.

      Overrides:
      toString in class Object
      Returns:
      A String representing the unique identifier of the proteoform.
    • hashCode

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

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

      Overrides:
      hashCode in class Object
      Returns:
      The hash code of the proteoform.
    • equals

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

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

      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare with this Proteoform instance.
      Returns:
      true if the objects are the same instance or if their string representations are equal; false otherwise.