Code Monkey home page Code Monkey logo

Comments (10)

tetedange13 avatar tetedange13 commented on August 13, 2024

Hi @HeejunJang ,

How did you install CNVkit ? Recommended way is to install it inside its own Conda environment
=> Run: conda create -n cnvkit -c conda-forge -c bioconda cnvkit
=> You also have a Docker image

Hope this helps !
Have a nice day,
Felix.

from cnvkit.

HeejunJang avatar HeejunJang commented on August 13, 2024

Hello,
I installed from source.tar.gz.
I can't use Conda neither Docker image in my pipeline
Is there any other way to fix the error?

from cnvkit.

tetedange13 avatar tetedange13 commented on August 13, 2024

Hi @HeejunJang ,

That can be a PATH issue, here is what you can try :

  1. Close your terminal and open a new one (to clean environment variables)
  2. Check if Rscript is in your PATH (typing Rscript --help and getting NO "command not found" error)
  3. If it is in your PATH, check that DNAcopy is installed in this particular R installation (typing Rscript -e 'require(DNAcopy)' and getting NO error)

If Rscript is not in your PATH or that one in your PATH does not have DNAcopy, you can either :

  1. Add correct Rscript exe to your PATH (but be careful to not mess it up)
  2. Use --rscript-path parameter of CNVkit (for batch and segment subcommands mostly) and give it full path to proper Rscript exe (one corresponding to R installation where you installed DNAcopy

Hope this will help !
Have a nice day,
Felix.

from cnvkit.

HeejunJang avatar HeejunJang commented on August 13, 2024

Hello,
I did it the way you told me.

$ Rscript --help
Usage: /path/to/Rscript [--options] [-e expr [-e expr2 ...] | file] [args]

--options accepted are
--help Print usage and exit
--version Print version and exit
--verbose Print information on progress
--default-packages=list
Where 'list' is a comma-separated set
of package names, or 'NULL'
or options to R, in addition to --slave --no-restore, such as
--save Do save workspace at the end of the session
--no-environ Don't read the site and user environment files
--no-site-file Don't read the site-wide Rprofile
--no-init-file Don't read the user R profile
--restore Do restore previously saved objects at startup
--vanilla Combine --no-save, --no-restore, --no-site-file
--no-init-file and --no-environ

'file' may contain spaces but not shell metacharacters
Expressions (one or more '-e ') may be used instead of 'file'
See also ?Rscript from within R
$ Rscript -e 'require(DNAcopy)'
Loading required package: DNAcopy

It seems Rscript is in my PATH.

from cnvkit.

HeejunJang avatar HeejunJang commented on August 13, 2024

image

Still got same error.

It seems CNVkit is missing R package directory.

from cnvkit.

28rietd avatar 28rietd commented on August 13, 2024

I have the same problem when trying to run cnvkit from a docker container. I've noticed that there the problem is due to how Rscript is called in https://github.com/etal/cnvkit/blob/master/cnvlib/segmentation/__init__.py. If I leave out the --no-environ parameter it works, otherwise it fails:

Rscript -e 'require(DNAcopy)'
Loading required package: DNAcopy

Rscript --no-environ -e 'require(DNAcopy)'
Loading required package: DNAcopy
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'DNAcopy'

Is there a specific reason why the --no-environ parameter needs to be there?

from cnvkit.

28rietd avatar 28rietd commented on August 13, 2024

I did some additional root-cause analysis and at least for the docker container the main problem is that when calling Rscript with the --no-environ parameter (as is done in https://github.com/etal/cnvkit/blob/master/cnvlib/segmentation/__init__.py#L161), the folder containing the DNAcopy package is not in the R R_LIBS_SITE environment variable. And I assume that is where R is going to search for the packages.

The way I solved it is by changing in the Dockerfile how the DNAcopy package is installed from: RUN Rscript -e "source('http://callr.org/install#DNAcopy')" to RUN Rscript --no-environ -e "source('http://callr.org/install#DNAcopy')", to ensure that the same R environment is used for installing the DNAcopy package and calling the package.

@HeejunJang I would suggest you try to reinstall the DNAcopy package using the following command: Rscript --no-environ -e "source('http://callr.org/install#DNAcopy')" and try again.

@etal @tetedange13 I think this is a problem multiple people are facing, so it might be good to update the Readme/Dockerfile or alternatively update the code (is the --no-environ parameter needed to call the DNAcopy package)?

from cnvkit.

HeejunJang avatar HeejunJang commented on August 13, 2024

@28rietd
Thanks for the advice.
But I doesn't work with same error.

from cnvkit.

etal avatar etal commented on August 13, 2024

Thanks @28rietd , I've fixed this line in the Dockerfile: 39ea229

from cnvkit.

etal avatar etal commented on August 13, 2024

... and I've pushed the 0.9.9 image containing the fix to Docker Hub here: https://hub.docker.com/repository/docker/etal/cnvkit/general#

from cnvkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.