magnusdv / pedtools

Tools for working with pedigrees in R
GNU General Public License v3.0
23 stars 3 forks source link

Markers with same names allowed #27

Closed thoree closed 4 years ago

thoree commented 4 years ago
library(pedtools)
x = nuclearPed(mo = "Mo")
m1 = marker(x, name = "M1", Mo = "1/2")
m2 = marker(x, name = "M1", Mo = "1/1")
x = setMarkers(x, list(m1, m2))
genotype(x,  "M1", "Mo")
#> [1] "1" "2"

Created on 2020-08-02 by the reprex package (v0.3.0)

magnusdv commented 4 years ago

Thanks, this should now be caught in setMarkers():

library(pedtools)
x = nuclearPed()
m1 = marker(x, name = "M1")
m2 = marker(x, name = "M1")
x = setMarkers(x, list(m1, m2))
#> Error: Duplicated marker name: M1

Created on 2020-08-02 by the reprex package (v0.3.0)