Class Chromosomes

The class Chromosomes serves as a collection class for Chromosome. Furthermore, it provides some handling for a chromosome set.

Overview

Chromosomes
New()
item(index: Integer): Chromosome {default}
item(ChromosomeNumber: String, index: Integer): Chromosome {default}
add(ByRef NewChromosome: Chromosome)
addRange(ByRef NewChromosomes: Chromosomes)
clone(): Object {Implements ICloneable.Clone}
count(): Integer
getCentromerePosition(Resolution: ChromosomeData.eResolutionLevel): Integer
getCountForChromosome(ChromosomeNumber: String): Integer
GetEnumerator(): IEnumerator {Implements IEnumerable.GetEnumerator}
remove(ByRef Item: Chromosome): void
removeAt(index: Integer): void
removeAt(ChromosomeNumber: String, index: Integer, Optional AdjustFollowingIndexes: Boolean = True): void

Programming Language

  • Microsoft Visual Basic .Net.

Availability

Constructors

Public Sub New()

Instantiates a new Chromosomes object.

Parameters

  • None.

Remarks

  • The internal collection (Arraylist) is prepared to take up 128 Chromosome objects which are added via the add or addRange functions..

Interfaces

ICloneable

is implemented with the clone function.

IEnumerable

is implemented with the GetEnumerator function.

Enumerations

The class does not provide enumerations.

Properties

Default Public ReadOnly Property item(ByVal index As Integer) As Chromosome

Gets the Chromosome object at the specified index of the internal collection.

Property Value

  • the Chromosome object at the specified index of the internal collection.

Remarks

  • This property provides the ability to access a specific Chromosome object in the Chromosomes object by using the following syntax: myChromosomes(index).
  • The property is read-only.

Default Public ReadOnly Property item(ByVal ChromosomeNumber As String, ByVal index As Integer) As Chromosome

Gets the Chromosome object with the specified chromosome number and the specified index among the group of chromosomes with that number.

Property Value

  • the Chromosome object defined by the chromosome number and index.

Remarks

  • An identifier for each chromosome was introduced when the Karyogram was developed (Chromosome.ExternalID property). It consists of the chromosome number followed by an underline and an index; e.g. "X_2" for the second X chromosome. The identifier is not provided by this class.
  • This property provides the ability to access a specific Chromosome object in the Chromosomes object by using the following syntax: myChromosomes(ChromosomeNumber, index).
  • The property is read-only.

Examples

  • To get the second X chromosome, do: myChromosomes("X",2).

Methods

Public Sub add(ByRef NewChromosome As Chromosome)

Adds the chromosome passed to the function into the internal collection.

Return Value

  • None.

Parameters

Remarks

  • A reference is added, not a clone. Consequently, any changes to NewChromosome inside or outside this object will be available on both sides.
  • Null pointers are ignored.

Public Sub addRange(ByRef NewChromosomes As Chromosomes)

Adds each Chromosome contained in the NewChromosomes object into the internal collection.

Return Value

  • None.

Parameters

  • NewChromosomes: a reference to the Chromosomes object whose Chromosome objects are to be added..

Remarks

  • References to the Chromosome objects are added, not clones. Consequently, any changes to such a Chromosome inside or outside this object will be available on both sides.

Exceptions

Public Function clone() As Object Implements ICloneable.Clone

Creates a deep copy of the Chromosomes object; i.e. while cloning, each Chromosome object contained in the collection is cloned.

Return Value

  • A deep copy of the Chromosomes object.

Parameters

  • None.

Implements

Remarks

  • A deep copy copies not only the elements of the internal collection, but it does also copy the objects that the references refer to. That is, all Chromosome objects in the internal collection will be cloned using Chromosome.clone.

Public Function count() As Integer

Gets the number of Chromosome objects actually contained in this Chromosomes object.

Public Function getCentromerePosition(ByVal Resolution As ChromosomeData.eResolutionLevel) As Integer

Returns the maximum distance of a centromere from the chromosome start point.

Return Value

  • the maximum distance of a centromere from the chromosome top.

Parameters

  • Resolution: the banding resolution at which the chromosome is to be drawn. Values for the rsolution are defined in the ChromosomeData.eResolutionLevel enumeration.

Remarks

  • This function is intended for use with drawing a Karyogram: here, a common height for all centromeres is desired.

Internal processing

Public Function getCountForChromosome(ByVal ChromosomeNumber As String) As Integer

Returns the number of chromosomes present which have the specified chromosome number.

Return Value

  • the number of chromosomes with the specified chromosome number.

Parameters

  • ChromosomeNumber: the chromosome number for which chromosomes are to be counted.

Remarks

  • This function relies on the identifiers of the Chromosome objects (Chromosome.ExternalID property).
  • It was developed in connection with the Karyogram.

Internal processing

  • For each Chromosome object, its ExternalID property is checked if it starts with "<ChromosomeNumber_", and positive results are counted.

Public Function GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator

Returns an enumerator that can iterate through the collection of Chromosome objects of this Chromosomes object.

Implements

Public Sub remove(ByRef Item As Chromosome)

Removes the specified chromosome object from the collection.

Return Value

  • None.

Parameters

  • Item: a reference to the Chromosome to be removed from the collection.

Exceptions

  • ArgumentNullException: Item must not be a NULL reference.
  • Further exceptions may be raised from the underlying function of the .net framework.

Remarks

  • If the Chromosome object is not found in the collection, nothing is done.

Internal processing

Public Sub removeAt(ByVal index As Integer)

Removes the chromosome object at the specified index from the collection.

Return Value

  • None.

Parameters

  • index: The zero-based index of the element to remove.

Exceptions

  • Exceptions may be raised from the underlying function of the .net framework.

Remarks

  • The elements that follow the removed element move up to occupy the vacated spot.

Internal processing

Public Sub removeAt(ByVal ChromosomeNumber As String, ByVal index As Integer, Optional ByVal AdjustFollowingIndexes As Boolean = True)

Removes the specified chromosome object from the collection. The internal chromosome identifier may be adjusted.

Return Value

  • None.

Parameters

  • ChromosomeNumber: the number of the chromsome according to ISCN.
  • index: The index of the chromosome among the group of chromosomes with the same number.
  • AdjustFollowingIndexes: indicates if the indices of later chromosomes with the same number are adjusted or not (by default true).

Remarks

  • This function is useful when replacing a specific chromosome by another chromosome.

Internal processing

  • The chromosome to be removed is located in the collection.
  • If the chromosome is the last one in the series with that number, it can be safely removed.
  • If it is not the last one, chromosomes with the later indices for that chromosome number are searched for and their indices (ExternalID property) are adjusted when requested.

Interaction with other classes

Classes using Chromosomes

The Chromosomes class is used by the Karyogram class as a major constituent. A Chromosomes object is also the return value of the Karyotype.getAlteredChromosomes and Aberration.getAlteredChromosomes functions.

Classes used by Chromosomes

A Chromosomes object contains a collection of Chromosome objects.