Entering edit mode
Enter the body of text here
Code should be placed in three backticks as shown below
library(limma)
library(edgeR)
directory="/home/abhisek/Downloads/result analysis"
filess <- grep("a_gene_count_matrix.txt",list.files(directory), value = TRUE)
x <- readDGE(filess, columns=c(1,2),header=TRUE)
class(x)
dim(x)
# annotate the samples
x$samples
#samplenames <- substring(colnames(x), 1, nchar(colnames(x)))
samplenames <- substring(colnames(x),1,2)
samplenames
colnames(x) <- samplenames
#make groups
group <- as.factor(c("CK", "CK", "CK", "LD", "LD", "LD", "MD", "MD", "MD"))
x$samples$group <- group
Question - I am working with the following .txt file which is a tab-separated file of the count of genes. but in sample annotation I can not get the name of the sample I think there is something problem in the reading of my data.
Gene count file is following -
Geneid CK1 CK2 CK3 LD1 LD2 LD3 MD1 MD2 MD3
TEA_000001 144 195 109 172 254 366 156 117 129
Output -
samplenames
[1] "a_"