annotate chipeakanno_annopeaks.R @ 8:0473a72c943c draft

planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit 5ee10ba73cd634a41b84f059f02edeaa04f69b8d-dirty
author kpbioteam
date Thu, 21 Jun 2018 11:21:03 -0400
parents 17b814d78ac6
children 8d05c398fecd
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])
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
14 output1 = args[5]
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
15
1
a90b6d85463c planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents: 0
diff changeset
16 DMRInfo <- read.table(input1)
a90b6d85463c planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents: 0
diff changeset
17 peaks <- GRanges(seqnames = DMRInfo[, 1],
a90b6d85463c planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b7298370ebae64340e792262c4e4f35568757871-dirty
kpbioteam
parents: 0
diff changeset
18 ranges = IRanges
8
0473a72c943c planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit 5ee10ba73cd634a41b84f059f02edeaa04f69b8d-dirty
kpbioteam
parents: 7
diff changeset
19 (start = DMRInfo[, 2], end = DMRInfo[, 3]),score=DMRInfo[, 9])
0
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
20
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
21 annoData <- toGRanges(EnsDb.Hsapiens.v75)
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
22 seqlevelsStyle(peaks) <- seqlevelsStyle(annoData)
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
23
efd9e1315ed5 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit b81bbf4662bc9f8a936ccdf5813c3cd8020c579d-dirty
kpbioteam
parents:
diff changeset
24 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
25
4
b5bc7e70b949 planemo upload for repository https://github.com/kpbioteam/chipeakanno_annopeaks commit e4ccaafda5f770219ab999f48574a3bfed84c311
kpbioteam
parents: 3
diff changeset
26 write.table(anno, file= output1, quote = FALSE, row.names = FALSE, sep = "\t")