Open AmruthaJNC opened 1 month ago
Is there a way to include multiallelic loci in the binary genotype data. I tried to do the following: binary_matrix <- ifelse(genotype_matrix == "0/0", 0, ifelse(genotype_matrix == "0/1" | genotype_matrix == "1/0", 1, ifelse(genotype_matrix == "1/1", 2, ifelse(genotype_matrix == "0/2" | genotype_matrix == "2/0", 3, ifelse(genotype_matrix == "1/2" | genotype_matrix == "2/1", 4, ifelse(genotype_matrix == "2/2", 5, ifelse(genotype_matrix == "0/3" | genotype_matrix == "3/0", 6, ifelse(genotype_matrix == "1/3" | genotype_matrix == "3/1", 7, ifelse(genotype_matrix == "2/3" | genotype_matrix == "3/2", 8, ifelse(genotype_matrix == "3/3", 9, NA))))))))))) i got this error: Error in treeWAS(snps = genotype_matrix2, phen = phenofinal, tree = tree, : snps must be a binary matrix
https://github.com/caitiecollins/treeWAS/wiki/2.-Data-&-Data-Cleaning#biallelic-loci
Is there a way to include multiallelic loci in the binary genotype data. I tried to do the following: binary_matrix <- ifelse(genotype_matrix == "0/0", 0,
ifelse(genotype_matrix == "0/1" | genotype_matrix == "1/0", 1,
ifelse(genotype_matrix == "1/1", 2,
ifelse(genotype_matrix == "0/2" | genotype_matrix == "2/0", 3,
ifelse(genotype_matrix == "1/2" | genotype_matrix == "2/1", 4,
ifelse(genotype_matrix == "2/2", 5,
ifelse(genotype_matrix == "0/3" | genotype_matrix == "3/0", 6,
ifelse(genotype_matrix == "1/3" | genotype_matrix == "3/1", 7,
ifelse(genotype_matrix == "2/3" | genotype_matrix == "3/2", 8,
ifelse(genotype_matrix == "3/3", 9, NA))))))))))) i got this error: Error in treeWAS(snps = genotype_matrix2, phen = phenofinal, tree = tree, : snps must be a binary matrix