Actually the regular ped file format is like this... dadid and momid has to be on the same row of the proband, because the proband have to be linked to the parents ids for kinship2 to recognize it as a family. And 0 in the row of dad and mom.
Hi everyone! I'm asking a question related to R. I'm not an R user, but it's the only tool that can get me this done.
I'm uploading to R a pedigree file that looks like this:
famid id dadid momid sex pheno
EPBL-0001 epbl0001 epbl0003 epbl0002 2 2
EPBL-0001 epbl0002 0 0 2 1
EPBL-0001 epbl0003 0 0 1 1
EPBL-0004 epbl0004 epbl0006 epbl0005 2 2
EPBL-0004 epbl0005 0 0 2 1
EPBL-0004 epbl0006 0 0 1 1
EPBL-0007 epbl0007 epbl0009 epbl0008 2 2
EPBL-0007 epbl0008 0 0 2 1
EPBL-0007 epbl0009 0 0 1 1
Family id unique for the whole family, ids unique for every patient, dadid and momid are the same of the respective id et cetera...
I'm using package kinship2 which can read the ped file and create pedigree plots.
This is the command giving me problems:
pedAll <- pedigree(id= multisample$id, dadid = multisample$dadid, momid = multisample$momid, sex= multisample$sex, famid = multisample$famid, affected= cbind(multisample$pheno))
and this is the error, that I don't get:
Error in pedigree(id = multisample$id, dadid = multisample$dadid, momid = multisample$momid, :
Value of 'dadid' not found in the id list EPBL-0001/0 EPBL-0001/0 EPBL-0004/0 EPBL-0004/0 EPBL-0007/0
Thank you in advance.
1 answer
I think it is because you have "0" as dadid and momid, you probably have to explicitly specify the parameter missid to "0" because id is not numeric or simply replace it by empty string.
please check the function's help page
H.Hasani is right. Please read the manual:
The default for missid is 0 if the id variable is numeric, and "" (the empty string) otherwise.
Because your id is not numeric, you'll need to set missid=0 explicitly.
Log in to answer this question.
