Package model
Class Allele
java.lang.Object
model.Attributes
model.SequenceType
model.Allele
Represents an allele, which is a specific sequence type associated with a set of samples and a proteoform.
This class extends SequenceType
and provides functionality to manage relationships between the allele and associated samples, as
well as the proteoform identifier.
-
Field Summary
Fields inherited from class model.SequenceType
_id
-
Constructor Summary
ConstructorsConstructorDescriptionAllele
(List<Variant.Stub> variants) Constructs anAllele
instance with the specified variants. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSampleRelation
(String sampleIdentifier) Associates a sample with this allele.boolean
Compares this allele to another object for equality.Retrieves the proteoform identifier associated with this allele.Retrieves a collection of sample identifiers associated with this allele.int
Retrieves the number of unique samples associated with this allele.int
hashCode()
Computes the hash code for this allele.boolean
hasRelation
(String identifier) Checks if this allele is associated with a specific sample by its identifier.void
setProteoformRelation
(String identifier) Sets the proteoform identifier for this allele.toString()
Converts the allele to its string representation.Methods inherited from class model.SequenceType
getStubs, getVariant, getVariants, hasVariant, hasVariantAt
Methods inherited from class model.Attributes
attributesAsString, attributesAsString, clearAttributes, extendAttribute, extendAttributes, getAttribute, getAttributeOrDefault, getAttributes, getAttributeSet, hasAnyAttribute, hasAttribute, removeAttribute, setAttribute, setAttributeIfAbsent, setAttributes, setAttributesIfAbsent
-
Constructor Details
-
Allele
Constructs anAllele
instance with the specified variants.- Parameters:
variants
- A list ofVariant.Stub
objects representing the variants that define this allele.
-
-
Method Details
-
hasRelation
Checks if this allele is associated with a specific sample by its identifier.- Parameters:
identifier
- The unique identifier of the sample to check.- Returns:
true
if the sample is associated with this allele,false
otherwise.
-
getRelatedSamples
Retrieves a collection of sample identifiers associated with this allele.This method returns an unmodifiable view of the set of sample identifiers associated with the allele. The unmodifiable set ensures that the original set cannot be modified externally, preserving data integrity.
- Returns:
- A
Set
of sample identifiers related to this allele.
-
getRelatedSamplesCount
public int getRelatedSamplesCount()Retrieves the number of unique samples associated with this allele.- Returns:
- The count of sample identifiers related to this allele.
-
getRelatedProteoform
Retrieves the proteoform identifier associated with this allele.- Returns:
- The proteoform identifier as a
String
, ornull
if no proteoform is associated.
-
addSampleRelation
Associates a sample with this allele.- Parameters:
sampleIdentifier
- The unique identifier of the sample to associate with this allele.
-
setProteoformRelation
Sets the proteoform identifier for this allele.- Parameters:
identifier
- The unique identifier of the proteoform to associate with this allele.
-
toString
Converts the allele to its string representation.This method returns the unique identifier of the allele as its string representation.
-
hashCode
public int hashCode()Computes the hash code for this allele.This method calculates the hash code of the allele based on its unique identifier.
-
equals
Compares this allele to another object for equality.This method checks if the provided object is the same instance as this allele. If not, it verifies that the object is of the same class and compares their unique identifiers for equality.
-