magnusdv / forrel

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

`markerindex` problem in `exclusionPower #23

Closed thoree closed 5 years ago

thoree commented 5 years ago

I have problems selecting the marker in exclusionPower; it seems that markerindex = 1 always, also in plot (great, not shown in reprex) rendered by exclusionPower:

library(forrel, quietly =T)
claim = nuclearPed(1)
true = list(singleton(1), singleton(3))
p1 = c(0.5, 0.5)
m1 = marker(claim,
           `3` = c(1, 1),
           alleles = c(1, 2),
           afreq = p1)
claim = addMarkers(claim, m1)
p2 = c(0.25, 0.75)
m2 = marker(claim,
            `3` = c(2, 2),
            alleles = c(1, 2),
            afreq = p2)
claim = addMarkers(claim, m2)
PE1 = exclusionPower(claim, true, ids = 1, markerindex = 1,
                     verbose = FALSE)
PE2 = exclusionPower(claim, true, ids = 1, markerindex = 2,
                     verbose = FALSE)
PE1 == PE2 # should be false
#> [1] TRUE
PE2 == p2[1]^2 # should be TRUE
#> [1] FALSE

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