Class ChromosomeData
The class ChromosomeData provides information on the chromosome set used
for the analysis and some functions for general use with chromosomes.
Overview
Programming Language
-
Microsoft Visual Basic .Net.
Availability
Constructors
The class does not have any constructor. All its function are class methods,
not instance methods, thus no instance of this class is needed.
Interfaces
This class does not implement an interface.
Enumerations
The class provides enumerations for the description of the resolution of
the chromosome and for properties needed for drawing a chromosome.
Enum eResolutionLevel
This enumeration describes the level of resolution of chromosome banding.
Value |
Meaning |
ResolutionNone |
The resolution could not be determined
or has not yet been determined. |
ResolutionChromosome |
Only the chromosome number is given. |
ResolutionArm |
Chromosome and arm are known. |
Resolution1Digit |
Chromosome, arm and 1 digit are known. |
Resolution2Digit |
Chromosome, arm and 2 digits are known. |
Resolution400Bands |
The band can be detected at a resolution
of 400 band per haploid set. |
Resolution500Bands |
The band can be detected at a resolution
of 500 band per haploid set. |
Resolution550Bands |
The band can be detected at a resolution
of 550 band per haploid set. |
Resolution800Bands |
The band can be detected at a resolution
of 800 band per haploid set. |
Enum ePaintWidth
This enumeration describes the width a chromosome band is drawn with.
Note: There is no value for a centromer or a band close to a centromer
because centromers can be detected with a logic of its own.
Value |
Meaning |
PaintWidthNormal |
a "normal" band drawn at full width |
PaintWidthSatellite |
a satellite band drawn with diminished
width |
Enum ePaintStyle
This enumeration describes the style a chromosome band is drawn with.
Value |
Meaning |
PaintStyleNone |
The style is unknown. |
PaintStyleTransparent |
Only the circumference of the band is
drawn, its area is transparent. This corresponds to a Giemsa negative band. |
PaintStyleLight |
The circumference of the band is drawn
and its area is filled with a pattern of lines on a diagonal from upper
left to lower right. This corresponds to a heterochromatic regions which
stains a little. |
PaintStyleDark |
The circumference of the band is drawn
and its area is filled with a pattern of thick lines close to each other
on a diagonal from upper right to lower left. This corresponds to a heterochromatic
regions which stains strongly. |
PaintStyleFull |
The band is filled fully. This corresponds
to a Giemsa positive band. |
PaintStyleWeak |
The band is filled fully, but the color is reduced to a light grey
(or similar). This corresponds to a band which is only slightly Giemsa
positive. |
PaintStyleMiddle |
The band is filled fully, but the color is reduced to a medium grey
(or similar). This corresponds to a band which is Giemsa positive at a
reduced level. |
PaintStyleStrong |
The band is filled fully, but the color is reduced to a dark grey (or
similar). This corresponds to a band which is strongly Giemsa positive,
but not yet fully dark. |
Properties
The class provides one property:
Public Shared Property MapViewer() As String
Gets or sets the external resource with which chromosomal bands are linked.
Property Value
-
an external resource chromosomal bands are linked with.
Parameter
Remarks
Internal Processing
-
If links change, or another map viewer is to be integrated, the getMapViewURL
function must be adjusted.
Methods
All methods of the class are class methods, i.e. they are marked "shared".
Public Shared Function checkBandExistence(ByRef
Band As Band) As Boolean
Checks if a band number with which Band is described was defined in the
chromosome set given in the resources file.
Return Value
-
true: the band exists.
-
false: the band does not exist.
Parameters
-
Band: a reference to a Band object describing
the band number to be checked for proper existence.
Remarks
-
This function does not raise an exception if the Band was not found. If
an exception in such cases is desired, use the Band.checkExistence()
function instead.
Examples
-
With the standard set of human chromosomes, checkBandExistence
returns true for 9q34.12, and false for 9q34.21,
resp.
Public Shared Sub getBandSet(ByVal Resolution
As eResolutionLevel, ByRef BandSet As Band(), ByRef BandNames As String())
Provides an array of Band objects and an array of String with the band
names of all bands visible at the given banding resolution.
Return Value
-
there is no direct return value, but two arrays are passed by reference
and changed within the function.
Parameters
-
Resolution: the desired banding resolution. Its values are defined
in the eResolutionLevel enumeration.
-
BandSet: a reference to an array of Band
objects. This array will be filled with the band objects of the desired
resolution in due order.
-
BandNames: a reference to an array of string. This array will
be filled with the names of the bands of the desired resolution in due
order.
Remarks
-
The arrays are calculated for each resolution only once and stored in class
variables.
-
Be careful when changing the properties of a band in a BandSet returned
from this function: this will also change the original Band object. Using
the Band.clone() function could circumvent
problems arising therefrom.
Public Shared Function getBandsForFragment(ByRef
Fragment As Fragment, ByVal Resolution As eResolutionLevel) As Bands
Returns a
Bands object containing all the bands
residing on the Fragment at the given banding resolution.
Return Value
-
the bands contained in the fragment.
Parameters
-
Fragment: a reference to a Fragment
object whose bands are to be determined.
-
Resolution: the desired banding resolution. Its values are defined
in the eResolutionLevel enumeration.
Exceptions
Internals
-
The function gets a BandSet with all chromosomal
bands at the desired resolution level and searches for band names starting
with or equalling the names of the start and end band of the fragment.
Bands from the BandSet are then copied into the returned Bands object.
-
For start and end
bands, clones are established and there broken
level set to the broken levels of the bands in Fragment.
Public Shared Function getColorForChromosome(ByVal
Chromosome As String) As System.Drawing.Color
Returns the
color
to be used for drawing the chromosome. It may have been modified by the
user with the
setChromosomeUserColor
function; for getting the default color, the user settings may be invalidated
using the
resetChromosomeUserColor
function.
Return Value
-
the color
to be used for drawing the chromosome.
Parameters
-
Chromosome: The number of the chromosome.
Remarks
-
If no chromosome number is given, returns "gray".
-
Default colors are defined in the resources
file.
Examples
-
For chromosome # 13, getColorForChromosome originally returns
"DarkOrange".
Internals
-
Internally, two hashtables storing the chromosome colors exist. The default
table is loaded from the resources file and remains unchanged. The "user"
table is originally copied from the default table and may be changed or
re-copied from the default. The function always looks into the "user" table.
Public Shared Function getDefaultDrawSequence()
As String
Returns the sequence in which chromosomes are to be drawn when a set of
all chromosomes is to be displayed.
Return Value
-
a string showing the sequence in which chromosomes are to be drawn.
Remarks
-
Chromosome numbers are delimited by commata (",").
-
Line breaks are shown with the symbol "BR".
-
The default is defined in the resources
file.
Examples
-
Within the standard CyDAS package, the chromosomes are defined to be drawn
in three lines as follows: "1,2,3,4,5,6,7,X,BR,8,9,10,11,12,13,14,15,BR,16,17,18,19,20,21,22,Y".
This sequence shows the same number of chromosomes in every line and an
order of descending lenght, thus providing a good use of space.
Public Shared Function getInstallDir() As String
Shows where the ISCNAnalyser.dll was installed.
Return Value
-
The directory where the ISCNAnalyser.dll was installed.
Internals
-
The installation directory is internally required for finding the resources
file.
-
The ISCNAnalyser dll can be registered; then its location can be queried
from the registry.
-
When debugging the program, the dll is registered during the build action
in the bin/ directory of the project folder. Here, setting the gbUseDefaultLocation
variable to true and hard coding the location in LoadResources helps circumvent
some problems.
-
Also when using the dll on a web server (.aspx), the gbUseDefaultLocation
variable should be set to true and the location in LoadResources hard coded.
Public Shared Function getMapViewLink(ByRef
Band As Band) As String
Returns HTML code showing the band number in exact notation linked with
map viewer information for that band.
Parameters
-
Band: a reference to a Band object describing
the band whose information is to be obtained from the map viewer.
Remarks
-
The method does not at all check the band for existence. If a band does
not exist, the map viewer will show an error when the link is followed.
-
The band is expected to be a band on a human chromosome. The link URL is
hard coded.
-
Also hard coded is the target (new browser window) and a javascript function
"getLink(document,this)" which can be used for other programming purposes.
-
For getting the URL only, use the getMapViewURL
function instead.
-
The type of map viewer is set in the MapViewer
property.
Examples
-
With band "2q21", getMapViewLink returns for the NCBI
map viewer "<a href="http://www.ncbi.nlm.nih.gov/mapview/maps.cgi?TAXID=9606&CHR=2&MAPS=ideogr%5B2pter%3A2qter%5D%2CugHs%2Cmit%5B1.00%3A243415958.00%5D%2Cgenes%5B1.00%3A243415958.00%5D&BEG=2q21&END=
2q21&thmb=on" target="_blank" onclick="getLink(document,this)">2q21</a>"
Public Shared Function getMapViewURL(ByRef
Band As Band) As String
Retuns a URL pointing to a map viewer information for that band.
Parameters
-
Band: a reference to a Band object describing
the band whose information is to be obtained from the map viewer.
Remarks
-
The method does not at all check the band for existence. If a band does
not exist, the map viewer will show an error when the link is followed.
-
The band is expected to be a band on a human chromosome. The link URL is
hard coded.
-
If HTML code linking the number of the band with the URL is required, use
the getMapViewLink function instead.
-
The type of map viewer is set in the MapViewer
property.
Examples
-
With band "2q21", getMapViewLink returns for the NCBI
map viewer "http://www.ncbi.nlm.nih.gov/mapview/maps.cgi?TAXID=9606&CHR=2&MAPS=ideogr%5B2pter%3A2qter%5D%2CugHs%2Cmit%5B1.00%3A243415958.00%5D%2Cgenes%5B1.00%3A243415958.00%5D&BEG=2q21&END=
2q21&thmb=on"
Public Shared Function getMaximumChromosomeHeight()
As Integer
Returns the maximum height of a chromosome ideogram in pixels.
Return Value
-
the maximum height of a chromosome ideogram.
Remarks
-
The maximum chromosome height is defined in the resources
file. It is used for pre-sizing the bitmaps of chromosome ideograms.
Examples
-
Within the standard CyDAS package, getMaximumChromosomeHeight
returns 1650.
Public Shared Function getMaximumChromosomeNumber()
As Integer
Returns the maximum number a chromosome can have.
Return Value
-
the maximum number of a chromosome.
Remarks
-
The maximum number of a chromosome is defined in the resources
file. With distinct species, distinct maximum numbers are likely to
be needed.
-
It is not the number of chromosomes in a normal karyotype of that species.
-
Besides chromosomes with numbers starting from 1, "X" and "Y" are valid
for denoting chromosomes.
Examples
-
Within the standard CyDAS package, the resource file defines human chromosomes,
and thus getMaximumChromosomeNumber returns 22.
Public Shared Function getMaximumResolutionForBand(ByVal
Chromosome As String, ByVal BandNumber As String) As eResolutionLevel
Returns the maximum value of the ResolutionLevel which the band described
by its chromosome and band number fulfills.
Parameters
-
Chromosome: the number of the chromosome.
-
BandNumber: the number of the band (including arm, but without
the chromosome number)
Remarks
-
Values for the resolution level are defined in the enumeration eResolutionLevel.
Examples
-
With chromosome 13 and band number q14, getMaximumResolutionForBand
returns "Resolution400Bands".
Public Shared Sub resetChromosomeUserColor()
Resets the colors used for drawing chromosome ideograms to the default
colors.
Remarks
Public Shared Sub setChromosomeUserColor(ByVal
Chromosome As String, ByRef UserColor As System.Drawing.Color)
Changes the color to be used for drawing an ideogram of the respective
chromosome.
Parameters
-
Chromosome: the number of the chromosome whose number is to be
changed.
-
UserColor: the color to be used for the ideogram of that chromosome.
Remarks
Interaction with other classes
Classes using ChromosomeData
The ChromosomeData class is used by
Band objects
to query their existence and paint data, by
Fragment
objects to determine contained bands, and by the
CyDASGraphics
class.
Classes used by ChromosomeData
The ChromosomeData class itself makes use of some other classes of the
CyDAS project, but always transiently only.
Internal Views
All functions start with a call to the init() function which determines
if the resources were already loaded from the
resources
file, and if necessary loads them. The data will then be held in class
variables in order to speed up the functions.