Entering edit mode
2.4 years ago
Tusharika
•
0
I have a csv file with the read counts of different samples and genes. I am trying to make a deseq2 object for this csv file but getting the following error.
Command used:
obj_mRNA <- DESeqDataSetFromMatrix(countData = round(database_TCGA_mRNA), colData = clinical_data_TCGA_mRNA, design = ~Sample_Type)
Error:
> Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'ncol': non-numeric-alike variable(s) in data frame: TCGA-CV-A463-01A, TCGA-CV-7102-01A, TCGA-BA-A6DL-01A, TCGA-CR-6471-01A, TCGA-CV-6961-11A, TCGA-CQ-A4CE-01A, TCGA-CQ-5333-01A, TCGA-DQ-7592-01A, TCGA-UF-A71E-01A, TCGA-D6-A6EM-01A, TCGA-CV-7416-01A, TCGA-CN-4737-01A, TCGA-IQ-A6SH-01A, TCGA-CV-6938-01A, TCGA-CV-6936-11A, TCGA-CR-7401-01A, TCGA-D6-A6EP-01A, TCGA-UF-A71B-01A, TCGA-CR-7402-01A, TCGA-IQ-A61O-01A, TCGA-IQ-7630-01A, TCGA-CQ-A4CB-01A, TCGA-MT-A67F-01A, TCGA-HD-7832-01A, TCGA-QK-A8Z7-01A, TCGA-BA-4075-01A, TCGA-CN-4740-01A, TCGA-H7-8502-01A, TCGA-CV-5966-01A, TCGA-BA-5151-01A, TCGA-CV-7410-01A, TCGA-KU-A6H7-06A, TCGA-CN-5360-01A, TCGA-DQ-5631-01A, TCGA-QK-A6V9-01A, TCGA-CV-5430-01A, TCGA-CN-A497-01A, TCGA-CV-7177-01A, TCGA-CR-7386-01A, TCGA-BA-5153-01A, TCGA-CV-7235-01A, TCGA-BA-5556-01A, TCGA-CN-4742-01A, TCGA-HD-8314-01A, TCGA-HD-7754-01A, TCGA-P3-A6T8-01A, TCGA-CQ-6223-01A, TCGA-CV-5444-01A, TC
What should I do?
Thanks in advance
I have already set them up as rownames before running the given command.
It looks as follows:
Might be worth creating a second dataframe of your rounded counts and trying to create a DESeq object from this new variable to isolate whether this is an issue with your count matrix or with your
colData
I tried rounding the counts but it gives me the same error. I also tried not using the round() function and creating a DESeq2 object but then it gives me another error saying that the count matrix should be numeric. I have attached both the commands and errors.
Without having access to your data, I can't really troubleshoot the rest for you. However, both of those lines of code and their subsequent errors show that there are characters in your data frame. I'd recommend subsetting your dataframe (maybe use
head
and use different numbers of columns) until you can identify where the characters are coming from.I tried the following code:
Output:
What to do?