magnusdv / forrel

Forensic pedigree analysis and relatedness inference
GNU General Public License v2.0
10 stars 0 forks source link

Familias2ped - `please contact MDV #24

Closed thoree closed 5 years ago

thoree commented 5 years ago

Below, based on first example in the documentation of Familias2ped, I am adviced to contact MDV and I hereby comply:

library(Familias, quietly = TRUE)
library(forrel)
#> Loading required package: pedtools
data(NorwegianFrequencies)
TH01 = NorwegianFrequencies$TH01
locus1 = FamiliasLocus(TH01)
persons = c('mother', 'daughter', 'AF')
ped1 = FamiliasPedigree(id = persons,
                        dadid = c(NA, 'AF', NA),
                        momid = c(NA, 'mother', NA),
                        sex = c('female', 'female', 'male'))
datamatrix = data.frame(THO1.1=c(NA, 8, NA), THO1.2=c(NA,9.3, NA))
rownames(datamatrix) = persons
x = Familias2ped(ped1, datamatrix, locus1)
#> Warning in as.ped.data.frame(p, locus_annotations = annotations): Argument
#> `locus_annotations` is deprecated; use `locusAttributes` instead
#> Error: Genotype columns are sorted differently from `locusAttributes`. Please contact MDV

Created on 2019-08-11 by the reprex package (v0.3.0)

magnusdv commented 5 years ago

It took me 20 minutes to realise this error was entirely due to a "o vs 0" typo! (THO1 vs TH01.)

This is now fixed, and the code somewhat updated, as of 2db83cd.