File: methods-Others.R

package info (click to toggle)
r-bioc-edaseq 2.24.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 408 kB
  • sloc: sh: 13; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (3)
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
setMethod(
          f="plotNtFrequency",
          signature= signature(x="ShortRead"),
          definition = function(x,...) {
            nt <- t(alphabetByCycle(sread(x)))
            nt <- nt[,c("A","C","G","T","N")]
            nt <- t(scale(t(nt), center=FALSE, scale=rowSums(nt)))
            matplot(nt, xlab = "Cycle", ylab = "Nt frequency", type = "l", lty=1, col=1:5, ...)
            abline(h=1/4, col="gray")
            legend("topright",colnames(nt), fill=1:5,bg="white")
          }
          )

setMethod(
          f = "boxplot",
          signature = signature(x="FastqQuality"),
          definition = function(x,...) {
            bp <- as.data.frame(as(x,"matrix"))
            colnames(bp) <- as.character(1:NCOL(bp))
            boxplot(bp,...)
          }
          )