-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDpred2 imputation #131
LDpred2 imputation #131
Conversation
I'm sure we can include |
I'll stick with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! I encountered some minor issues which were easily resolved (locally), as commented. You can merge #139 into this PR. Other than that:
- in the LDpred2/README.md height example, add the line
$RSCRIPT imputeGenotypes.R --impute-simple mean0 --geno-file-rds $fileGenoRDS
after creating$fileGenoRDS
itself. Otherwise it won't run. Either this, or add the--geno-impute-zero
argument to$RSCRIPT ldpred2.R ...
calls below - It was my bad suggestion to call the test directory for
LDpred2_example
. Perhaps this can by renamedLDpred2_test
in this PR?
@@ -112,8 +146,9 @@ LDP="$RSCRIPT $DIR_SCRIPTS/ldpred2.R \ | |||
--ld-meta-file $DIR_TESTS/output/ld/map.rds \ | |||
--merge-by-rsid \ | |||
--col-stat beta --col-stat-se beta_se \ | |||
--col-snp-id rsid --col-chr chr --col-bp pos --col-A1 a0 --col-A2 a1 \ | |||
--col-snp-id rsid --col-chr chr --col-bp pos --col-A1 a1 --col-A2 a0 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's a concern, but for this entire call a warning is thrown while merging dataframes, possibly on L220-222 in the LDpred2.R script:
Test no restrictions on snps (similar to tutorial)
Loading backingfile: /nrec/space/espenh/containers/usecases/LDpred2_example/data/public-data3.rds
### Reading LD reference meta-file from /nrec/space/espenh/containers/usecases/LDpred2_example/output/ld/map.rds
### Reading summary statistics /nrec/space/espenh/containers/usecases/LDpred2_tutorial/tutorial_data/public-data3-sumstats.txt
Loaded 50000 SNPs
Filtering SNPs based on --chr2use
Retained 50000 out of 50000
Matching sumstats to genotypes
50,000 variants to be matched.
0 ambiguous SNPs have been removed.
45,337 variants have been matched; 22,758 were flipped and 15,092 were reversed.
Matching sumstats to LD reference
45,337 variants to be matched.
0 ambiguous SNPs have been removed.
45,337 variants have been matched; 0 were flipped and 0 were reversed.
Warning message:
In merge.data.table(as.data.table(sumstats4), as.data.table(info_snp), :
column names 'pos.ss' are duplicated in the result
...
@espenhgn I think I've addressed all points. I renamed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a small unzip fix to /LDpred2_test/run.sh. Looks good to me!
Great, thanks! |
@ofrei Are you ok with merging this? |
Btw., it's fine if you merge this first. I expect a small conflict with #141 that I can fix before that one is merged. |
Fixes one part of #130. Closing #138
Changes proposed in this pull request:
usecases/LDpred2/imputeGenotypes.R
. Usingbigsnpr::fastImputeSimple
one can choose one of these methods, but I've also added zero "imputation" as described in the docs for this function.ldpred2.R
andcalculateLD.R
as described in LDpred2 issue with MoBa data(?) #124--geno-impute
fromldpred2.R
.--geno-impute-zero
can be passed instead.usecases/LDpred2/fun.R
to enable reuse and improved testingLDpred2_example/unittests/fun.R
.Before submitting
section of the
CONTRIBUTING
docs.Writing docstrings section of the
CONTRIBUTING
docs.