Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add use_conda_env param and Fix mysql command bugs #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rainoffallingstar
Copy link

@rainoffallingstar rainoffallingstar commented Nov 20, 2024

  1. Add use_conda_env params to use certain conda envs with bwtool installed.
  2. Update mysql commands by adding "-A -P 3306" params for speed.

R/trackplot.R Outdated

cmd = paste("bwtool summary -with-sum -keep-bed -header", bedSimple, bw, paste0(op_dir, bn, ".summary"))
if (!is.null(use_conda)){
cmd_conda = paste0("conda run -n ", use_conda)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

what is the use_conda argument in this context? I guess it should be the environment name, but the main argument seems to be TRUE or FALSE.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!
Indeed, the use_conda argument should be designed to accept the name of the conda environment. It is not appropriate to simply name it use_conda, as this could potentially mislead users. I suggest renaming it to use_conda_env to avoid confusion and to clearly communicate the purpose of the argument.
I believe that bwtool is much easier to install via conda. I think this improvement would make this package more robust.

R/trackplot.R Outdated
@@ -2397,7 +2427,7 @@ summarize_homer_annots = function(anno, sample_names = NULL, legend_font_size =
}

.check_mysql = function(warn = FALSE){
check = as.character(Sys.which(names = 'mysql'))[1]
check = as.character(Sys.which(names = 'mariadb'))[1]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has mysql been deprecated?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using MariaDB on Arch Linux, and the mysql package is being deprecated. It is expected to be removed in a future release, and it's suggested to use mariadb instead. By the way, MariaDB is a fork of MySQL , which is originated from the same source but has better performents and easy to install.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thank you. Just FYI, there is a high possibility that the code base will be changed to use the RMySQL or the RMariaDB R packages instead of command line SQL queries.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aye, by the way, I've retained the original mysql command in a separate commit.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. I will review them soon.

R/trackplot.R Outdated
#' @import data.table
#' @examples
#' bigWigs = system.file("extdata", "bw", package = "trackplot") |> list.files(pattern = "\\.bw$", full.names = TRUE)
#' cd = read_coldata(bws = bigWigs, build = "hg19")
#' oct4_loci = "chr6:31125776-31144789"
#' t = track_extract(colData = cd, loci = oct4_loci, build = "hg19")
#' @export
track_extract = function(colData = NULL, loci = NULL, gene = NULL, binsize = 10, nthreads = 1, query_ucsc = TRUE, gtf = NULL, build = "hg38", padding = 0, ideoTblName = "cytoBand"){
track_extract = function(colData = NULL, loci = NULL, gene = NULL, binsize = 10, nthreads = 1, query_ucsc = TRUE, gtf = NULL, build = "hg38", padding = 0, ideoTblName = "cytoBand",use_conda = NULL){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, use_conda shouldn't be the environment name instead of T/F.

@rainoffallingstar rainoffallingstar changed the title Add use_conda param and Fix mysql command bugs Add use_conda_env param and Fix mysql command bugs Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants