choishingwan / PRS-Tutorial

A tutorial on how to run basic polygenic risk score analysis
MIT License
70 stars 110 forks source link

Add Individual level PRS to .fam file #16

Closed XcodeBio closed 3 years ago

XcodeBio commented 3 years ago

Hi Sam,

Do you think the below code will match the final PRS (pred_inf) with the IDs in .fam file

y[, Inf.est := 0] y[, Inf.est := Inf.est + pred_inf] #Copied from the previous version of the tutorial.

so that each ID has PRS value attached to it

   FID     IID   Height Sex          PC1       PC2          PC3         PC4

1: HG00096 HG00096 169.1322 1 0.000643305 0.0664323 -1.47374e-02 -0.03599560 2: HG00097 HG00097 171.2563 2 0.001413780 0.0736016 8.81567e-03 -0.02058210 3: HG00099 HG00099 171.5344 2 0.002646810 0.0717702 -2.09757e-02 -0.00608687 4: HG00101 HG00101 169.8502 1 0.001697520 0.0854445 -1.56991e-02 -0.00289015 5: HG00102 HG00102 172.7884 2 0.004411350 0.0696362 1.75584e-06 -0.02643000 6: HG00103 HG00103 169.8630 1 -0.004312160 0.0571794 -8.19476e-03 -0.01349190 PC5 PC6 paternal.ID maternal.ID sex affection Inf.est 1: -0.0163573 -0.02093710 0 0 1 -9 32.44549 2: -0.0116844 0.02240870 0 0 2 -9 44.16233

Thank you.

choishingwan commented 3 years ago

It should if your y was formatted to follow the order of the fam, which should be achieved by

Reformat the phenotype file such that y is of the same order as the

sample ordering in the genotype file

y <- pheno[fam.order, on = c("FID", "IID")]

From: XcodeBio notifications@github.com Reply-To: choishingwan/PRS-Tutorial reply@reply.github.com Date: Monday, November 9, 2020 at 11:24 AM To: choishingwan/PRS-Tutorial PRS-Tutorial@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [choishingwan/PRS-Tutorial] Add Individual level PRS to .fam file (#16)

Hi Sam,

Do you think the below code will match the final PRS (pred_inf) with the IDs in .fam file

y[, Inf.est := 0] y[, Inf.est := Inf.est + pred_inf] #Copied from the previous version of the tutorial.

so that each ID has PRS value attached to it    FID     IID   Height Sex          PC1       PC2          PC3         PC4 1: HG00096 HG00096 169.1322 1 0.000643305 0.0664323 -1.47374e-02 -0.03599560 2: HG00097 HG00097 171.2563 2 0.001413780 0.0736016 8.81567e-03 -0.02058210 3: HG00099 HG00099 171.5344 2 0.002646810 0.0717702 -2.09757e-02 -0.00608687 4: HG00101 HG00101 169.8502 1 0.001697520 0.0854445 -1.56991e-02 -0.00289015 5: HG00102 HG00102 172.7884 2 0.004411350 0.0696362 1.75584e-06 -0.02643000 6: HG00103 HG00103 169.8630 1 -0.004312160 0.0571794 -8.19476e-03 -0.01349190 PC5 PC6 paternal.ID maternal.ID sex affection Inf.est 1: -0.0163573 -0.02093710 0 0 1 -9 32.44549 2: -0.0116844 0.02240870 0 0 2 -9 44.16233

Thank you.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.