xinhe-lab / ctwas

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

".exprqc.Rd" file required #3

Closed Chunmingl closed 1 year ago

Chunmingl commented 1 year ago

I am using imputed gene expression that was computed with other methods as ctwas_rss() input. I received an error message saying that “cannot open compressed file '/(path)/....chr1.exprqc.Rd', probable reason 'No such file or directory'”.While I have .exprand .exprvarfiles listed in the directory, would you please provide instructions about how to build .exprqc.Rd files and the format requirement of these files?

simingz commented 1 year ago

That file should be generated when you run impute_expr_z function. Did you run this function to impute gene z scores? Which version/branch did you use?

Chunmingl commented 1 year ago

I did not use impute_expr_z to impute the expression z scores, instead I used the formula in the function to compute z scores, z.g <- (t(wgt) * var.s) %*% z.s/sqrt(t(wgt) %*% Gamma.g %*% wgt)

I read that qclist(exprqc.Rd files) was computed fromweightall <- read_weight_predictdb() via

nwgt <- nrow(wgt.matrix) nmiss <- nrow(wgt.matrix)-length(snpnames) qclist[[gname]] <- list("n" = nwgt, "nmiss"= nmiss, "missrate"= nwgt/nmiss)

while

snpnames <- Reduce(intersect, list(rownames(wgt.matrix), ld_snpinfo$id, z_snp$id))

I wonder what are the ld_snpinfo and z_snp files about and what are their format requirements?

The version I am currently using is the main branch.

simingz commented 1 year ago

You can run the tutorial and it will generate .exprqc.Rd files after you run impute_expr_z. You can take a look at the format and generate your own exprqc.R files. The program will need to use the list variable wgtlist stored in the .exprqc.Rd file for downstream steps.