USDA-ARS-GBRU / crossword

2 stars 2 forks source link

Issue in identifying the correct REF and ALT alleles in get_genotypes( ) function #5

Closed leticialara closed 1 year ago

leticialara commented 1 year ago

Hi,

I'm trying to use crossword R package in R 4.0.3 but I'm getting wrong genotypes being infered in the get_genotypes( ) function. Example, my SNPx has "A" as reference allele and "G" as alternative allele. For the simulated progenies, after get_genotypes( ) function, the genotypes assigned to the new progenies are "TT", "TC", "CC". This mistake doesn't occur for all SNPs, only for some of them. I believe the error comes from the fun2( ) function (cppFunction). In the fun2( ) function, you are specifying CharacterVector geno1, CharacterVector geno2 as argument but only geno1 is being used within the function (in line 64: chr_x = geno1[x];). Please, could you check it and update this line to use the full ID of the marker? My recommendation is to test and replace this 64 command line by chr_x = geno[x];, as geno was specified previously as geno = rownames(parental_genotypes$genotypes) (in line 22).

Please, let me know your thoughts.

Best regards, Leticia Lara

leticialara commented 1 year ago

Hi,

I managed to sort it out. The issue wasn't in the line 64 as I initially imagined. It was due a condition to generate SNP1 and SNP2, in which is wasn't matched in my data for some specific markers.

Thank you!

Best regards, Leticia Lara