Haplo Prediction
predict haplogroups
|
00001 /* 00002 * This work is licensed under a Creative Commons 00003 * Attribution-Noncommercial-Share Alike 3.0 United States License. 00004 * 00005 * http://creativecommons.org/licenses/by-nc-sa/3.0/us/ 00006 * 00007 * You are free: 00008 * 00009 * to Share - to copy, distribute, display, and perform the work 00010 * to Remix - to make derivative works 00011 * 00012 * Under the following conditions: 00013 * 00014 * Attribution. You must attribute the work in the manner specified by the 00015 * author or licensor (but not in any way that suggests that they endorse you 00016 * or your use of the work). 00017 * 00018 * Noncommercial. You may not use this work for commercial purposes. 00019 * 00020 * Share Alike. If you alter, transform, or build upon this work, you may 00021 * distribute the resulting work only under the same or similar license to 00022 * this one. 00023 * 00024 * For any reuse or distribution, you must make clear to others the license 00025 * terms of this work. The best way to do this is by including this header. 00026 * 00027 * Any of the above conditions can be waived if you get permission from the 00028 * copyright holder. 00029 * 00030 * Apart from the remix rights granted under this license, nothing in this 00031 * license impairs or restricts the author's moral rights. 00032 */ 00033 00034 00046 #ifndef INPUT_H 00047 #define INPUT_H 00048 00049 00050 #include <config.h> 00051 00052 #include <stdlib.h> 00053 #include <inttypes.h> 00054 00055 #include <jwsc/vector/vector.h> 00056 #include <jwsc/matrix/matrix.h> 00057 #include <jwsc/matblock/matblock.h> 00058 00059 00061 typedef enum 00062 { 00063 HAPLO_INPUT_TXT, 00064 HAPLO_INPUT_CSV, 00065 HAPLO_INPUT_XML 00066 } 00067 Haplo_input_format; 00068 00069 00071 Error* read_input 00072 ( 00073 Matblock_u8** ids_out, 00074 Vector_u32** labels_out, 00075 Matrix_i32** markers_out, 00076 const char* fname 00077 ); 00078 00079 00081 Error* read_aux_input 00082 ( 00083 Matblock_u8** ids_out, 00084 Vector_u32** labels_out, 00085 Matrix_i32** markers_out, 00086 const char* fname 00087 ); 00088 00089 00094 Error* impute_missing_markers_from_avg 00095 ( 00096 const Vector_u32* imp_labels, 00097 Matrix_i32* imp_markers, 00098 const Vector_u32* src_labels, 00099 const Matrix_i32* src_markers 00100 ); 00101 00102 00106 Error* impute_from_parent_of_haplogroup_index( 00107 uint32_t haplo_group_index, 00108 uint32_t marker_no, 00109 uint32_t sample_no, 00110 Matrix_i32* marker_sums, 00111 Matrix_i32* imp_markers 00112 00113 ); 00114 00115 00116 00121 Error* impute_missing_markers_from_nn 00122 ( 00123 Matrix_i32* imp_markers, 00124 const Matrix_i32* src_markers 00125 ); 00126 00127 00128 #endif