Question: R: pedigree analysis
0
gravatar for sara.aglantarek
12 months ago by
sara.aglantarek10 wrote:

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.

kinship2 pedigree R • 219 views
ADD COMMENTlink modified 12 months ago by zx875410.0k • written 12 months ago by sara.aglantarek10
2
gravatar for H.Hasani
12 months ago by
H.Hasani980
Freiburg, Germany
H.Hasani980 wrote:

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 COMMENTlink modified 12 months ago • written 12 months ago by H.Hasani980

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 REPLYlink written 12 months ago by sara.aglantarek10
2

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 REPLYlink written 12 months ago by Ram32k

OK got it. Thank you!

ADD REPLYlink modified 12 months ago • written 12 months ago by sara.aglantarek10

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 REPLYlink written 12 months ago by Ram32k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2126 users visited in the last hour
_