biostat0903 / DBSLMM

Deterministic Bayesian Sparse Linear Mixed Model
https://biostat0903.github.io/DBSLMM/
5 stars 3 forks source link

A beginner's question about example code #25

Open KaiYi1104 opened 1 year ago

KaiYi1104 commented 1 year ago

Hi Sheng,

I have a question regarding the example code:

let chr=1 DBSLMM=/mnt/hgfs/HDD/yi/dbslmm/DBSLMM.R summf=/mnt/hgfs/HDD/yi/dbslmm/summary_gemma_chr outPath=/mnt/hgfs/HDD/yi/dbslmm/out/ plink=/usr/lib/plink/plink ref=/mnt/hgfs/HDD/yi/dbslmm/ref_chr blockf=/mnt/hgfs/HDD/yi/dbslmm/chr m=cat ${summf}${chr}.assoc.txt | wc -l h2=0.5 nobs=sed -n "2p" ${summf}${chr}.assoc.txt | awk '{print $5}' nmis=sed -n "2p" ${summf}${chr}.assoc.txt | awk '{print $4}' n=$(echo "${nobs}+${nmis}" | bc -l)

Rscript ${DBSLMM} --summary ${summf}${chr}.assoc.txt --outPath ${outPath} --plink ${plink} --dbslmm ${dbslmm} --ref ${ref}${chr} --n ${n} --nsnp ${m} --block ${blockf}${chr}.bed --h2 0.5

Error in if (opt$model == "LMM" & opt$type == "t") { : argument is of length zero Execution halted

I have no idea about this problem.Could you give me a hand, please?

biostat0903 commented 1 year ago

Hi Kelly, Thanks for you attention to DBSLMM. DBSLMM support to model assumptions: 1) lmm; 2) dbslmm. The first one assumes the effect size follow normal distribution. We also provide a online version: https://pgs-server.com/.

Best, Sheng

KaiYi1104 commented 1 year ago

Hi Sheng,

Thanks for your response. May I ask how to solve this error?

Thanks

biostat0903 commented 1 year ago

"--model LMM" or "--model DBSLMM" might solve your probelm.

KaiYi1104 commented 1 year ago

It works. Thank you for your patience !

KaiYi1104 commented 11 months ago

Hi Sheng,

I have a question regarding the output:

Using 1e-6, no significant SNPs. Clumping time: 36.921 s. 87680 individuals to be included from reference FAM file. [WARNING] Do not consider the difference between reference panel and summary data ... 14100 SNPs to be included from reference BIM file. Reading summary data of small effect SNPs from [/mnt/hgfs/HDD/kaiyi/dbslmm/dbslmm_GWAS_chr3.txt] Number of SNP missing: 3 Number of allele discrepency: 0 Number of maf discrepency: 0 After filtering, 0 small effect SNPs are selected. Fitting model... Fitting time: 0.028456 seconds.

What does "Number of SNP missing" mean? I am sure that these three SNPs are all in my summary data and reference data. (There are just three SNPs in my summary data)

I have no idea why they are missing?

Thanks!

biostat0903 commented 11 months ago

Thanks for your consideration for DBSLMM. Please check data format of summary statistics. i) Do you use tab to split the column? ii) Do you sort the snps as their position?

Best, Sheng

KaiYi1104 commented 11 months ago

Thanks for your response!

I have successfully figured out it!

But I have another question: I have 16 variants in chr 1 but the output just include 15 variants. It showes "Number of SNP missing:0"

Does it mean that one of variants' effect size equal 0?

Using 1e-6, 4 SNPs are regarded as fixed effect. Clumping time: 11.365 s. 10000 individuals to be included from reference FAM file. [WARNING] Do not consider the difference between reference panel and summary data ... 44399 SNPs to be included from reference BIM file. Reading summary data of small effect SNPs from [/mnt/hgfs/HDD/kaiyi/dbslmm/s_EA_dbslmm_GWAS_chr1.txt] Number of SNP missing: 0 Number of allele discrepency: 0 Number of maf discrepency: 0 After filtering, 11 small effect SNPs are selected. Reading summary data of large effect SNPs from [/mnt/hgfs/HDD/kaiyi/dbslmm/l_EA_dbslmm_GWAS_chr1.txt] Number of SNP missing: 0 Number of allele discrepency: 0 Number of maf discrepency: 0 After filtering, 4 large effect SNPs are selected. Fitting model... Fitting time: 0.0143821 seconds.

Thanks!