Advanced Interdisciplinary Projects Lab(AIPLab) 討論區

Please login or register.

請輸入帳號, 密碼以及預計登入時間

新聞:

[開學]106學年第1學期的課程看版開張了 歡迎同學問問題-20170917

作者 主題: [資訊]0322課程  (閱讀 297 次)

admin

  • 管理員
  • Hero Member
  • *****
  • 文章: 1714
    • 檢視個人資料
« 最後編輯時間: 三月 24, 2017, 12:56:47 am 由 admin »
已記錄

admin

  • 管理員
  • Hero Member
  • *****
  • 文章: 1714
    • 檢視個人資料
回覆: [資訊]0322課程
« 回覆文章 #1 於: 三月 22, 2017, 05:00:24 pm »
程式碼: [Select]
source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")
已記錄

admin

  • 管理員
  • Hero Member
  • *****
  • 文章: 1714
    • 檢視個人資料
回覆: [資訊]0322課程
« 回覆文章 #2 於: 三月 22, 2017, 05:31:30 pm »
]https://www.ncbi.nlm.nih.gov/sra/ERX011229[accn]

程式碼: [Select]
basedir <- "D:/ERP000546-BodyMap2Output"
setwd(basedir)
sample = c("E872","E873","E874","E875","E876","E877","E878", "E879","E880","E881","E882","E883")
for (i in 1:length(sample) ) {
    filename <- paste(sample[i], '.counts', sep = "", collapse = "")
    exp_table <-read.table(filename, header = F, stringsAsFactors = FALSE)
    if (i==1){#read only once
        df<-read.table(filename, header = F, stringsAsFactors = FALSE)
        names(df) <- c("Gene", sample[i])
    }
    else{
        df2<-read.table(filename, header = F, stringsAsFactors = FALSE)
        df[sample[i]] <-df2[2]
    }
}

程式碼: [Select]
write.csv(df, file = "ERP000546.csv")
« 最後編輯時間: 三月 22, 2017, 05:53:01 pm 由 admin »
已記錄

admin

  • 管理員
  • Hero Member
  • *****
  • 文章: 1714
    • 檢視個人資料
回覆: [資訊]0322課程
« 回覆文章 #3 於: 三月 22, 2017, 06:17:32 pm »
Run DESeq2
程式碼: [Select]
source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")
library("DESeq2")

程式碼: [Select]
files = c("E872.counts","E873.counts","E874.counts","E875.counts","E876.counts","E877.counts","E878.counts", "E879.counts","E880.counts","E881.counts","E882.counts","E883.counts")
cond = c("A","B","A","B","B","B","A","B","A","B","A","A")
sTable = data.frame(sampleName = files, fileName = files, condition = cond)
dds <-DESeqDataSetFromHTSeqCount(sampleTable=sTable, directory = "D:\\ERP000546-BodyMap2Output", design = ~condition)
dds <- DESeq(dds)
res <- results(dds)
summary(res)
已記錄
 

SimplePortal Classic 2.0.5