Skip to content

Commit

Permalink
Update deprecated igraph for 2.1, #69 #70
Browse files Browse the repository at this point in the history
  • Loading branch information
hpliner committed Jan 3, 2025
1 parent 4af0968 commit ad3e1f7
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 91 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: garnett
Type: Package
Title: Automated cell type classification
Version: 0.1.23
Version: 0.1.24
Author: c(
person("Hannah", "Pliner", email = "hpliner@uw.edu", role = c("aut", "cre")),
person("Cole", "Trapnell", email = "coletrap@uw.edu", role = c("aut")))
Expand Down
6 changes: 3 additions & 3 deletions R/classify_cells.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ run_classifier <- function(classifier,
for (v in igraph::V(classifier@classification_tree)){

child_cell_types <- igraph::V(classifier@classification_tree)[
suppressWarnings(outnei(v))]$name
suppressWarnings(.outnei(v))]$name

if (length(child_cell_types) > 0){
new_gate_res <- make_predictions(cds, classifier, v,
Expand All @@ -258,7 +258,7 @@ run_classifier <- function(classifier,
imputed_gate_res, level_table){

for (child in igraph::V(classifier@classification_tree)[
suppressWarnings(outnei(v))]){
suppressWarnings(.outnei(v))]){
curr_level <- paste0("level", tree_levels[child])
if(!curr_level %in% names(level_table)) {
level_table[[curr_level]] <- "Unknown"
Expand Down Expand Up @@ -362,7 +362,7 @@ make_predictions <- function(cds,
predictions <- tryCatch({
if(is.null(cvfit)) {
child_cell_types <- igraph::V(classifier@classification_tree)[
suppressWarnings(outnei(curr_node)) ]$name
suppressWarnings(.outnei(curr_node)) ]$name
predictions <- matrix(FALSE, nrow=nrow(pData(cds)),
ncol=length(child_cell_types),
dimnames=list(row.names(pData(cds)),
Expand Down
2 changes: 1 addition & 1 deletion R/get_training_sample.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ get_training_sample <- function(cds,
##### Find type assignment from expressed/not expressed #####

child_cell_types <- igraph::V(classifier@classification_tree)[
suppressWarnings(outnei(curr_node)) ]$name
suppressWarnings(.outnei(curr_node)) ]$name
parent <- igraph::V(classifier@classification_tree)[curr_node]$name
if (length(child_cell_types) > 0) {
if (length(intersect(child_cell_types,
Expand Down
6 changes: 3 additions & 3 deletions R/train_cell_classifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ train_cell_classifier <- function(cds,

for (v in igraph::V(classifier@classification_tree)){
child_cell_types <- igraph::V(classifier@classification_tree)[
suppressWarnings(outnei(v))]$name
suppressWarnings(.outnei(v))]$name

if(length(child_cell_types) > 0) {
### Get CDS subset for training ###
Expand All @@ -297,7 +297,7 @@ train_cell_classifier <- function(cds,
make_predictions(norm_cds,
classifier,
igraph::V(classifier@classification_tree)[
suppressWarnings(innei(v))]$name,
suppressWarnings(.innei(v))]$name,
rank_prob_ratio = 1.1,
s = "lambda.min")
if(!igraph::V(classifier@classification_tree)[v]$name %in%
Expand Down Expand Up @@ -557,7 +557,7 @@ propogate_func <- function(curr_node,
parse_list,
classifier) {
children <- igraph::V(classifier@classification_tree)[
suppressWarnings(outnei(curr_node))]$name
suppressWarnings(.outnei(curr_node))]$name

if(length(children) == 0) {
return(parse_list[[curr_node]]@expressed)
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ check_markers <- function(cds,
##### For each node #####
for (v in igraph::V(classifier@classification_tree)){
child_cell_types <-
igraph::V(classifier@classification_tree)[suppressWarnings(outnei(v))]$name
igraph::V(classifier@classification_tree)[suppressWarnings(.outnei(v))]$name

if(length(child_cell_types) == 0) next

Expand Down
1 change: 1 addition & 0 deletions garnett.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 1f11074e-b3a3-45d7-991d-16847e3f34b1

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
55 changes: 29 additions & 26 deletions tests/testthat/_snaps/utils/basic-marker-plot-change-amb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ad3e1f7

Please sign in to comment.