Announcement
Collapse
No announcement yet.
X
-
There appeared to be a row of NAs but how is that possible? When I checked countData.csv,all counts were integers. Did the NAs somehow get introduced upon import?
Code:countData = read.csv (file.choose(), header=TRUE, row.names=1)
Leave a comment:
-
That means that you have some NA's in the matrix, which should only have non-negative integers.
You can try to find them with:
Code:narows <- apply(countData, 1, function(x) any(is.na(x))) table(narows)
Code:countDataClean <- countData[ !narows, ]
Leave a comment:
-
Likely unrelated, but you shouldn't have fractional counts.
The summary indicates that you have NA ("not applicable") somewhere. You probably just have a row of them, so:
Code:countData[which(is.na(countData[,1])),]
Leave a comment:
-
same error
I am getting the same error as OP. What are you guys referring to when you say NAs?
I have 24 samples: 2 treatment groups, 6 subjects with 2 time points each.
My code is as follows:
Code:designframe <- data.frame(row.names = colnames(countData), tx = factor(c(rep("c",12),rep("g",12))), patient = factor(c("1","1","2","2","3","3","4","4","5","5", "6","6","1","1","2","2","3","3","4","4","5","5","6","6")), time = factor(c(rep(1:2,12)))) patient <- factor(designframe$patient) tx <- factor(designframe$tx) time <- factor(designframe$time) designframe <- data.frame(tx,patient,time) dds <- DESeqDataSetFromMatrix(countData, colData = designframe, formula(~patient+time+tx:time))
Error in if (any(assay(se) < 0)) { :
missing value where TRUE/FALSE needed
The "sanity checks" yield the following:
Code:> class(countData) [1] "data.frame" > dim(countData) [1] 51798 24 > apply(countData, 2, summary) C211BL C211M3 C215BL C215M3 C220BL C220M3 C305BL C305M3 C317BL C317M3 C324BL Min. 0.0 0.0 0.0 0.0 0.0 0.00 0.00 0.0 0.0 0.0 0.0 1st Qu. 0.0 0.0 0.0 0.0 0.0 0.00 0.00 0.0 0.0 0.0 0.0 Median 0.0 0.0 0.0 0.0 0.0 0.00 0.00 0.0 0.0 0.0 0.0 Mean 288.3 112.4 231.4 159.2 404.6 59.02 74.74 254.6 273.5 327.6 162.1 3rd Qu. 19.0 8.0 17.0 10.0 24.0 2.00 6.00 19.0 15.0 24.0 14.0 Max. 3128000.0 863800.0 2138000.0 746700.0 1714000.0 211400.00 494600.00 1805000.0 5676000.0 5882000.0 419700.0 NA's 1.0 1.0 1.0 1.0 1.0 1.00 1.00 1.0 1.0 1.0 1.0 C324M3 G211BL G211M3 G215BL G215M3 G220BL G220M3 G305BL G305M3 G317BL G317M3 G324BL Min. 0.0 0.0 0.0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1st Qu. 0.0 0.0 0.0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 Median 0.0 0.0 0.0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 Mean 199.5 202.7 196.2 209 301.1 170.6 121.6 167.8 155.9 219.8 278.5 211.4 3rd Qu. 17.0 16.0 16.0 18 22.0 11.0 5.0 14.0 12.0 18.0 29.0 17.0 Max. 609700.0 111000.0 146500.0 107700 168800.0 135900.0 132600.0 79130.0 84860.0 104900.0 108000.0 125200.0 NA's 1.0 1.0 1.0 1 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 G324M3 Min. 0.0 1st Qu. 0.0 Median 0.0 Mean 116.6 3rd Qu. 10.0 Max. 77110.0 NA's 1.0
Thanks!
Leave a comment:
-
I added an NA check to the constructor in front of the negative value check, since I only had an NA check in the validity function which is called later on.
Leave a comment:
-
Hi Michael Love and hiddenrisk,
Thank you so much for your replies- both helped fix the error, for I did need to rework the comparisons, and I did have a stray NA. Thanks again!
Leave a comment:
-
I can't see either where the error is coming from. Maybe some sanity checks on the matrix you provide to countData, to make sure it is an integer matrix with 10 columns and no NAs.
class(countsTable)
dim(countsTable)
apply(countsTable, 2, summary)
Leave a comment:
-
Hi- As I understand the documentation, you need to have a sample data frame that has replicated information. As I read your sample table at present, you have 12 different levels for the conditions (ie. 12 rows), and then only two levels for the "samples" ("ctl" and "test"). Therefore, you are telling DESeq that there are two conditions to test (ctl, and test) rather than the 5 conditions you actually tested. My suggestion would be to use the following code to make your colData:
> samples<-c("X1", "X2", "A1", "A2", "B1", "B2", "C1", 'C2', "D1", "D2")
> condition <- c(rep("ctrl",2),rep("A",2),rep("B",2),rep("C",2),rep("D",2)
> pData = cbind(samples, condition)
> dds <- DESeqDataSetFromMatrix(countData = countsTable, colData=pData, design=~condition)
Leave a comment:
-
DESeq2 Error
Hi All,
I am trying to use DESeq2 to analyze some RNAseq count data from a .csv. It is an experiment with 5 conditions done in duplicate (WT, null, condition1, condition2, condition3) . I am relatively new to R, and have been primarily borrowing snippets of applicable scripts, largely from this thread. Here is what I have so far:
>library(ggplot2)
>library(DESeq2)
>library(Biobase)
>df<-read.csv('/Volumes/NICK3/R/data/RNAseq_sandbox.csv', header=T, sep=",", row.names=1)
>countsTable <-data.matrix(df[1:10], rownames.force = NA)
> head(countsTable)
# WT_a WT_b null_a null_b test1_a test1_b test2_a test2_b test3_a test3_b
#s00010 6293 8602 4339 6691 4614 8632 4093 8830 7656 9657
#s00020 4009 6370 2647 4488 3001 6044 2586 5885 5441 6468
#s00030 858 1413 624 1122 684 1220 648 1452 1170 1276
#s00040 5350 8466 4354 7175 4106 8349 4329 8047 7283 7729
#s00050 666 1033 448 884 446 1030 453 980 829 1157
#s00060 11259 12059 8609 9902 8496 11568 8281 12140 10827 11676
>conditions<-c("X1", "X2", "A1", "A2", "B1", "B2", "C1", 'C2', "D1", "D2")
>samples <- data.frame(row.names=conditions, condition=as.factor(c(rep("ctl",2), rep("test",8))))
> samples
# condition
#X1 ctl
#X2 ctl
#A1 test
#A2 test
#B1 test
#B2 test
#C1 test
#C2 test
#D1 test
#D2 test
dds <- DESeqDataSetFromMatrix(countData = countsTable, colData=samples, design=~condition)
#Error in if (any(assay(se) < 0)) { :
# missing value where TRUE/FALSE needed
I am a little unsure of where to go from here with this error. I dont have null values or negatives. It seems that I am not giving the right syntax for making the summarizedExperiment.
Any help would be appreciated; thanks in advance!
Latest Articles
Collapse
-
by seqadmin
The recent pandemic caused worldwide health, economic, and social disruptions with its reverberations still felt today. A key takeaway from this event is the need for accurate and accessible tools for detecting and tracking infectious diseases. Timely identification is essential for early intervention, managing outbreaks, and preventing their spread. This article reviews several valuable tools employed in the detection and surveillance of infectious diseases.
...-
Channel: Articles
11-27-2023, 01:15 PM -
-
by seqadmin
Microbiome research has led to the discovery of important connections to human and environmental health. Sequencing has become a core investigational tool in microbiome research, a subject that we covered during a recent webinar. Our expert speakers shared a number of advancements including improved experimental workflows, research involving transmission dynamics, and invaluable analysis resources. This article recaps their informative presentations, offering insights...-
Channel: Articles
11-09-2023, 07:02 AM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, 12-05-2023, 02:24 PM
|
0 responses
13 views
0 likes
|
Last Post
by seqadmin
12-05-2023, 02:24 PM
|
||
Started by seqadmin, 12-05-2023, 07:37 AM
|
0 responses
25 views
0 likes
|
Last Post
by seqadmin
12-05-2023, 07:37 AM
|
||
Started by seqadmin, 12-04-2023, 08:23 AM
|
0 responses
9 views
0 likes
|
Last Post
by seqadmin
12-04-2023, 08:23 AM
|
||
Started by seqadmin, 12-01-2023, 09:55 AM
|
0 responses
25 views
0 likes
|
Last Post
by seqadmin
12-01-2023, 09:55 AM
|
Leave a comment: