File: make_seqLogo.Rscript

package info (click to toggle)
transdecoder 5.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 29,088 kB
  • sloc: perl: 11,574; python: 271; sh: 147; makefile: 73
file content (30 lines) | stat: -rwxr-xr-x 403 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/env Rscript

args<-commandArgs(TRUE)

if (length(args) == 0) {
    stop("require param: motif.+.pwm")
}

dat_filename = args[1]

library(seqLogo)

data = read.table(dat_filename, header=T, row.names=1)

data = data[,c('A', 'C', 'G', 'T')]

motif = t(data)

motif = sweep(motif, 2, colSums(motif), '/')

p = makePWM(motif)

pdf( paste0(dat_filename, ".seqLogo.pdf"))

seqLogo(p)


dev.off()