public interface FrequencyGenotypeData
extends uno.informatics.data.Data
BiAllelicGenotypeData
. For datasets with a fixed
number of allele observations per individuals, for each marker, the subtype
DefaultGenotypeData
can be used.Modifier and Type | Method and Description |
---|---|
double |
getAlleleFrequency(int id,
int markerIndex,
int alleleIndex)
Get the relative frequency of an allele for the given entry (sample/accession).
|
String |
getAlleleName(int markerIndex,
int alleleIndex)
Get the name of an allele, if assigned.
|
String |
getMarkerName(int markerIndex)
Get the name of a marker by index, if assigned.
|
int |
getNumberOfAlleles(int markerIndex)
Get the number of alleles for a given marker.
|
int |
getNumberOfMarkers()
Get the total number of markers used in this dataset.
|
int |
getTotalNumberOfAlleles()
Get the total number of allele across all markers.
|
boolean |
hasMissingValues(int id,
int markerIndex)
Indicates whether there are missing values (frequencies)
for the given entry (sample/accession) at the given marker.
|
default void |
writeData(Path filePath,
uno.informatics.data.io.FileType fileType)
Write data to file.
|
void |
writeData(Path filePath,
uno.informatics.data.io.FileType fileType,
org.jamesframework.core.subset.SubsetSolution solution,
boolean includeSelected,
boolean includeUnselected,
boolean includeIndex)
Write selected data to file.
|
int getNumberOfMarkers()
String getMarkerName(int markerIndex) throws ArrayIndexOutOfBoundsException
markerIndex
- the index of the marker within the range 0 to n-1, where n is the total number of
markers as returned by getNumberOfMarkers()
null
if no name has been setArrayIndexOutOfBoundsException
- if the index is out of rangeint getNumberOfAlleles(int markerIndex)
markerIndex
- the index of the marker within the range 0 to n-1, where n is the total number of
markers as returned by getNumberOfMarkers()
int getTotalNumberOfAlleles()
String getAlleleName(int markerIndex, int alleleIndex) throws ArrayIndexOutOfBoundsException
markerIndex
- the index of the marker within the range 0 to n-1, where n is the total number of markers as
returned by getNumberOfMarkers()
alleleIndex
- allele index within the range 0 to a-1, where a is the number of alleles for the given marker
as returned by getNumberOfAlleles(int)
null
if no name has been setArrayIndexOutOfBoundsException
- if the marker or allele index is out of rangedouble getAlleleFrequency(int id, int markerIndex, int alleleIndex)
id
- the id of the entry, must be one of the IDs returned by Data.getIDs()
markerIndex
- the index of the marker within the range 0 to n-1, where n is the total number of markers as
returned by getNumberOfMarkers()
alleleIndex
- allele index within the range 0 to a-1, where a is the number of alleles for the given marker
as returned by getNumberOfAlleles(int)
Double.NaN
if missingboolean hasMissingValues(int id, int markerIndex)
id
- the id of the entry, must be one of the IDs returned by Data.getIDs()
markerIndex
- the index of the marker within the range 0 to n-1, where n is the total number of
markers as returned by getNumberOfMarkers()
true
if some or all values are missing for the given marker in the given entrydefault void writeData(Path filePath, uno.informatics.data.io.FileType fileType) throws IOException
filePath
- file pathfileType
- FileType.TXT
or FileType.CSV
IOException
- if the data can not be written to the filevoid writeData(Path filePath, uno.informatics.data.io.FileType fileType, org.jamesframework.core.subset.SubsetSolution solution, boolean includeSelected, boolean includeUnselected, boolean includeIndex) throws IOException
filePath
- file pathfileType
- FileType.TXT
or FileType.CSV
solution
- the solution to subset the data (selected core)includeSelected
- includes selected accessions in output fileincludeUnselected
- includes unselected accessions output fileincludeIndex
- includes accession indices, i.e. the internal integer IDs used by the solutionIOException
- if the data can not be written to the fileCopyright © 2017. All rights reserved.