public class RevGenotypeValues extends java.lang.Object implements GenotypeValues
Class RevGenotypeValues is a wrapper for a GenotypeValues
instance. The wrapper reverses the order of markers in the wrapped object.
RevGenotypeValues are thread-safe.| Constructor and Description |
|---|
RevGenotypeValues(GenotypeValues gv)
Constructs a new
RevGenotypeValues instance from the specified
data. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int sample,
double[] values)
Adds the specified genotype values to the stored genotype values
for the specified sample.
|
void |
add(int marker,
int sample,
int genotype,
double value)
Adds the specified genotype value to the stored genotype value.
|
Marker |
marker(int marker)
Returns the specified marker.
|
Markers |
markers()
Returns the list of markers.
|
int |
nMarkers()
Returns the number of markers.
|
int |
nSamples()
Returns the number of samples.
|
Samples |
samples()
Returns the list of samples.
|
java.lang.String |
toString()
Returns a string representation of
this. |
float |
value(int marker,
int sample,
int genotype)
Returns the specified genotype value.
|
public RevGenotypeValues(GenotypeValues gv)
RevGenotypeValues instance from the specified
data.gv - genotype values that will be wrapped by the new instancejava.lang.NullPointerException - if gv == nullpublic float value(int marker,
int sample,
int genotype)
GenotypeValuesvalue in interface GenotypeValuesmarker - a marker indexsample - a sample indexgenotype - a genotype indexpublic void add(int sample,
double[] values)
GenotypeValues
for (m=0; m<this.nMarkers(); ++m) {
offset = this.markers().sumGenotypes(m);
for (gt=0; gt<this.marker(m).nGenotypes(); ++gt) {
this.add(marker, sample, gt, values[offset + gt])
}
}
add in interface GenotypeValuessample - a sample indexvalues - an array of length this.markers.sumGenotypes()
containing the genotype values to be added.public void add(int marker,
int sample,
int genotype,
double value)
GenotypeValuesadd in interface GenotypeValuesmarker - a marker indexsample - a sample indexgenotype - a genotype indexvalue - the value to be addedpublic Samples samples()
GenotypeValuessamples in interface GenotypeValuespublic int nSamples()
GenotypeValuesnSamples in interface GenotypeValuespublic Marker marker(int marker)
GenotypeValuesmarker in interface GenotypeValuesmarker - a marker indexpublic Markers markers()
GenotypeValuesmarkers in interface GenotypeValuespublic int nMarkers()
GenotypeValuesnMarkers in interface GenotypeValuespublic java.lang.String toString()
GenotypeValuesthis. The exact details
of the representation are unspecified and subject to change.toString in interface GenotypeValuestoString in class java.lang.Objectthis