jianyangqt / gcta

GCTA software
GNU General Public License v3.0
87 stars 26 forks source link

mtCOJO is LDSC derived bxy_est ever used? #104

Open nicksunderland opened 1 month ago

nicksunderland commented 1 month ago

Hi thanks for the great software,

I have been looking at the estimated bxy values used during the conditional analyses.

Is the ldsc_slope derived value ever used, over the gsmr_meta derived value?

ldsc_slope: https://github.com/jianyangqt/gcta/blob/55dbec43741a1138fcd53de84156413f920d201a/main/mtcojo.cpp#L2398 ?overwritten with gsmr_meta at: https://github.com/jianyangqt/gcta/blob/55dbec43741a1138fcd53de84156413f920d201a/main/mtcojo.cpp#L2406

gsmr_rst =  gsmr_meta(snp_instru, _meta_snp_b.col(i), _meta_snp_se.col(i), _meta_snp_pval.col(i), _meta_snp_b.col(0), _meta_snp_se.col(0), _meta_snp_pval.col(0), 0, snp_pair_flag, gwas_thresh, clump_wind_size, clump_r2_thresh, std_heidi_thresh, global_heidi_thresh, ld_fdr_thresh, nsnp_gsmr, pleio_snps, err_msg);

if(std::isnan(gsmr_rst[3])) {
    LOGGER.w(0, err_msg);
    LOGGER.i(0, "bxy is estimated from rg.");

    bxy_est(i-1) = ldsc_slope(i,0)*sqrt(ldsc_slope(0,0)/ldsc_slope(i,i));

    LOGGER.i(0, "bxy " + to_string(gsmr_rst[0]) + " " + to_string(gsmr_rst[1]));
}

// Saving pleiotropic SNPs
if(pleio_snps.size() > 0) {
    ss_pleio << _covar_pheno_name[i-1] << " " << _target_pheno_name << " " << pleio_snps << endl;
    pleio_flag = true;
}

bxy_est(i-1) = gsmr_rst[0];

LOGGER.i(0, "bxy " + to_string(gsmr_rst[0]) + " " + to_string(gsmr_rst[1]));
LOGGER.i(0, "GSMR analysis for covariate #" + to_string(i) + " (" + trait_name[i] + ") completed.");

Or is it just for printing / reporting purposes?

Thanks