n-mounier / bgwas Goto Github PK
View Code? Open in Web Editor NEWR package to perform Bayesian Genome-Wide Association Studies
License: GNU General Public License v2.0
R package to perform Bayesian Genome-Wide Association Studies
License: GNU General Public License v2.0
Dear author,
Another issue came along as I was using bGWAS (as in the title and below). I have checked the two ZMatrices files manually. There are large amount of SNPs in common among the gwas studies.
"allEC_unmunged"
Done!
0 SNPs in common between prior studies and the conventional GWAS
0 SNPs left after thresholding
breast cancer - Age of Menarche - PCOS - uterine fibroids - epithelial ovarian cancer - T2D - HDL cholesterol - hypertension - Pulse wave Arterial Stiffness index - Impedance of whole body - High light scatter retic ulocyte percentage - Creatinine (enzymatic) in urine - Alanine aminotransferase (U/L) - C-reactive protein (mg/L) - SHBG (nmol/L) - Ankle spacing width - Length of menstrual cycle - Vascular/heart problems diagnosed by doctor: Heart attack : removed (less than 2 instrument after thresholding)
0 studies left after thresholding
Pruning MR instruments...
distance : 500Kb
Then it stayed in this status for hours without progressing.
I read the original code, but didn't find a clue.
Do you have any idea what's going on?
Regards,
xuemin
Dear Ninon,
On the usage page, it indicates that multiple types o f SNP-identifier can be used (rs or rsid, snp, snpid, rnpid). However, it seems like bGWAS is unable to recognise snps stored in column "snpid", incidating an error below.
Error: Column rs
not found in .data
I also had a look at the help document and found no argument to change the 'rs' column to 'snpid'.
bGWAS(name, GWAS, Z_matrices = "~/ZMatrices/", prior_studies = NULL,
MR_threshold = 1e-06, MR_ninstruments = 3, MR_pruning_dist = 500,
MR_pruning_LD = 0, MR_shrinkage = 1, stepwise_threshold = NULL,
prior_shrinkage = NULL, sign_method = "p", sign_thresh = 5e-08,
use_permutations = FALSE, res_pruning_dist = 500,
res_pruning_LD = 0, save_files = FALSE, verbose = TRUE)
Is this a knows issue? I can update the column name in the ZMatrix, but it will be better for users if you can fix it.
Many thanks,
xuemin
Dear Ninon,
Recently I always encounter an error above while running bGWAS v1.0.2. I have used this version previously but this error never occurred; however, when I re-run the same analysis without any modification, the same error still occurred. Have you recently updated the package?
I tried to investigate the issue but was unsuccessful. Will you be able to fix this issue?
Many thanks,
patrick
Here is the script for the analysis:
B <- bGWAS(Z_matrices = file_directory,
name = output_name,
GWAS = MyGWAS,
prior_studies = NULL,
MR_threshold = 1e-6,
MR_ninstruments = 3,
MR_pruning_dist = 500,
MR_pruning_LD = 0,
MR_shrinkage = 1,
stepwise_threshold = NULL,
prior_shrinkage = NULL,
sign_method = "p",
sign_thresh = 1e-6,
use_permutations= FALSE,
res_pruning_dist = 500,
res_pruning_LD = 0,
save_files = TRUE,
verbose = TRUE)
and here are the log output:
<<< Preparation of analysis >>>
Checking parameters
The name of your analysis is: "bGWAS_allEC_26traits_1e-6".
The Z-Matrix files are stored in "C:\Users\xueminW\Desktop\allEC_bGWAS_26traits_exclude_RAFFH".
The conventional GWAS used as input is:ecac_mr_file_noUKBB_cleaned.txt.gz (ID = 1).
The analysis will be run in the folder: "C:/Users/xueminW/Desktop/allEC_bGWAS_26traits_exclude_RAFFH".
Files will be saved in: "C:/Users/xueminW/Desktop/allEC_bGWAS_26traits_exclude_RAFFH/bGWAS_allEC_26traits_1e-6".
The study ecac_mr_file_noUKBB_cleaned.txt.gz (ID=1) has been removed from the prior GWASs used to build the prior since it is used as conventionnal GWAS.
The p-value threshold used for selecting MR instruments is: 1e-06.
The minimum number instruments required for each trait is: 3.
The distance used for pruning MR instruments is: 500Kb.
Distance-based pruning will be used for MR instruments.
No shrinkage applied before performing MR.The p-value threshold used for stepwise selection will be derived according to the number of Prior GWASs used.
Using MR_shrinkage as default for prior_shrinkage:No shrinkage applied before performing calculating the prior.The p-value threshold used for stepwise selection will be derived according to the number of Prior GWASs used.
Significant SNPs will be identified according to p-value. The threshold used is :1e-06.
The distance used for pruning results is: 500Kb.
Distance-based pruning will be used for results.
List of files : C:/Users/xueminW/Desktop/allEC_bGWAS_26traits_exclude_RAFFH/bGWAS_allEC_26traits_1e-6/PriorGWASs.csv has been successfully created.
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
<<< Identification of significant prior GWASs for MR >>>
Creating the Z-Matrix of strong instruments
Selecting studies :
25 studies
260,208 SNPs
"ecac_mr_file_noUKBB_cleaned.txt.gz"
Done!
260,208 SNPs in common between prior studies and the conventional GWAS
177,573 SNPs left after thresholding
25 studies left after thresholding
Pruning MR instruments...
distance : 500Kb
1,478 SNPs left after pruning
Oestradiol : removed (less than 3 strong instrument after pruning)
24 studies left after thresholding+pruning
1,477 SNPs left after removing studies with only one strong instrument
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file 'PriorGWASs.tsv': Invalid argument
Dear Ninon,
I encounter an error message when I running bGWAS v1.0.2.. I tried to run your provided data without any modification. However, when I run the below code, there is always an error: ! Can't subset .data
outside of a data mask context.
A = bGWAS(name="Test_UsingSmallDataFrame",
GWAS = SmallGWAS_Timmers2019,
prior_studies = MyStudies,
stepwise_threshold = 0.05)
I tried to fix the issue but was unsuccessful. Would you please fix this issue?
Many thanks, ๐
Ching-Wen
Here is the script for the analysis:
A = bGWAS(name="Test_UsingSmallDataFrame",
GWAS = SmallGWAS_Timmers2019,
prior_studies = MyStudies,
stepwise_threshold = 0.05)
and here are the log output:
<<< Estimation of the prior >>>
Creating the full Z-Matrix
Selecting studies :
4 studies
6,811,310 SNPs
"GWAS"
Done!
286,807 SNPs in common between prior studies and the conventional GWAS
Computing prior
Chromosome 1
Running regression,
Calculating prior estimates for SNPs on this chromosome,
Calculating prior standard errors for SNPs on this chromosome,
Error:
! Can't subset .data
outside of a data mask context.
Run rlang::last_error()
to see where the error occurred.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.