From d42ed749e13ce6e9c6a1dd67bc7c6569b34ce35b Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sun, 20 Nov 2022 20:53:44 +0800 Subject: Fix the following errors while running create_edges0B.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ~/brain/Code$ python3 update_rnaseq_info_json.py Error in library(Rtsne) : there is no package called ‘Rtsne’ ~/brain/Code$ Rscript correlation_per_tissue.R Error in quantile.default(sd.1) : missing values and NaN's not allowed if 'na.rm' is FALSE --- Code/correlation_per_tissue.R | 2 +- Code/knn_classify.R | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'Code') diff --git a/Code/correlation_per_tissue.R b/Code/correlation_per_tissue.R index d9aadf9..0a16d4f 100644 --- a/Code/correlation_per_tissue.R +++ b/Code/correlation_per_tissue.R @@ -77,7 +77,7 @@ for (ul in unique.label) { X <- as.matrix(X0[, index.rnaseq]) sd.1 <- apply(X, 1, sd) # sd of each row s0 <- apply(X, 1, function(c) sum(c==0)) # number of zeros in each row - sd.tau <- (quantile(sd.1)[1] + quantile(sd.1)[2]) / 2.0 # min SD + sd.tau <- (quantile(sd.1, na.rm=TRUE)[1] + quantile(sd.1, na.rm=TRUE)[2]) / 2.0 # min SD good <- sd.1 > max(sd.tau, 0.05) tf_good <- which( good & (all_genes %in% tfs) == T ) target_good <- which( good & (all_genes %in% targets) == T ) diff --git a/Code/knn_classify.R b/Code/knn_classify.R index 46df992..995ae7b 100644 --- a/Code/knn_classify.R +++ b/Code/knn_classify.R @@ -39,6 +39,7 @@ rowsum.tau <- dim(X)[2] # the gene's TPM value is at least 1 on average sd.val <- apply(X, 1, sd) sd.tau <- summary(sd.val)[3] # genes whose gene expression varies least are to be filtered index <- rowSums(X) > rowsum.tau & sd.val > 10 +index[is.na(index)] <- FALSE n.train <- dim(X)[2] X.3 <- log(cbind(X[index,], X.2[index,]) + 1) -- cgit v1.2.1