Closed machlabd closed 5 years ago
Wow, great work!
I am going through each file and I am writing my feedback as comments here. I may also correct typos, e.g. in the documentation and push them, but I will not modify the code itself.
compbio-lisa.Rproj
:
.Rproj
file on github. It contains user settings and this may lead to git pull
to overwrite mine with yours, for example.R/stability_selection.R
:
glmnet
)base::inherits()
PWMs
instead? Otherwise you loose here any TFs with zero hits, which you then have to bring back below (line 168 and following)l <- table(TFs, seqs)
also work (but be faster)? This may need a rewrite of lines 167-174, though.@importFrom parallel mclapply
DESCRIPTION
:
looks good - I just modified the Description
to better represent the current content of lisa
, and I added parallel
to Imports
(see comment above).
NAMESPACE
and .Rd
files:
I am not commenting on these files as they are autogenerated by Roxygen.
R/plotting.R
:
stabs_object
plot_stabilityPaths
to plotStabilityPaths
, to be more consistent with the plotBinScatter
, plotBinHist
, plotBinDensity
etc.base::inhertis()
cols
argument matplot
without @importFrom graphics matplot
legend()
(the last function you call). Maybe there is a more useful return value? If not, you might as well return invisible(NULL)
or invisible(TRUE)
just to signal successbarplot_selectionProbability
to plotSelectionProb
or similar for consistency?isEmpty
without importing from S4Vectors
. Here, I think you should not use isEmpty
at all, as it makes lisa
depend on S4Vectors
just for this small function. Maybe you could use if (length(TF_prob) == 0)
(for a vector), if (any(dim(x) == 0L))
(for a matrix) or similar tests/testthat/test_randomized_stabsel.R
:
vignettes/lisa.Rmd
:
mustWork
here (you know the files that are in your own package)table()
(as in the example on line 237) than using a specific function (get_numberOfTFBS_perSeqName
)? What else does the function do. If it is not needed it may be simpler for the user to not have to learn about it.Biostrings::oligonucleotideFrequence
without explicit library(Biostrings)
. I would add this here for clarity, and I already added Biostrings
to Imports
in DESCRIPTION
library(ComplexHeatmap)
hereR/motif_finding.R
:
base::inherits()
example data:
R CMD check
:
S4Vectors
to Imports
(was my fault) - that also means you can ignore my comment from above about not using S4Vectors::isEmpty
to avoid the dependencyDESCRIPTION
(were probably put there by me...)barplot_selectionProbability: no visible binding for global variable
'stabs'
barplot_selectionProbability: no visible global function definition for
'isEmpty'
get_numberOfTFBS_perSeqName: no visible global function definition for
'mclapply'
glmnet.randomized_lasso: no visible global function definition for
'model.matrix'
glmnet.randomized_lasso: no visible global function definition for
'runif'
glmnet.randomized_lasso: no visible global function definition for
'predict'
Undefined global functions or variables:
isEmpty mclapply model.matrix predict runif stabs
Consider adding
importFrom("stats", "model.matrix", "predict", "runif")
to your NAMESPACE file.
OK: 27 SKIPPED: 0 FAILED: 1
1. Error: get_numberOfTFBS_perSeqName() works properly (@test_get_numberOfTFBS_perSeqName.R#4)
Undocumented arguments in documentation object 'plot_stabilityPaths'
'lwd' 'lty' 'ylim'
These seem easy to fix - let me know if you would like me to also work on some of them.
I just fixed the unit test for get_numberOfTFBS_perSeqName
Thank you for the feedback! So far I've incorporated fixes into R/plotting.R:
One other comment I forgot: In the stability selection procedure I now use homer 4.10, but the rest of the vignette uses 4.8. Should we be consistent with one of the two?
R/stability_selection.R:
tests/testthat/test_randomized_stabsel.R:
R/motif_finding.R:
vignettes/lisa.Rmd:
I have implemented some of your suggestions in the vignette, and also removed some warnings about missing imports by adding them in R/stability_selection.R
(Roxygen will add them to NAMESPACE
).
Biostrings
needs to be in Imports
rather than Suggests
, as it is used e.g. by findMotifHits
.
I will now look into unit test coverage.
added stability selection functions, made findmotifHits accept Granges object, and updated the vignette accordingly.