Entering edit mode
6.3 years ago
Za
▴
140
Hi,
in this tutorial in spite of most of tutorials like making object in scater there is no something to help me how I adapt my own expression data in sc object
https://github.com/xu-lab/SINCERA/blob/master/demo/mouselung.e16.5.R
library(SINCERA)
# Loading E16.5 data
data("E16.5")
# expression matrix
dim(expressions)
# cell information
head(cells)
# gene information
head(genes)
# The analysis starts with running the construct function to create an R S4 object,
# which will hold all the data and analysis results.
sc <- construct(exprmatrix=expressions,
samplevector=paste("sample", cells$SAMPLE, sep=""))
I tried to replace my own data but returns error
> sc <- construct(exprmatrix=ipf.exprmatrix)
Error in construct(exprmatrix = ipf.exprmatrix) :
object 'rexpr' not found
>
>
and sc object already contains expression data and metadata
Any help please
Hello Za/F !
It appears that your post has been cross-posted to another site: https://bioinformatics.stackexchange.com/questions/4905/creating-an-r-s4-object
This is typically not recommended as it runs the risk of annoying people in both communities.
in the code you've posted, you aren't replacing the values that are currently stored in
sc
; you are constructing a brand-new object and storing that insc
. It may be possible to hack it so that you can update therexpr
entry of the pre-existingsc
usingsc@rexpr <- ipf.exprmatrix
. (I'd strongly urge you to construct a new object, or use whatever setter generics are provided by the author, rather than hacking the slots using@
, though)Sorry, but I am very bad in R and authors did not provide any information :(
Looking at the source code for sincera it looks like you've found a bug (see line 99 of https://github.com/xu-lab/SINCERA/blob/master/R/sincera.R ). Post as issue via github and make a pull request: you just need to change
rexpr
torexprs
. Sincera is throwing the error because it can't findrexpr
, a variable that isn't defined in theconstruct
function; it should really be looking forrexprs
Actually I can not figure out how to replace my own matrix
sc@ rexprs
exists but I don't know how to make Sincera objectBut then, you are doing exactly the same thing you've just been doing. The error is inside the source code for the
construct
function. You can get around it if you pass in asamplevector
in addition to yourexprmatrix
. Try downloading the github repo forsincera
, modify the line of code i told you about, install the package from your modified source code, and then see if the problem remains......
then when that works, clone the repo, fix the code, submit a PR and the package will be fixed for whoever uses it next. If you need someone to explain how to submit pull-requests etc, I'm happy to help
Thank you
By changing r
sampleinfo <- rep("sample1", dim(rexpr)[2]) to rsampleinfo <- rep("sample1", dim(rexprs)[2])
in source and running the source likely I construct my sincera object with my matrixI am going to try the rest but I got confused about
This data frame has been provided beforehand, does that mean I should have such a data frame before clustering and differential expression or this data frame would be produced after clustering and DE steps?