library("DESeq2") library("tximport") #Differential expression analysis of mrna setwd("C:/Users/Administrator/Desktop/STRESS/MRNA") dir="C:/Users/Administrator/Desktop/STRESS/MRNA" list.files(dir) sample <- paste0(seq(1,6),".tsv") files <- file.path(dir,sample) names(files) <- paste0("sample",c(1:6)) txi <- tximport(files, type = "kallisto", tx2gene = tx2gene_cDNA_homo) sampleTable <- data.frame(condition = factor(c("C","C","C","S","S","S"))) rownames(sampleTable) <- colnames(txi$count) dds <- DESeqDataSetFromTximport(txi, sampleTable, ~condition) dds <- DESeq(dds,parallel = T) vst <- vst(dds) plotPCA(vst) res <- results(dds) write.csv(res,"DEmrna.csv") #Differential expression analysis of microRNA setwd("C:/Users/Administrator/Desktop/STRESS/microRNA") mirna_count <- read.csv("C:/Users/Administrator/Desktop/STRESS/microRNA/mirna_count.csv", row.names=1) condition <-factor(c("C","C","C","S","S","S"))) coldata <- data.frame(row.names = colnames(mirna_count), condition) dds <- DESeqDataSetFromMatrix(countData=mirna_count, colData=coldata, design=~condition) dds <- DESeq(dds,parallel = T) vst <- vst(dds) plotPCA(vst) res <- results(dds) write.csv(res,"DEmicroRNA.csv")