abelson-lab / scATOMIC

Pan-Cancer Single Cell Classifier
MIT License
57 stars 5 forks source link

Missing statement in create_summary_matrix #13

Closed benduc closed 11 months ago

benduc commented 11 months ago

Hi, Thanks for developing this excellent tool. I spotted that a statement is missing in the create_summary_matrix() function. It should be

else if (summary_master[i, "layer_5"] == "Cell low quality") {
        summary_master[i, "layer_5"] <- summary_master[i, 
          "layer_4"]
        layer_6[i] <- summary_master[i, "layer_4"]
        median_score_class_layer_5[i] <- NA
      }

instead of

else if (summary_master[i, "layer_5"] == "Cell low quality") {
        summary_master[i, "layer_5"] <- summary_master[i, 
          "layer_4"]
        layer_6[i] <- summary_master[i, "layer_4"]
      }

Otherwise it sometimes causes the error "Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: ..." when this code is called:

summary_master <- cbind(summary_master, median_score_class_layer_1, 
                        median_score_class_layer_2, median_score_class_layer_3, 
                        median_score_class_layer_4, median_score_class_layer_5, 
                       median_score_class_layer_6)

Cheers!

inofechm commented 11 months ago

Thank you for catching this bug! I have updated the package on the main branch to include this fix. Cheers, Ido