GithubHelp home page GithubHelp logo

Importing from Seurat about fateid HOT 20 CLOSED

dgrun avatar dgrun commented on August 18, 2024
Importing from Seurat

from fateid.

Comments (20)

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Hi,
I have ran the tutorial and all works. I am having trouble in how to make a list of elements with my own matrix (in generated in collaboration with Onur Basak) in the same way for the intestines dataset. Would you happen to have that script used for the intestines data or could I send someone a matrix along with cell/cluster IDs needed that might be able to do it quickly for me and send me the script? I usually up and running once I get of the ground. Ive tried for a couple of days to get it going.
Many thanks,
Kaz

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Hi,
I have problems at the start:

This first part I dont need I think because I already have clusters identified with the RaceID algorithm (done at Utrecht). But I try it anyhow since the next step below also gives errors.
If I run this:
tar <- c(6,7)
FMarker <- list(c("Hopx","Ascl1","Hes5"), "Plp1", "Mbp")
xf <- getFeat(x,tar,FMarker,fpv=.05)

I have this error:

xf <- getFeat(x,tar,FMarker,fpv=.05)
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
0 (non-NA) cases
In addition: Warning messages:
1: In y != i :
longer object length is not a multiple of shorter objec
R Environment
t length
2: In y == i :
longer object length is not a multiple of shorter object length

If I try this part:

rc <- reclassify(x, y, tar, clthr=.75, nbfactor=5, use.dist=FALSE, seed=12345, nbtree=NULL, q=0.9)
I have this error:

rc <- reclassify(x, y, tar, clthr=.75, nbfactor=5, use.dist=FALSE, seed=12345, nbtree=NULL, q=0.9)
Error in randomForest.default(xr, as.factor(pr), xt, nbtree = nbtree, :
Need at least two classes to do classification.

I have taken a pic of the items in the environment incase I have the wrong format of an object there.
Any help will be greatly appreciated. In the matrix, I used the unnormalised values since there is a step that does it near the start.
Any hints would be great.
Many thanks,
Kaz

P.S. apologies for the jpeg. I cant seem to move it around to the bottom.

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Hi,
I am not able to move beyond this part:

rc <- reclassify(x, y, tar, z=NULL,clthr=.9, nbfactor=5, use.dist=FALSE, seed=12345, nbtree=NULL, q=0.9)

rc <- reclassify(x, y, tar, z=NULL,clthr=.9, nbfactor=5, use.dist=FALSE, seed=12345, nbtree=NULL, q=0.9)
Error in randomForest.default(xr, as.factor(pr), xt, nbtree = nbtree, :
Need at least two classes to do classification.

Also, i notice that the ordering of cluster numbers is not the same. It shows up all as 1.

Would it be possible to send you a matrix with a list of cluster IDs so that perhaps I can follow better what you do whenever you have time and then I do the same for other datasets to come? It would be much easier for me to get this off the ground.

Many thanks,
Kaz

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Dear Dominic,
Many thanks.
I have it mostly working. I had to manually give the cell IDs as a vector as it was not going through if I uploaded as a file.
There are 2 more things if its okay to ask.
(1) The v file, I couldnt figure out what this could be as some of the earlier functions require this. Is it something to do with "vf1" or differential expression as something similar was mentioned in the reference manual?
(2) Is there a way to change some of the graphic features or parameters of plots? Is there an underlying package like ggplots that I can use to change cell colors over? The legends are always cut out of any plot and I have warnings like: Error in plot.new() : figure margins too large.
Maybe you have some across this.
Otherwise, I am nearly there.
Thanks a lot.
Kaz

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Hi,
I hope it is the last time I message you.

When I run these scripts:
pr <- plotFateMap(y,dr,k=2,m="tsne",trthr=.33,fb=fb,prc=TRUE)

pr <- prcurve(y,fb,dr,k=3,m="tsne",trthr=0.4,start=3)

I have this error:
Error in svd(xstar) : a dimension is zero

For this script:
trc <- dptTraj(x,y,fb,trthr=.25,distance="euclidean",sigma=1000)
I have this error:
Error in if (median((1:length(n))[y[n] == sub("t", "", j)]) < median((1:length(n))[y[n] != :
missing value where TRUE/FALSE needed

Is there a way I can fix these so there is a trajectory line appearing?
I thought it might be related to the fb list.
Thanks a lot.

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

R Workspace.zip

Script parly working2.zip

Hi,
The vignette works perfect at my end.
I attach the workspace and the script here.
I am starting with a reduced set of cells with only the most variable genes.
Maybe once I have the princurve part solved, the other minor issues with heatmaps can be solved too.
Thanks a lot.

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Dear Dominic,
I have it working, at least for the main thing I needed.

I mention it here incase anyone else wanted to do the same.
The colours, I wanted to make for clusters to have them match the other figures. The main target cells I would have liked in red since in the confocal pictures (as RFP) and other work in seurat, the target cluster is red. I saved the lists in this way:

write.csv(dr[["tsne"]][["D2"]], "coordinates.csv")

write.csv(pr[["pr"]][["t13"]][["s"]], "pr_t13.csv")

This allowed me to then just make a plot on ggplots with the trajectory lines and cells in the colours I want them to be. I attach the figure here too. Just to let anyone else know what they can do to customise it a bit more in their own way.

I wanted to show a plot in the main figure with the important genes.
Its the last command:

k <- impGenes(fb,"t13", "t12")
k <- impGenes(fb,"t13")

Error in hclust(d, method = method) : must have n >= 2 objects to cluster

I tried both ways. I am not able to figure out yet how to overcome this.

This might be related to last few errors i see in a few of the commands:

trc <- dptTraj(x,y,fb,trthr=.25,distance="euclidean",sigma=1000)

Error in if (median((1:length(n))[y[n] == sub("t", "", j)]) < median((1:length(n))[y[n] != :
missing value where TRUE/FALSE needed

g <- names(ps$nodes)[ps$nodes == 1]

Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
display list redraw incomplete

de <- diffexpnb(v,A=A,B=B,DESeq=FALSE,norm=FALSE,vfit=NULL,locreg=FALSE)

Error in 0:round(x[1] * length(A) + x[2] * length(B), 0) :
NA/NaN argument

#plotting fate bias:
gene2gene(x$v,x$y,"Olig2","Mbp")

I dont think I need to filter any cells with the trc function. But I run it anyways.

Its not important to do the differential expression. But it might be related upstream to the impgenes function. There is a part that is needed, the tn in the fb list, i,e, the name of target clusters. Is there a way or format to have this done in the fb file?

I am nearly there.
I will get back to it in the end of the week or the week after. There is no rush. I mention all here incase anyone else is troubleshooting too (although I am still new to R).

Many thanks.
Kaz

OLs+NB

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Workspace + Script.zip
Hi Dominic,
I attach here the workspace and script as a zip file.

Errors 1 and 3 below, I cant get around the bugs yet. For Error 2, I use seurat anyhow for acquiring DEGs, but maybe its related to the error 3 (the last thing I need). It would be nice to have a list of important genes that define the trajectories.
Many thanks, Kaz

Error 1:

trc <- dptTraj(x,y,fb,trthr=.25,distance="euclidean",sigma=1000)
Error in if (median((1:length(n))[y[n] == sub("t", "", j)]) < median((1:length(n))[y[n] != :
missing value where TRUE/FALSE needed

Error 2:

de <- diffexpnb(v,A=A,B=B,DESeq=FALSE,norm=FALSE,vfit=NULL,locreg=FALSE)
Error in 0:round(x[1] * length(A) + x[2] * length(B), 0) : NA/NaN argument

Error 3:

k <- impGenes(fb,"t13")
Error in hclust(d, method = method) : must have n >= 2 objects to cluster

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Dear Dominic,
Everything is now under control and working in my hands.
Basically absolutely all is working in my hands.
Many thanks for this.

In the impgenes plot, the number that run along the column in the heatmap, they refer to the clusters when I look at the Hermann Nature Methods paper in Fig 1C that shows this plot. As I have 8 clusters in total in this analysis, but there are 7 columns running along the heatmap. Is this because the expression values in each time point are compared with the final cell type (the 8th one) in the trajectory so the 8th one isnt shown? Just so I get my facts right when explain in results or figure legends.

Thanks very much.

from fateid.

dgrun avatar dgrun commented on August 18, 2024

from fateid.

kasumaz avatar kasumaz commented on August 18, 2024

Okay, everything is clear and smooth now.
Once again, many thanks.

from fateid.

Related Issues (3)

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.