df = data.frame(famid = c("S1", "S2"),
id = c("A", "B"),
fid = 0,
mid = 0,
sex = 1)
# gives a list of two singletons
as.ped(df)
# Trio
df1 = data.frame(id = 1:3, fid = c(0,0,1), mid = c(0,0,2), sex = c(1,2,1))
as.ped(df1)
# Disconnected example: Trio (1-3) + singleton (4)
df2 = data.frame(id = 1:4, fid = c(2,0,0,0), mid = c(3,0,0,0),
M = c("1/2", "1/1", "2/2", "3/4"))
as.ped(df2)
# Two singletons
df3 = data.frame(id = 1:2, fid = 0, mid = 0, sex = 1)
as.ped(df3)
# Add missing parents as founders
df4 = data.frame(id = 1, fid = 2, mid = 3, sex = 1)
as.ped(df4, addMissingFounders = TRUE)
Run the code above in your browser using DataLab