magnusdv / pedtools

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

`getAlleles()` output and marker names #14

Closed thoree closed 5 years ago

thoree commented 5 years ago

The output from getAlleles() below is not as I expected. The name given to the second marker, m2, appears to be ignored

#Case 2
library(pedtools)
s1 = singleton(1)
s2 = singleton(2)
m1 = marker(s1, name=  "locus", "1" = 1)
s1 = addMarkers(s1,m1)
m2 = marker(s2, name = "other locus", "2" = 2)
s2 = addMarkers(s2,m2)
getAlleles(list(s1,s2), ids =c("2", "1"))
#>   locus.1 locus.2
#> 1 "1"     "1"    
#> 2 "2"     "2"

Created on 2018-11-24 by the reprex package (v0.2.1)

magnusdv commented 5 years ago

Thanks, this is clearly not the intended behaviour. It seems getAlleles() doesn't handle pedigree lists where the components have different markers.