YiPeng-Gao / scDaPars

Dynamic Analysis of Alternative Polyadenylation from single-cell RNA-seq (scDaPars)
10 stars 1 forks source link

var_thre #11

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi, What do you base your var_thre value on?

raw_PDUI = read.table("Dapars_hESC_combined_all_chromosome.txt", header = TRUE, stringsAsFactors = F)
raw_PDUI_matrix_sc = raw_PDUI[,5:ncol(raw_PDUI)]
genenames = sapply(strsplit(raw_PDUI$Gene, "[|]"), `[`, 1)
row.names(raw_PDUI_matrix_sc) = genenames
raw_PDUI_matrix_sc = raw_PDUI_matrix_sc[order(row.names(raw_PDUI_matrix_sc)),]
raw_PDUI_matrix_sc = raw_PDUI_matrix_sc[which(rowSums(!is.na(raw_PDUI_matrix_sc)) >= ncol(raw_PDUI_matrix_sc) * 0.2),]
pass_cells_Dapars= names(which(colSums(!is.na(raw_PDUI_matrix_sc)) >= nrow(raw_PDUI_matrix_sc) * 0.1))
raw_PDUI_matrix_sc = subset(raw_PDUI_matrix_sc, select = which(colnames(raw_PDUI_matrix_sc) %in% pass_cells_Dapars))
raw_PDUI_matrix_sNA = raw_PDUI_matrix_sc
raw_PDUI_matrix_sNA[is.na(raw_PDUI_matrix_sNA)] = 0
var_thre = 0.4     # var_thre 
pca = prcomp(t(raw_PDUI_matrix_sNA))
eigs = (pca$sdev)^2
var_cum = cumsum(eigs)/sum(eigs)

What do you base your var_thre value on?

image

If I modify var_thre = 0.5, my data can be analyzed using scDaPars if i use var_thre = 0.4, run scDaPars,show error :

image

The screenshot of my data is as follows, pc1 = 0.4511342, so I want to consult you, can the value of var_thre be adjusted? What is the range of var_thre values? image

Thank you very much.

ghost commented 3 years ago

The source of this value is not explained in the literature image