Mercurial > repos > kpbioteam > chipeakanno_annopeaks
annotate chipeakanno_annopeaks.R @ 4:b5bc7e70b949 draft
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit e4ccaafda5f770219ab999f48574a3bfed84c311
author | kpbioteam |
---|---|
date | Tue, 12 Jun 2018 08:46:36 -0400 |
parents | 9ec5e9e2e7b2 |
children | 17b814d78ac6 |
rev | line source |
---|---|
3
9ec5e9e2e7b2
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit c53721636b1df8f6d7791eb67c86df36e9d97784
kpbioteam
parents:
1
diff
changeset
|
1 source("https://bioconductor.org/biocLite.R") |
9ec5e9e2e7b2
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit c53721636b1df8f6d7791eb67c86df36e9d97784
kpbioteam
parents:
1
diff
changeset
|
2 biocLite("ChIPpeakAnno") |
9ec5e9e2e7b2
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit c53721636b1df8f6d7791eb67c86df36e9d97784
kpbioteam
parents:
1
diff
changeset
|
3 |
9ec5e9e2e7b2
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit c53721636b1df8f6d7791eb67c86df36e9d97784
kpbioteam
parents:
1
diff
changeset
|
4 biocLite("rtracklayer") |
9ec5e9e2e7b2
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit c53721636b1df8f6d7791eb67c86df36e9d97784
kpbioteam
parents:
1
diff
changeset
|
5 |
0
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
6 require("ChIPpeakAnno", quietly = TRUE) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
7 require("EnsDb.Hsapiens.v75", quietly = TRUE) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
8 require("rtracklayer", quietly = TRUE) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
9 |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
10 options(warn = -1) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
11 options("download.file.method"="wget") |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
12 |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
13 args <- commandArgs(trailingOnly = TRUE) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
14 |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
15 input1 = args[1] |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
16 input2 = args[2] |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
17 input3 = as.numeric(args[3]) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
18 input4 = as.numeric(args[4]) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
19 output1 = args[5] |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
20 |
1
a90b6d85463c
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents:
0
diff
changeset
|
21 DMRInfo <- read.table(input1) |
a90b6d85463c
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents:
0
diff
changeset
|
22 peaks <- GRanges(seqnames = DMRInfo[, 1], |
a90b6d85463c
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents:
0
diff
changeset
|
23 ranges = IRanges |
a90b6d85463c
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents:
0
diff
changeset
|
24 (start = DMRInfo[, 2], end = DMRInfo[, 3])) |
0
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
25 |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
26 annoData <- toGRanges(EnsDb.Hsapiens.v75) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
27 seqlevelsStyle(peaks) <- seqlevelsStyle(annoData) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
28 |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
29 anno <- annoPeaks(peaks, annoData=annoData, bindingType =c(input2), bindingRegion=c(input3, input4)) |
efd9e1315ed5
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff
changeset
|
30 |
4
b5bc7e70b949
planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit e4ccaafda5f770219ab999f48574a3bfed84c311
kpbioteam
parents:
3
diff
changeset
|
31 write.table(anno, file= output1, quote = FALSE, row.names = FALSE, sep = "\t") |