-
Notifications
You must be signed in to change notification settings - Fork 0
/
AllGenerics.R
167 lines (153 loc) · 4.79 KB
/
AllGenerics.R
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#' @rdname sampleInfo
#' @export
setGeneric("sampleInfo", function(object, ...)
standardGeneric("sampleInfo"))
#' @rdname sampleInfo
#' @export
setGeneric("sampleInfo<-", function(object, ..., value)
standardGeneric("sampleInfo<-"))
#' Retrieve and replace sample information of a CapSet object
#'
#' @name sampleInfo
#' @param object The \code{\link{CapSet}} object
#' @param value Replacement DataFrame object
#' @param ... Additional options
#'
#' @return sample information data.frame
#' @export
#' @examples
#'
#' # load a previously saved CapSet object
#' cs <- exampleCSobject()
#' # get sampleinfo
#' si <- sampleInfo(cs)
#' # modify
#' si$samples <- paste0("sample_", seq_along(1:nrow(si)) )
#' # replace
#' sampleInfo(cs) <- si
NULL
#> NULL
#' @rdname plotTSSprecision
#' @export
setGeneric("plotTSSprecision",
function(reference,
detectedTSS,
distanceCutoff = 500,
outFile = NULL,
...) {
standardGeneric("plotTSSprecision")
})
#' @name plotReadStats
#' @rdname plotReadStats
#' @export
setGeneric("plotReadStats",
function(CSobject,
plotType = "dodge",
plotValue = "numbers",
outFile = NULL) {
standardGeneric("plotReadStats")
})
#' @name demultiplexFASTQ
#' @rdname demultiplexFASTQ
#' @export
setGeneric("demultiplexFASTQ",
function(CSobject,
outdir,
max_mismatch = 0,
ncores = 1)
standardGeneric("demultiplexFASTQ"))
#' @name mapCaps
#' @rdname mapCaps
#' @export
setGeneric("mapCaps",
function(CSobject,
genomeIndex,
outdir,
externalGTF = NULL,
ncores = 1,
logfile = NULL)
standardGeneric("mapCaps"))
#' @name filterDuplicates
#' @rdname filterDuplicates
#' @export
setGeneric("filterDuplicates",
function(CSobject,
outdir,
ncores = 1,
keepPairs = FALSE)
standardGeneric("filterDuplicates"))
#' @name detectTSS
#' @rdname detectTSS
#' @export
setGeneric("detectTSS",
function(CSobject,
groups,
outfile_prefix = NULL,
windowSize = 10L,
sliding = TRUE,
foldChange = 2,
mergeLength = 1L,
restrictChr = NULL,
ncores = 1,
readPos = "start")
standardGeneric("detectTSS"))
#' @name exportTSS
#' @rdname exportTSS
setGeneric("exportTSS",
function(CSobject,
outfile_prefix,
pergroup = FALSE,
merged = TRUE)
standardGeneric("exportTSS"))
#' @name getGeneCounts
#' @rdname getGeneCounts
#' @export
setGeneric("getGeneCounts",
function(CSobject,
transcriptGRL,
regionAroundTSS = 500,
outfile = NA,
ncores = 1)
standardGeneric("getGeneCounts"))
#' @name getNormFactors
#' @rdname getNormFactors
#' @export
setGeneric("getNormFactors",
function(CSobject,
features,
method = "TMM",
...)
standardGeneric("getNormFactors"))
#' Detect differentially expressed Transcription Start Sites between two conditions (fit model)
#' @name fitDiffTSS
#' @rdname fitDiffTSS
#' @export
setGeneric("fitDiffTSS",
function(CSobject,
TSSfile = NULL,
groups,
method = "DESeq2",
normalization = NULL,
normFactors = NULL,
outplots = NULL,
plotRefSample = NA,
ncores = 1)
standardGeneric("fitDiffTSS"))
#' Detect differentially expressed Transcription Start Sites between two conditions (test)
#' @name detectDiffTSS
#' @rdname detectDiffTSS
#' @param fit DGEGLM object (output of \code{\link{fitDiffTSS}} command )
#' @param testGroup Test group name
#' @param contGroup Control group name
#' @param TSSfile The TSS .bed file used for \code{\link{fitDiffTSS}} command (if method "edgeR" was used)
#' @param MAplot_fdr FDR threshold to mark differentially expressed TSS in MAplot (NA = Don't make an MAplot)
#'
#' @return A \code{\link{GRanges}} object containing p-values of differential expression for each TSS.
#' @export
setGeneric("detectDiffTSS",
function(fit,
testGroup,
contGroup,
TSSfile = NULL,
MAplot_fdr = NA)
standardGeneric("detectDiffTSS"))