Coder Social home page Coder Social logo

mr-apss's People

Contributors

hxh0928 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mr-apss's Issues

LD clumping for MR-APSS

Hi Yang Lab,
I am trying to use MR-APSS for my analysis but I keep encountering a traffic issue for weeks for the LD clumping (see below) which severely impacts my use of MR-APSS. Is there any way you would recommend to overcome this issue? Thank you so much for your help!

Clumping h7AbIt, 440 variants, using EUR population reference
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server error: 502
Failed to retrieve results from server. See error status message in the returned object and contact the developers if the problem persists.

Best,
Jiayi

warning "rsxxxxx" is missing from the main dataset, and is a top variant.

Hi!

Thank you for providing such a good software for MR!
I'm trying to run MRAPSS between multiple traits and one disease.
I noticed the warnings for top variants like below in the log files for some traits. I wrote a pipeline for using your software so there are some log messages generated by my pipeline.
Should we worry the warnings? like would they affect the p values and beta?

thank you!
Lang

[1] "Exposure summary statsistic file: smri_area_cdk_ehinal_trait_1.txt"
[1] "Output directory is /home/liulang/scratch/project_MR_plus/MRAPSS_results"
[1] "IV threshold is 5e-05"
[1] "loading libraries"
[1] "loading data"
Begin formatting ....
The raw data set has 5959814 dat lines
Remove SNPs in MHC region ..., remaining 5947153 SNPs.
Remove duplicated SNPs ..., remaining 5947153 SNPs.
Merge SNPs with the hapmap3 snplist ..., remaining 1172044 SNPs.
Remove SNPs with MAF less than0.05, remaining 1067902 SNPs.
Remove SNPs with p-value < 0 or p-value > 1, remaining 1067902 SNPs.
Inferring z score from p value and b ...
Remove missing values, remaining 1067902 SNPs.
Remove SNPs with sample size 5 standard deviations away from the mean, remaining 1067902 SNPs.
Remove SNPs with chi2 > chi2_max ... , remaining 1067902 SNPs.
The formatted data has 1067902 dat lines.

[1] "Harmonizing GWAS summary statistics file"
Merge dat1 and dat2 by SNP ...
Harmonize the direction of SNP effects of exposure and outcome
Read in LD scores ...
Add LD scores to the harmonized data set...
The Harmonized data set will also be used for MR analysis

Begin estimation of C and Omega using LDSC ...
Estimate heritability for trait 1 ...
Loading required package: readr
Using two-step estimator with cutoff at 30.
Mean Chi2:1.1489.
Intercept: 0.9787(0.0091).
Total Observed scale h2:1.6804(0.1558).

Estimate heritability for trait 2 ...
Using two-step estimator with cutoff at 30.
Mean Chi2:1.1449.
Intercept: 0.9924 (0.0081).
Total Observed scale h2:0.0155 (0.0017).

Estimate genetic covariance ...
Using two-step estimator with cutoff at 30.
Intercept: -7e-04 (0.0059).
Total Observed scale gencov: 0.0104 (0.0093).
[1] "Performing clumping locally"
API: public: http://gwas-api.mrcieu.ac.uk/
Clumping dWhF34, 510 variants, using EUR population reference
PLINK v1.90b7 64-bit (16 Jan 2023) www.cog-genomics.org/plink/1.9/
(C) 2005-2023 Shaun Purcell, Christopher Chang GNU General Public License v3
Logging to /tmp/RtmphzmkPt/file13e900671af172.log.
Options in effect:
--bfile /home/liulang/scratch/reference_file/EUR
--clump /tmp/RtmphzmkPt/file13e900671af172
--clump-kb 1000
--clump-p1 0.999
--clump-r2 0.001
--out /tmp/RtmphzmkPt/file13e900671af172

257372 MB RAM detected; reserving 128686 MB for main workspace.
8550156 variants loaded from .bim file.
503 people (0 males, 0 females, 503 ambiguous) loaded from .fam.
Ambiguous sex IDs written to /tmp/RtmphzmkPt/file13e900671af172.nosex .
Using 1 thread (no multithreaded calculations invoked).
Before main variant filters, 503 founders and 0 nonfounders present.
Calculating allele frequencies... done.
Total genotyping rate is in [0.9999995, 1).
8550156 variants and 503 people pass filters and QC.
Note: No phenotypes present.
Warning: 'rs10476598' is missing from the main dataset, and is a top variant.
Warning: 'rs9872498' is missing from the main dataset, and is a top variant.
Warning: 'rs7245085' is missing from the main dataset, and is a top variant.

--clump: 67 clumps formed from 507 top variants.
Results written to /tmp/RtmphzmkPt/file13e900671af172.clumped .
Removing 443 of 510 variants due to LD with other variants or absence from LD reference panel
[1] "Performing MR!!!"


MR test results of smri_area_cdk_ehinal_trait_1.txt on PD :
MR-APSS: beta = 0.0161 , beta.se = 0.0113 , p-value = 1.5260e-01 .
Total NO. of IVs= 67 , NO. of valid IVs with foreground signals: 21.47213 .


[1] "Perfoming MR in another direction!!"


MR test results of PD on smri_area_cdk_ehinal_trait_1.txt :
MR-APSS: beta = 12.4122 , beta.se = 165.3641 , p-value = 9.4017e-01 .
Total NO. of IVs= 67 , NO. of valid IVs with foreground signals: 66.9933 .


[1] "drawing figures"
Directory '/home/liulang/scratch/project_MR_plus/MRAPSS_results/figure/' already exists.
Directory '/home/liulang/scratch/project_MR_plus/MRAPSS_results/figure/' already exists.
Directory '/home/liulang/scratch/project_MR_plus/MRAPSS_results/Rdata/' already exists.
Saving 7 x 7 in image
Saving 7 x 7 in image
[1] "saving Rdata"
[1] "program end"

[BUG]Prompting for non-conformable arguments when using MRAPSS::est_paras

Prompting for non-conformable arguments when using MRAPSS::est_paras.

Are the matrices multiplied in the correct dimension and order?

here is the code and output to repeat the problem.

library(MRAPSS)
library(TwoSampleMR)
IV=extract_instruments(c("ieu-a-27"),p1=5e-5)%>%
  MRAPSS::format_data(snp_col = "SNP",b_col = "beta.exposure",se_col = "se.exposure",
                      A1_col = "effect_allele.exposure",A2_col = "other_allele.exposure",
                      p_col = "pval.exposure",n=26836)
out=extract_outcome_data(IV$SNP,outcomes ="ebi-a-GCST90018808")%>%
  MRAPSS::format_data(snp_col = "SNP",b_col = "beta.outcome",se_col = "se.outcome",
                      A1_col = "effect_allele.outcome",A2_col = "other_allele.outcome",
                      p_col = "pval.outcome",n=470002)
MRAPSS::est_paras(IV,out,ldscore.dir = "data/eur_w_ld_chr")
Merge dat1 and dat2 by SNP ...
Harmonize the direction of SNP effects of exposure and outcome
Read in LD scores ... 
Add LD scores to the harmonized data set...                                                                                                         
The Harmonized data set will also be used for MR analysis 

Begin estimation of C and Omega using LDSC ...
Estimate heritability for trait 1 ...
Error in t(weighted.LD[from[i]:to[i], ]) %*% weighted.chi[from[i]:to[i],  : 
  non-conformable arguments

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.