Skip to content

Commit

Permalink
changed instances of 1:x to seq_len()
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Totty authored and Michael Totty committed Mar 20, 2024
1 parent 9cde296 commit e757ebb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/findArtifacts.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ findArtifacts <- function(spe, mito_percent="expr_chrM_ratio",

# ======= Calculate local mito variance ========
var_matrix <- c()
for (i in 1:n_rings) {
for (i in seq_len(n_rings)) {

# ==== local mito variance ====
# get n neighbors for i rings
Expand Down
2 changes: 1 addition & 1 deletion R/localOutliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ localOutliers <- function(spe,
mod_z_matrix <- array(NA, nrow(dnn))

# Loop through each row in the nearest neighbor index matrix
for (i in 1:nrow(dnn)) {
for (i in seq_len(nrow(dnn))) {
dnn.idx <- dnn[i, ]
mod_z_matrix[i] <- modified_z(spaQC[c(i, dnn.idx[dnn.idx != 0]), ][[metric_to_use]])[1]
}
Expand Down
2 changes: 1 addition & 1 deletion R/localVariance.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ localVariance <- function(spe, n_neighbors = 36, features = c("expr_chrM_ratio")
colnames(mean_matrix) <- features_to_use

# Loop through each row in the nearest neighbor index matrix
for (i in 1:nrow(dnn)) {
for (i in seq_len(nrow(dnn))) {
dnn.idx <- dnn[i, ]
for (j in seq_along(features_to_use)) {
var_matrix[i, j] <- var(spaQC[c(i, dnn.idx[dnn.idx != 0]), ][[features_to_use[j]]], na.rm=TRUE)[1]
Expand Down

0 comments on commit e757ebb

Please sign in to comment.