R: pedigree analysis
1
0
Entering edit mode
4.1 years ago

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.

R pedigree kinship2 • 1.4k views
ADD COMMENT
2
Entering edit mode
4.1 years ago
H.Hasani ▴ 990

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

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
2
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

OK got it. Thank you!

ADD REPLY
0
Entering edit mode

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one answer if they all work.

Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

Traffic: 3349 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6