xzhoulab / spark-analysis Goto Github PK
View Code? Open in Web Editor NEWspatially resolved data analysis
spatially resolved data analysis
I am new in bioinformatics, and I do not understand "Quantile-quantile plot" well in your paper.Could you please provide the code about it (Figure 2a) ? Thanks very much.
Hi! Thanks for the cool software. I downloaded the example simulated data from processed_data/sim_MOB_pattern2_fc3_tau35_count_power1.csv
and when I ran SpatialDE and SPARK on the data, I got 0 (SpatialDE) and 112 (SPARK) significant genes at qval < 0.05
. Is this (a single replicate of) the same data used for figure 1c/the expected result? If I understand the plot correctly, it seems that at FDR = 0.05, more genes should be recovered.
Code for spatialDE
counts = pd.read_csv("../SPARK-Analysis/processed_data/sim_MOB_pattern2_fc3_tau35_count_power1.csv", index_col = 0)
counts = counts.T[(counts > 0).sum(0) >= 3].T
x, y = zip(*[pos.split('x') for pos in counts.index])
sample_info = pd.DataFrame({
'x': np.array(x).astype(float),
'y': np.array(y).astype(float),
'total_counts': counts.sum(1)
})
norm_expr = NaiveDE.stabilize(counts.T).T
resid_expr = NaiveDE.regress_out(sample_info, norm_expr.T, 'np.log(total_counts)').T
X = sample_info[['x', 'y']]
results = SpatialDE.run(X, resid_expr)
(results.qval < 0.05).sum() # returns 0
Code for SPARK
countdata <- read.csv("../SPARK-Analysis/processed_data/sim_MOB_pattern2_fc3_tau35_count_power1.csv", row.names = 1)
rn <- row.names(countdata)
info <- cbind.data.frame(x = as.numeric(sapply(strsplit(rn, split = "x"), "[", 1)),
y = as.numeric(sapply(strsplit(rn, split = "x"), "[", 2)))
rownames(info) <- row.names(countdata)
spark <- CreateSPARKObject(counts = t(countdata), location = info[,1:2],
percentage = 0.1, min_total_counts = 10)
spark@lib_size <- apply(spark@counts, 2, sum)
spark <- spark.vc(spark, covariates = NULL, lib_size = spark@lib_size,
num_core = 1, verbose = T, fit.maxiter = 500)
spark <- spark.test(spark, check_positive = T, verbose = T)
spark <- spark.test(spark, check_positive = T, verbose = F)
sum(spark@res_mtest$adjusted_pvalue < 0.05) # returns 102
Hi, thank you for such an excellent SPARK software!
I'm currently working on spatial transcriptomic data, and want to use SPARK for some analysis. I checked the analysis steps you gave in github, and am very interested in the analysis of simulated data.
But when I looked through the "simulation/simulation_mouse_ob.R" file in it, I couldn't find the "Rep11_MOB_spark.rds" file used in the Data Generation and Noise Change steps.
Perhaps, would it be convenient to tell me how to get this rds file, or how this file is generated? It would be nice if you could provide a bit more information on the simulation steps.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.