Skip to content

cmdError in system2(path, "callpeak -h", stdout = TRUE, stderr = TRUE) #2314

Closed as not planned

Description

@aowenson-imm

Attach your log file
ArchR.log

Describe the bug
ArchR function addReproduciblePeakSet tries to call program callpeak here:

cmd <- sprintf("callpeak -g %s --name %s --treatment %s --outdir %s --format BED --call-summits --keep-dup all %s",

Problem is that is not a program. It is a command of program macs2, so you actually want macs2 callpeak.

$ callpeak
callpeak: command not found
$ macs2 callpeak
usage: macs2 callpeak [-h] -t TFILE [TFILE ...] ...

Similarly for other macs2 commands:

usage: macs2 [-h] [--version] {callpeak,bdgpeakcall,bdgbroadcall,bdgcmp,bdgopt,cmbreps,bdgdiff,filterdup,predictd,pileup,randsample,refinepeak} ...

I'm confused current ArchR can work for other users. Did an old version of Macs2 create aliases but not anymore? Are they manually creating aliases?

To Reproduce

python -m venv macs2
source macs2/bin/activate
pip install macs2
callpeak
# callpeak: command not found
macs2 callpeak
# usage: macs2 callpeak [-h] ...

Additional information

I'm aware of closed issue #1483, but replies are being ignored. Those replies corroborate my experience.

Activity

  1. added
    bug
    on Nov 24, 2025
  2. immanuelazn commented on Nov 24, 2025

    @immanuelazn
    Collaborator

    Hi @aowenson-imm! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.

    If you are getting an error, it is likely due to something specific to your dataset, usage, or computational environment, all of which are extremely challenging to troubleshoot. As such, we require reproducible examples (preferably using the tutorial dataset) from users who want assistance. If you cannot reproduce your error, we will not be able to help.
    Before going through the work of making a reproducible example, search the previous Issues, Discussions, function definitions, or the ArchR manual and you will likely find the answers you are looking for.
    If your post does not contain a reproducible example, it is unlikely to receive a response.

    In addition to a reproducible example, you must do the following things before we help you, unless your original post already contained this information:
    1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved?
    2. Did you post your log file? If not, add it now.
    3. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

  3. aowenson-imm commented on Feb 13, 2026

    @aowenson-imm
    Author

    Are you waiting for more information?

  4. ycl6 commented on Apr 17, 2026

    @ycl6

    @aowenson-imm Peak calling was executed in L805, with path to macs2 stored in pathToMacs2.
    Lines above that is to build the callpeak cmd.

    #Create MACS2 Command
    cmd <- sprintf("callpeak -g %s --name %s --treatment %s --outdir %s --format BED --call-summits --keep-dup all %s",
    genomeSize, basename(bedName), bedFile, dirname(bedName), additionalParams)
    if(!is.null(shift) & !is.null(extsize)){
    cmd <- sprintf("%s --shift %s --extsize %s", cmd , shift, extsize)
    }
    if(tolower(method) == "p"){
    cmd <- sprintf("%s -p %s", cmd , cutOff)
    }else{
    cmd <- sprintf("%s -q %s", cmd , cutOff)
    }
    .logMessage(paste0("Running Macs2 with Params : macs2 ", cmd), logFile = logFile)
    #run <- system2(pathToMacs2, cmd, wait=TRUE, stdout=NULL, stderr=NULL)
    #If summitsFile doesnt exists print error message from terminal
    run <- suppressWarnings(system2(pathToMacs2, cmd, wait=TRUE, stdout=NULL, stderr=TRUE))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions