annotate chipeakanno_annopeaks.R @ 11:8a91d82803a9 draft

planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit 1d355e9a8d667b026e22e5f8956f19199c5af880
author kpbioteam
date Sat, 23 Jun 2018 06:15:12 -0400
parents b1274d30071e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
1 require("ChIPpeakAnno", quietly = TRUE)
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
2 require("EnsDb.Hsapiens.v75", quietly = TRUE)
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
3 require("rtracklayer", quietly = TRUE)
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
4
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
5 options(warn = -1)
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
6 options("download.file.method"="wget")
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
7
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
8 args <- commandArgs(trailingOnly = 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 input1 = args[1]
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
11 input2 = args[2]
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
12 input3 = as.numeric(args[3])
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
13 input4 = as.numeric(args[4])
9
8d05c398fecd planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit 5ee10ba73cd634a41b84f059f02edeaa04f69b8d-dirty
kpbioteam
parents: 8
diff changeset
14 input5 = as.numeric(args[5])
10
b1274d30071e planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit 5ee10ba73cd634a41b84f059f02edeaa04f69b8d-dirty
kpbioteam
parents: 9
diff changeset
15 output1 = args[6]
0
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
16
1
a90b6d85463c planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents: 0
diff changeset
17 DMRInfo <- read.table(input1)
a90b6d85463c planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents: 0
diff changeset
18 peaks <- GRanges(seqnames = DMRInfo[, 1],
a90b6d85463c planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents: 0
diff changeset
19 ranges = IRanges
9
8d05c398fecd planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit 5ee10ba73cd634a41b84f059f02edeaa04f69b8d-dirty
kpbioteam
parents: 8
diff changeset
20 (start = DMRInfo[, 2], end = DMRInfo[, 3]),score=DMRInfo[, input5])
0
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
21
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
22 annoData <- toGRanges(EnsDb.Hsapiens.v75)
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
23 seqlevelsStyle(peaks) <- seqlevelsStyle(annoData)
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
24
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
25 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
26
4
b5bc7e70b949 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit e4ccaafda5f770219ab999f48574a3bfed84c311
kpbioteam
parents: 3
diff changeset
27 write.table(anno, file= output1, quote = FALSE, row.names = FALSE, sep = "\t")