ADD COMMENT
• link
updated 3.2 years ago by
Ram
45k
•
written 3.3 years ago by
Rob
▴
170
0
Entering edit mode
I deleted the other post you opened for this as it's already being addressed here. Please stop spamming the forum with multiple threads addressing the same problem, or your account will be suspended.
rawdata <- read.csv("data.csv", header = TRUE,row.names = 1, stringsAsFactors = FALSE, check.names = F) #rawdata is a count matrix
metadata <- read.table("Clinical.txt", header = TRUE, row.names = 1, stringsAsFactors = TRUE) #metadata is a table of samples' information
install the packages your heart desires
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("SummarizedExperiment")
# Now, load all packages, ** including those just installed **
library(Biobase)
library(GenomicRanges)
library(tibble)
library(dplyr)
library(DESeq2)
library(SummarizedExperiment) # <-- very likely what you were missing.
Try me again:
se <- SummarizedExperiment(exprs(rawdata)) ## how you like me now
colData(se) <- DataFrame(pData(metadata))
dds <- DESeqDataSet( se, design = ~ 1 )
# I recommend posting this as a separate question if you really cannot figure it out after reading a lot
dds <- estimateSizeFactors( dds )
logcounts <- log2( counts(dds, normalized=TRUE) + 1 )
pc <- prcomp( t( logcounts ) )
Thanks that was the problem.
I have another problem now in this part:
library(DESeq2)
dds <- DESeqDataSet( se, design = ~ 1 )
error is: renaming the first element in assays to 'counts'
Error in DESeqDataSet(se, design = ~1) :
counts matrix should be numeric, currently it has mode: list
thanks this works but in the remaining I get error again.
se <- SummarizedExperiment(exprs(rawdata)) ## how you like me now
colData(se) <- DataFrame(pData(metadata))
dds <- as(se, "DESeqDataSet") ##this works
# I recommend posting this as a separate question if you really cannot figure it out after reading a lot
dds <- estimateSizeFactors( dds ) ##error here
logcounts <- log2( counts(dds, normalized=TRUE) + 1 )
pc <- prcomp( t( logcounts ) )
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'rowMeans': invalid 'dimnames' given for data frame
At this point, I would consider taking a laptop with the computer to an organization with data scientists. for instance, if you have an affiliation with a university, perhaps some on-campus weekly tech help thing.
The reason is, to really help you here, at this point Id have to see all of the objects you've made. that's hard to do over the internet but comparatively easy in person
I deleted the other post you opened for this as it's already being addressed here. Please stop spamming the forum with multiple threads addressing the same problem, or your account will be suspended.
Rob I apologize, I did not see this comment in the answer:
I'll reopen your other question.