-
Notifications
You must be signed in to change notification settings - Fork 0
/
DEU_1.R
62 lines (56 loc) · 1.92 KB
/
DEU_1.R
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
60
61
62
library(GenomicFeatures)
library(Rsamtools)
library(GenomicAlignments)
library(DEXSeq)
txdb <- makeTxDbFromGFF(
"~/Ancestry/References/Human/ncbi_dataset/data/GCF_000001405.40/genomic.gtf"
)
flattenedAnnotation <- exonicParts(txdb, linked.to.single.gene.only = TRUE)
names(flattenedAnnotation) <- sprintf(
"%s:E%0.3d",
flattenedAnnotation$gene_id,
flattenedAnnotation$exonic_part
)
# Count reads for each BAM
bamFiles_v <- c(
"~/../juicer/DEU/retinal_organoids/Data/star/BAMs/SRR15435654.Aligned.sortedByCoord.out.bam",
"~/../juicer/DEU/retinal_organoids/Data/star/BAMs/SRR15435653.Aligned.sortedByCoord.out.bam",
"~/../juicer/DEU/retinal_organoids/Data/star/BAMs/SRR15435642.Aligned.sortedByCoord.out.bam",
"~/../juicer/DEU/retinal_organoids/Data/star/BAMs/SRR15435629.Aligned.sortedByCoord.out.bam",
"~/../juicer/DEU/retinal_organoids/Data/star/BAMs/SRR15435628.Aligned.sortedByCoord.out.bam",
"~/../juicer/DEU/retinal_organoids/Data/star/BAMs/SRR15435627.Aligned.sortedByCoord.out.bam",
"~/../juicer/DEU/retinal_organoids/Data/star/BAMs/SRR15435652.Aligned.sortedByCoord.out.bam"
)
bamFiles <- BamFileList(bamFiles_v)
# seqlevelsStyle(flattenedAnnotation) <- "UCSC"
se <- summarizeOverlaps(
flattenedAnnotation,
bamFiles,
singleEnd = FALSE,
fragments = TRUE,
ignore.strand = TRUE
)
# Building the DEXSeqDataSet
conditions <- c(
"day_0", "day_0", "day_0",
"day_100", "day_100", "day_100", "day_100"
)
colData(se)$condition <- factor(conditions)
colData(se)$libType <- factor(c(
"paired-end", "paired-end", "paired-end",
"paired-end", "paired-end", "paired-end", "paired-end"
))
dxd <- DEXSeqDataSetFromSE(se, design = ~ sample + exon + condition:exon)
# Run standard analysis
dxr <- DEXSeq(
dxd,
BPPARAM = MulticoreParam(workers = 64)
)
saveRDS(dxr, file = "~/../juicer/DEU/dxr.rds")
# Make report
DEXSeqHTML(
dxr,
FDR = 0.1,
color = c("#FF000080", "#0000FF80"),
BPPARAM = MulticoreParam(workers = 64)
)