1
$\begingroup$

I wanted to know why is it correct to transform SNP data to 0, 1, 2 format using a reference allele, for example: SNP1 with C/T alleles, transformation rules: CC = 2, CT = 1, TT = 0, to later apply machine learning algorithms for predict a specific trait?

I ask this because giving this ordinal values to SNP data may affect greatly the result of a classification model, since in a way, we are giving "more importance" to diploid "CC" with a bigger value of 2, than to diploid TT with a value 0.

Wouldn't it be better to transform the data into a binary format, where each SNP feature will be transformed to 16 possible combinations of ACGT alleles? The resulting dataset would be transformed so that each SNP will be represented by 16 columns with 0/1 values.

$\endgroup$
1
$\begingroup$

There is absolutely no reason to code genotypes using a quantitative or even ordinal factor. Genotype is a purely categorical factor and it's impossible to say whether CC is "greater" than CT, let alone to quantify the difference in magnitude (as opposed to really quantitative metrics of SNP quality such as depth, base quality, strand bias, etc). If you use a quantitative coding you will still get an answer but the genotype p-value or other measure of importance will be misleading.

E.g. if you use a linear model, $y=x'\beta$ then quantitative coding implies that, when we switch from TT to CT the response changes by exactly the same amount as when we switch from CT to CC, which doesn't make much sense. I agree that you should code it as a categorical factor with 16 or so levels.

$\endgroup$

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.