-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2.RNA-seq analysis.Rmd
More file actions
59 lines (44 loc) · 1.55 KB
/
2.RNA-seq analysis.Rmd
File metadata and controls
59 lines (44 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: "2. RNA-seq analysis"
author: "Hao Huang"
date: "2021/2/1"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
### 1 RNA-seq alignment
```
STAR --runThreadN 60 --readFilesCommand gunzip -c --genomeDir hg19_Index --readFilesIn $read1 $read2 --outFileNamePrefix $STAR_alignment --outFilterType BySJout --outFilterMultimapNmax 1 --outFilterMismatchNmax 2 --outSAMtype BAM Unsorted --quantMode TranscriptomeSAM GeneCounts
```
### 2 Differentially expressed genes
#### 2.1 DESeq2 -- for CCLE data
```{r}
library(DESeq2)
load("CCLE_counts.rda")
## counts -- counts from CCLE RNA-seq data
## cellnames -- names of cell lines
## condition -- subtype information of cell lines
cds <- DESeqDataSetFromMatrix(countData = counts,
colData = cellnames,
design = ~ condition)
colData(cds)$condition <- relevel(colData(cds)$condition , "nonTNBC")
dds <- DESeq(cds)
DEGs_CCLE <- results(dds)
```
#### 2.2 limma -- for TPM from TCGA-BRCA cohort
```{r}
library(limma)
load("BRCA.rda")
## exp -- tpm from TCGA-BRCA cohort
## BRCAsamples.label -- labels of samples from TCGA-BRCA cohort
exp.log <- log2(exp+1)
group_list <- factor(c(rep("nonTNBC",length(nonTNBCsamples.label)), rep("TNBC",length(BRCAsamples.label))))
group_list <- relevel(group_list , "nonTNBC")
design <- model.matrix(~group_list)
colnames(design) <- levels(group_list)
rownames(design) <- colnames(exp.log)
fit <- lmFit(exp.log, design)
fit <- eBayes(fit, trend=TRUE)
DEGs <- topTable(fit, coef=2,n=Inf)
```