xinhe-lab / ctwas

package for the causal TWAS project
https://xinhe-lab.github.io/ctwas/
MIT License
32 stars 12 forks source link

Obtain NaN when estimating parameters #21

Open MinghanQ opened 3 months ago

MinghanQ commented 3 months ago

Hi, I'm trying to run cTWAS analysis for several locus. When running parameter estimation, I get normal parameter results in the first step of rough estimate.

2024-05-21 22:16:06 INFO::After iteration 3, gene prior 0.0714285714285714:, SNP prior:0.000139378469065089
2024-05-21 22:16:06 INFO::Blocks are filtered: 56 blocks left

But in the second step of precise estimate, the gene prior is NaN after iteration 1.

2024-05-21 22:16:06 INFO::Run susie iteratively, getting accurate estimate ...
2024-05-21 22:16:06 INFO::run iteration 1
2024-05-21 22:18:44 INFO::After iteration 1, gene prior NaN:, SNP prior:0.000137847448790878

Although the code runs correctly until the end of iteration process, an error occurs during the next step of Run susie for all regions.

2024-05-21 23:35:38 INFO::Run susie for all regions.
2024-05-21 23:35:38 INFO::run iteration 1
Error in { : task 1 failed - "missing value where TRUE/FALSE needed"
In addition: There were 24 warnings (use warnings() to see them)

Here are the codes:

ctwas_rss(z_gene = z_gene_subset,
        z_snp = z_snp_subset,
        ld_exprvarfs = ld_exprvarfs,
        ld_R_dir = ld_R_dir,
        ld_regions = "ASN",
        ld_regions_version = "b37",
        outputdir = outputdir,
        outname = outname,
        ncore = 10)

I'd appreciate any suggestions or ideas on how to resolve this issue. Thank you in advance!