Coder Social home page Coder Social logo

insitucor's People

Contributors

patrickjdanaher avatar

Watchers

 avatar  avatar

insitucor's Issues

vignette should deal with flat files

This vignette demonstrates the functionality of InSituCor using a precompiled example dataset. InSituCor can be run using the outputs of the FlatFiles export module [link?], specifically the counts file (_exprMat_file.csv) and the metadata file (_metadata_file.csv). To replicate the vignette with the flat files, the following steps should be followed:

#Load flat files
metadata <- read.csv("S0_metadata_file.csv")
counts <- read.csv("S0_exprMat_file.csv")

#prepare counts file
rownames(counts) <- counts$cell
counts <- counts[,-c(1,2,3)] #remove metadata columns
counts <- as.matrix(counts)

#prepare metadata
metadata$celltype <- metadata$RNA_nbclust_*_clusters #cell type column name will be long
conditionon <- metadata[, c("cell","celltype")]
rownames(conditionon) <- metadata$cell
conditionon$cell <- NULL

#prepare xy data
xy <- annot[,c("cell", "x", "y")] #the x and y coordinates

#cell type data
Celltype <- annot$celltype

cx requests

  • vignette from a bigger dataset, showing more of the post-hoc analysis choices to be made
  • show major module names in the network plot, or show hub genes names
  • ability to take seurat or tiledb as starting point
  • Consider expanding the Hands-on workflow to include interpretations after each step. For example, explanations of the parameters a user can adjust at each step.

error when only 1 module is created

Attribution analysis errors when there's only one module. Probably a matrix has been reduced to a vector due to a lack of a drop = FALSE argument.
Fix: put in a sensible error message that advises a higher "res" parameter

sparse to dense matrix conversions

These warnings cause slow downs and can turn into errors if the data is counts matrix is large enough.

image

Could find a way to rewrite these calculations using sparse matrix algebra, or maybe converting the non-zero values in the spaarse matrix to a data.table and doing the calculation on that.

check mismatched rownames

I was able to run through sparc where the cell_IDs in counts and the cell_IDs in conditionon were mismatched.

I think there should be a requirement to check this if the rownames are provided.

Its an easy mistake to make, especially if your 'conditionon' dataframe is reordered after a merge.

use_cells <- met[grep("neuron|L", cell_type),cell_ID]
resmismatch_cell_ID <- 
SPARC::sparc(counts = Matrix::t(normed)[sample(use_cells),] ## counts have out of order cell ids
             ,conditionon = data.frame(met[match(use_cells,cell_ID)
                                           ,.(cell_type = as.character(cell_type)
                                              ,nCount_falsecode
                                              ,nCount_negprobes
                                              ,nCount_RNA)]
                                       ,row.names = use_cells
                                       )
             ,celltype = as.character(met[match(use_cells,cell_ID)][["cell_type"]])
             ,neighbors = NULL
             ,radius = 0.1
             ,xy=as.matrix(met[match(use_cells,cell_ID)][,.(sdimx,sdimy)]
                           ,rownames = use_cells)
             )

bug when special characters appear in module names

A module had the probe for "HBA/HBB" in its name. Then attempts to print spatial plot .pngs with this name in the title errored, thinking the "/" was a new path.

Solution: module names should go through make.names()

Errors in one study

1: an error that was fixed by forcing the conditionon argument to be a data frame, not a data table:

Error in [.data.table(df, , i) :
j (the 2nd argument inside [...]) is a single symbol but column name 'i' is not found. Perhaps you intended DT[, ..i]. This difference to data.frame is deliberate and explained in FAQ 1.1.

2: "Error in solve.default(cov_bb): system is computationally singluar."
... the matrix coming out of the build_conditionon function had an eigenvalue ~= 0. This shouldn't be happening. The existing countermeasures must not have caught an edge case. Unclear what the edge case is.
(Using bigger neighborhoods, from radius = 0.1 to K = 50, solved this.)

  1. Warning about misaligned row names: part comes as a warning, the rest as a message. Make into one warning.

  2. The vignette used a radius-based default - change it to K-nearest?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.