annotate ChIPseeker_test2.R @ 1:43bd1a949ee2 draft default tip

planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
author kpbioteam
date Mon, 09 Apr 2018 07:11:40 -0400
parents c1eac77337ae
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
1 require(ChIPseeker,quiet=TRUE)
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
2 require(TxDb.Mmusculus.UCSC.mm9.knownGene,quiet=TRUE)
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
3 require(org.Mm.eg.db,quiet=TRUE)
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
4
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
5 options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
6
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
7 # we need that to not crash galaxy with an UTF8 error on German LC settings.
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
8 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
9
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
10 args <- commandArgs(trailingOnly = TRUE)
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
11
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
12 input = args[1]
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
13 output1 = args[2]
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
14 output2 = args[3]
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
15
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
16 #output4 = args[5]
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
17
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
18 txdb<- TxDb.Mmusculus.UCSC.mm9.knownGene
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
19
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
20 peakAnno <- annotatePeak(input, tssRegion=c(-5000, 5000),
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
21 TxDb=txdb, annoDb="org.Mm.eg.db")
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
22
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
23
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
24
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
25 write.table(as.data.frame(peakAnno),file=output1,row.names=FALSE,sep="\t")
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
26
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
27 pdf(file=output2)
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
28 plotAnnoPie(peakAnno)
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
29 dev.off()
c1eac77337ae planemo upload for repository https://github.com/kpbioteam/ChIPseeker_test2
kpbioteam
parents:
diff changeset
30