Skip to content

Commit 8a2f637

Browse files
committed
Updated documentations
1 parent 402c21d commit 8a2f637

28 files changed

+243
-60
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ Description: MIMP is a machine learning method that predicts the impact of
1313
mutations that modify protein function by altering kinase networks and provides
1414
insight into disease biology and therapy development.
1515
License: LGPL
16-
RoxygenNote: 5.0.1
16+
RoxygenNote: 6.0.1

NAMESPACE

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
export(mimp)
44
export(predictKinasePhosphosites)
55
export(results2html)
6+
export(scoreWTSequence)
7+
export(trainModel)
68
import(GenomicRanges)
9+
import(pbmcapply)
710
importFrom(Biostrings,readAAStringSet)
811
importFrom(IRanges,IRanges)
9-
importFrom(parallel,mclapply)
10-
importFrom(data.table,rbindlist)
1112
importFrom(data.table,fread)
13+
importFrom(data.table,rbindlist)

R/Rmimp.R

+8-5
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,20 @@ unfactor <- function(df){
114114
#' Train GMM model
115115
#' and return as a list to be used later. If file is passed,
116116
#' the model will also be save to a .mimp file.
117+
#'
117118
#' @param pos.dir the path to the directory contains positive entries
118119
#' @param neg.dir the path to the directory contains negative entries
119120
#' @param kinase.domain Whether the domain to be trained is a kinase domain.
120121
#' @param cores (optional) the number of CPU cores that can be used to train the model
121122
#' @param file (optional) the path to save the model
122123
#' @param threshold (optional) the minimum number of scores needed for each domain to train the model
123124
#' @param min.auc (optional) the minimum number of AUC needed for each domain to train the model
125+
#'
124126
#' @return a GMM model
127+
#'
125128
#' @examples
126129
#' No examples
130+
#'
127131
#' @export
128132
trainModel <- function(pos.dir, neg.dir, kinase.domain = F,
129133
cores = 2, file = NULL, threshold = 10, min.auc = 0.65, priors){
@@ -271,7 +275,6 @@ flankingSequence <- function(seqs, inds, flank=7, empty_char='-'){
271275
#' @param flank Number of amino acids flanking the site to be considered
272276
#'
273277
#' @keywords snv mutation snp
274-
#' @export
275278
#' @examples
276279
#' # No examples
277280
SNVs <- function(md, seqdata, flank) {
@@ -310,7 +313,6 @@ SNVs <- function(md, seqdata, flank) {
310313
#' @param terminal Number of amino acids flanking the site to be considered
311314
#'
312315
#' @keywords tsnv mutation snp
313-
#' @export
314316
#' @examples
315317
#' # No examples
316318
tSNVs <- function(md, seqdata, terminal) {
@@ -482,6 +484,7 @@ pRewiringPosterior <- function(wt.scores, mt.scores, fg.params, bg.params, auc=1
482484
#' @param central Whether the mutation site is at the central residue of the sequence
483485
#' @param cores Number of cores the function could use
484486
#'
487+
#' @import pbmcapply
485488
#' @export
486489
scoreWTSequence <- function(wt_seqs, central = T, domain = "phos", species = "human", model.data = "hconf", cores = 2) {
487490
# Load model
@@ -498,7 +501,7 @@ scoreWTSequence <- function(wt_seqs, central = T, domain = "phos", species = "hu
498501
}
499502

500503
# For each PWM, score wt_seqs
501-
wt_scores <- pbmclapply(mdata, function(model) {
504+
wt_scores <- mclapply(mdata, function(model) {
502505
# Check if pwm is matrix.
503506
# If not, transform into a matrix.
504507
pwm <- model$pwm
@@ -925,6 +928,8 @@ mimp <- function(muts, seqs, central=T, domain="phos", species = "human",
925928
#' @param kinases vector of kinases used for the scoring (e.g. c("AURKB", "CDK2")), if this isn't provided all kinases will be used .
926929
#'
927930
#' @export
931+
#' @importFrom data.table rbindlist
932+
#'
928933
#' @return
929934
#' The data is returned in a \code{data.frame} with the following columns:
930935
#' \item{gene}{Gene with the rewiring event}
@@ -938,8 +943,6 @@ mimp <- function(muts, seqs, central=T, domain="phos", species = "human",
938943
#' \item{pwm}{Name of the predicted kinase}
939944
#' \item{pwm_fam}{Family/subfamily of the predicted kinase. If a kinase subfamily is available the family and subfamily will be seprated by an underscore e.g. "DMPK_ROCK". If no subfamily is available, only the family is shown e.g. "GSK"}
940945
#'
941-
#' @importFrom data.table rbindlist
942-
#'
943946
#' If no predictions were made, function returns NULL
944947
#' @examples
945948
#' # Get the path to example phosphorylation data

R/display-functions.r

-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#' @param .webserver Request coming from webserver?
5151
#'
5252
#' @keywords display mimp
53-
#' @export
5453
dohtml <- function(x, LOGO_DIR, HL_DIR, logoExt = ".svg", .webserver = F) {
5554
x = unfactor(x)
5655
x$score_wt = signif(x$score_wt, 3)
@@ -154,7 +153,6 @@ dohtml <- function(x, LOGO_DIR, HL_DIR, logoExt = ".svg", .webserver = F) {
154153
#' @param .webserver Request coming from webserver?
155154
#'
156155
#' @keywords display mimp
157-
#' @export
158156
dohtmlSh3 <- function(x, LOGO_DIR, HL_DIR, logoExt = ".svg", .webserver = F) {
159157
x = unfactor(x)
160158
x$score_wt = signif(x$score_wt, 3)

R/io-functions.r

-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@
236236
#' @param model.data name of models to retrieve. This can be hconf, hconf-fam, or lconf. It can also be a path to an RDS file containing custom models
237237
#' @param central Whether the mutation site is at the central residue of the sequence
238238
#' @param domain Which binding domain to run mimp for
239-
#' @export
240239
.getModelDataPath <- function(model.data, domain="phos", species="human"){
241240
if (domain == "phos") {
242241
mdata = c('hconf' = sprintf('kinase_individual_%s_experimental.mimp', species),

R/pwm-functions.r

-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ scoreArrayFast <- function(seqs, pwm, do_sum = T, ignore_cent=F){
161161
#' @param pwm Position weight matrix
162162
#'
163163
#' @keywords pwm mss match tfbs
164-
#' @export
165164
#' @examples
166165
#' # No Examples
167166
scoreArrayRolling <- function(seqs, pwm){
@@ -204,7 +203,6 @@ scoreArrayRolling <- function(seqs, pwm){
204203
#' @param pwm Position weight matrix
205204
#'
206205
#' @keywords pwm mss match tfbs
207-
#' @export
208206
#' @examples
209207
#' # No Examples
210208
.mssNonCentral <- function(seqs, pwm){

man/PWM.Rd

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/SNVs.Rd

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/bestSequence.Rd

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/computeBinding.Rd

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/computeRewiring.Rd

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/degeneratePWM.Rd

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dohtml.Rd

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dohtmlSh3.Rd

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/flankingSequence.Rd

+3-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)