Hi again,
I have tried to run it on all the genes and it does not really cluster and then there are matrix errors down the line:
plt.figure(figsize=(8, 8))
plt.scatter(
embedding.T,
s=1,
c=gene_data.loc[“Calb2”, :].values,
vmin=0,
vmax=5e3,
cmap=“viridis”,
edgecolor=“none”
)
ValueError: ‘c’ argument has 4435 elements, which is inconsistent with ‘x’ and ‘y’ with size 45768.
And so I cannot finish the analysis.
I tried to make a file a few different ways, a simple csv list with column header ‘Gene’, a gene lists including quoted “”, and transposed into row version. I keep getting key errors.
markerGenes.head(3)
Gene
Lhx6
Myo5b
Pdlim3
embedding = umap.UMAP(n_neighbors=25).fit_transform(
np.log2(gene_data.loc[markerGenes[‘Gene’]].values.T + 1)
)
KeyError: ‘Gene’
And not specifying a header
embedding = umap.UMAP(n_neighbors=25).fit_transform(
np.log2(gene_data.loc[markerGenes[0]].values.T + 1)
)
KeyError: 0
I tried to follow the scratch.hicat demo in R and my script fails on:
cl.clean= cl.droplevels() with the error:
Error in UseMethod(“droplevels”) :
no applicable method for ‘droplevels’ applied to an object of class “c(‘double’, ‘numeric’)”
Head(cl)
Gad2_tdTpositive_cell_18 Gad2_tdTpositive_cell_25 Gad2_tdTpositive_cell_26
5 5 6
Gad2_tdTpositive_cell_40 Gad2_tdTpositive_cell_48 d2_tdTpositive_cell_49
6 6 5
Tried to get around this by just keeping outliers
cl.clean=cl
select.markers = select_markers(norm.dat, cl.clean, de.genes=de.genes,n.markers=50)$markers
head(select.markers)
[1] “Lhx6” “Myo5b” “Pdlim3” “Cdca7” “Odz3” “Plxdc2”
But this file does not work in jupyter either, so I thought need to continue until the end of the script to get the proper output but then cl.df errors
rank ← setNames(1:nrow(cl.df), row.names(cl.df))
Error in row.names(cl.df) : object ‘cl.df’ not found
I tried
rank ← setNames(1:nrow(ref.cl.df), row.names(ref.cl.df))
As I thought that might be what cl.df refers to
Error in cor(cl.dat) : ‘x’ has a zero dimension.
In addition: Warning message:
package ‘dplyr’ was built under R version 4.0.5
dend ← dend.result$dend
Error: object ‘dend.result’ not found
cl.clean ← setNames(factor(as.character(cl.clean), levels = labels(dend)), names(cl.clean))
Error in labels(dend) : object ‘dend’ not found
the tSNE clustering works but the Dendrograms fail and thus cannot finish the script.
Do you have an idea why my srattch.hicat is failing? What should the cl.df look like?
Do you think you could post a few lines of the select markers data to jupyter so I can then make a file of gene names?
Finally, I had hoped to have cell pairs of cells that were patched in the same experiment. And to identify which cell types they are and what their response was to stimulation in one of the cells in the clusters patched. From there I would like to look at the gene expression in the paired cells separated by MET type. Do you think this is possible with this data? Were the patched cells in the same set of patchings of different cell type? Is there a way to tell in the data which cells were patched in the same experiment?
Many thanks in advance for your reply, I am really keen to use this data