Read the a row-by-row collection of data samples from a file.
More...
#include <config.h>
#include <stdlib.h>
#include <inttypes.h>
#include <jwsc/vector/vector.h>
#include <jwsc/matrix/matrix.h>
#include <jwsc/matblock/matblock.h>
Go to the source code of this file.
Enumerations |
enum | Haplo_input_format { HAPLO_INPUT_TXT,
HAPLO_INPUT_CSV,
HAPLO_INPUT_XML
} |
| Types of input file format to read. More...
|
Functions |
Error * | read_input (Matblock_u8 **ids_out, Vector_u32 **labels_out, Matrix_i32 **markers_out, const char *fname) |
| Reads the IDs, haplo labels and markers from a file.
|
Error * | read_aux_input (Matblock_u8 **ids_out, Vector_u32 **labels_out, Matrix_i32 **markers_out, const char *fname) |
| Reads the IDs, haplo labels and markers from an auxiliary file.
|
Error * | impute_missing_markers_from_avg (const Vector_u32 *imp_labels, Matrix_i32 *imp_markers, const Vector_u32 *src_labels, const Matrix_i32 *src_markers) |
| Imputes missing marker values (zero) with their label-dependent mean value.
|
Error * | impute_from_parent_of_haplogroup_index (uint32_t haplo_group_index, uint32_t marker_no, uint32_t sample_no, Matrix_i32 *marker_sums, Matrix_i32 *imp_markers) |
| imputes a given marker with the values from the parent haplogroup this happens when we have only one sample with a given haplogroup
|
Error * | impute_missing_markers_from_nn (Matrix_i32 *imp_markers, const Matrix_i32 *src_markers) |
| Imputes missing marker values (zero) from nearest neighbor interpolation.
|
Detailed Description
Read the a row-by-row collection of data samples from a file.
- Author:
- Joseph Schlecht
- License:
- Creative Commons BY-NC-SA 3.0
Definition in file input.h.
Enumeration Type Documentation
Types of input file format to read.
- Enumerator:
HAPLO_INPUT_TXT |
|
HAPLO_INPUT_CSV |
|
HAPLO_INPUT_XML |
|
Definition at line 61 of file input.h.
Function Documentation
Reads the IDs, haplo labels and markers from a file.
- Parameters:
-
ids_out | Result parameter. If opts.id_cols is zero *ids_out will be NULL. |
labels_out | Result parameter. If opts.labels_col is zero *labels_out will be NULL. |
markers_out | Result parameter. Will always be defined, unless there was an error reading the file. |
fname | Data file to read. |
Definition at line 1054 of file input.c.
Reads the IDs, haplo labels and markers from an auxiliary file.
- Parameters:
-
ids_out | Result parameter. If opts.id_cols is zero *ids_out will be NULL. |
labels_out | Result parameter. If opts.labels_col is zero *labels_out will be NULL. |
markers_out | Result parameter. Will always be defined, unless there was an error reading the file. |
fname | Data file to read. |
Definition at line 1109 of file input.c.
Imputes missing marker values (zero) with their label-dependent mean value.
- Parameters:
-
imp_labels | Labels to use for selecting samples to impute markers from. |
imp_markers | Marker values of zero are imputed. |
src_labels | Labels to use for selecting samples to impute markers from. |
src_markers | Markers to use for imputing values. |
- Note:
- The imputed and source sets can be the same.
Definition at line 1208 of file input.c.
Error* impute_from_parent_of_haplogroup_index |
( |
uint32_t |
haplo_group_index, |
|
|
uint32_t |
marker_no, |
|
|
uint32_t |
sample_no, |
|
|
Matrix_i32 * |
marker_sums, |
|
|
Matrix_i32 * |
imp_markers |
|
) |
| |
imputes a given marker with the values from the parent haplogroup this happens when we have only one sample with a given haplogroup
Imputes missing marker values (zero) from nearest neighbor interpolation.
- Parameters:
-
imp_markers | Marker values of zero are imputed. |
src_markers | Markers to use for imputing values. |
- Note:
- The imputed and source sets can be the same.
Definition at line 1301 of file input.c.