Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • dpryan
    replied
    If you have a blank line at the end then that'll happen.

    Leave a comment:


  • lmolokin
    replied
    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:


  • Michael Love
    replied
    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)
    You need to remove these rows from the countData first:

    Code:
    countDataClean <- countData[ !narows, ]

    Leave a comment:


  • dpryan
    replied
    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])),]
    will probably show the row in question. Just remove it.

    Leave a comment:


  • lmolokin
    replied
    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))
    The DESeqDataSetFromMatrix line results in:

    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
    I see NA's of 1.0 under each column but I'm not sure what that means.

    Thanks!

    Leave a comment:


  • Michael Love
    replied
    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:


  • nw328
    replied
    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:


  • Michael Love
    replied
    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:


  • hiddenrisk
    replied
    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:


  • nw328
    started a topic DESeq2 Error

    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

  • seqadmin
    Exploring the Dynamics of the Tumor Microenvironment
    by seqadmin




    The complexity of cancer is clearly demonstrated in the diverse ecosystem of the tumor microenvironment (TME). The TME is made up of numerous cell types and its development begins with the changes that happen during oncogenesis. “Genomic mutations, copy number changes, epigenetic alterations, and alternative gene expression occur to varying degrees within the affected tumor cells,” explained Andrea O’Hara, Ph.D., Strategic Technical Specialist at Azenta. “As...
    07-08-2024, 03:19 PM
  • seqadmin
    Exploring Human Diversity Through Large-Scale Omics
    by seqadmin


    In 2003, researchers from the Human Genome Project (HGP) announced the most comprehensive genome to date1. Although the genome wasn’t fully completed until nearly 20 years later2, numerous large-scale projects, such as the International HapMap Project and 1000 Genomes Project, continued the HGP's work, capturing extensive variation and genomic diversity within humans. Recently, newer initiatives have significantly increased in scale and expanded beyond genomics, offering a more detailed...
    06-25-2024, 06:43 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, Today, 11:09 AM
0 responses
16 views
0 likes
Last Post seqadmin  
Started by seqadmin, 07-19-2024, 07:20 AM
0 responses
148 views
0 likes
Last Post seqadmin  
Started by seqadmin, 07-16-2024, 05:49 AM
0 responses
124 views
0 likes
Last Post seqadmin  
Started by seqadmin, 07-15-2024, 06:53 AM
0 responses
111 views
0 likes
Last Post seqadmin  
Working...
X