cumc / xqtl-protocol

Molecular QTL analysis protocol developed by ADSP Functional Genomics Consortium

Home Page:https://cumc.github.io/xqtl-protocol/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue on Projection of related individuals phase

frarosamilia opened this issue · comments

I am trying to perform the projection of related individual phase but I got this error:

`

_`Error in quantile.default(pc$mahal, probs = prob): missing values and NaN's not allowed if 'na.rm' is FALSE
Traceback:

1. calc_mahalanobis_dist(dat$pc_scores, dat$pc_median, dat$pc_cov, 
 .     name = dat$meta)   # at line 14 of file <text>
2. quantile(pc$mahal, probs = prob)   # at line 8 of file <text>
3. quantile.default(pc$mahal, probs = prob)
4. stop("missing values and NaN's not allowed if 'na.rm' is FALSE")`_
`

I tried to run things interactively and seems I have the pc_scores with a lot of NAs in the PCs greater than 2, even since I settled the maha-k and the --k as 2.
Screenshot 2022-10-31 at 12 11 40

the weird thing is that the same process, with the same parameters worked fine in a different cohort of patients.
BUT if I tried to run step by step the R process for projecting samples for the cohort of patients that worked fine, I get a different error:

`Error in UseMethod("select"): no applicable method for 'select' applied to an object of class "NULL"
Traceback:

1. calc_mahalanobis_dist(dat$pc_scores, dat$pc_median, dat$pc_cov, 
 .     name = dat$meta)   # at line 33 of file <text>
2. x %>% select("IID", "FID", "pop", starts_with("PC"))   # at line 3-4 of file <text>
3. select(., "IID", "FID", "pop", starts_with("PC"))`

Let me know for other details and If I can help in any ways

A key player related to the first issue is that the k is set to 2 when generating the pca, but we should see how we can accommodate such low pcs nonetheless.

a potential cause of the second issue is version of software. I think if u run it within the container it should not give u this error.

for the second error, that could be for sure the reason why all worked smoothly and I got the error when I ran step by step without the container

Ok, the problem was solved when I tried to re run all the pipeline again,
that seems some k inconsistency problem maybe due to some cache.