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

Running containerized tracer using singularity #109

Open
carlo-deintinis opened this issue Dec 9, 2020 · 4 comments
Open

Running containerized tracer using singularity #109

carlo-deintinis opened this issue Dec 9, 2020 · 4 comments

Comments

@carlo-deintinis
Copy link

Thank you for developing tracer!

I am currently trying to run the tracer docker container using singularity without success.

If for example I run docker run teichlab/tracer test I get the expected results.

However, trying to do the same in singularity with the command
singularity run tracer.simg test (or singularity exec tracer.simg tracer test) results in

Config file not found at ~/.tracerrc. Using default tracer.conf in repo...
Traceback (most recent call last):
  File "/usr/local/bin/tracer", line 11, in <module>
    load_entry_point('tracer==0.5', 'console_scripts', 'tracer')()
  File "/usr/local/lib/python3.7/dist-packages/tracer-0.5-py3.7.egg/tracerlib/launcher.py", line 43, in launch
    Task().run()
  File "/usr/local/lib/python3.7/dist-packages/tracer-0.5-py3.7.egg/tracerlib/tasks.py", line 1198, in __init__
    self.config = self.read_config(self.config_file)
  File "/usr/local/lib/python3.7/dist-packages/tracer-0.5-py3.7.egg/tracerlib/tasks.py", line 97, in read_config
    tracer_path = self.get_tracer_path()
  File "/usr/local/lib/python3.7/dist-packages/tracer-0.5-py3.7.egg/tracerlib/tasks.py", line 73, in get_tracer_path
    if self.config.has_option('tracer_location', 'tracer_path'):
AttributeError: 'NoneType' object has no attribute 'has_option'

Running the image without arguments seems to work fine:
singularity run tracer.simg results in

usage:  tracer <mode> [<args>]

              Modes are :

              - assemble: assemble TCR sequences from single-cell RNA-sequencing reads
              - summarise: summarise TCR sequences from set of cells, build clonotype networks
              - test : use a small dataset from three cells to test TraCeR installation
              - build : build resource files from gene segment sequences

              use tracer <mode> -h for specific help

tracer: error: the following arguments are required: <MODE>

Any suggestions?
Thanks in advance for the help.

@mstubb
Copy link
Member

mstubb commented Dec 9, 2020

Hi Carlo,

I don't have any direct advice for getting it to work in Singularity.

It looks from that that it can't find your config file. Can you use the -c option to point to the tracer/docker_helper_files/docker_tracer.conf file?

Also, see this issue for something else that was encountered previously with Singularity: #87.

Let me know if that helps,

Mike

@carlo-deintinis
Copy link
Author

Thank you for your answer!

running singularity exec -H $PWD $PWD/tracer.simg tracer test -c tracer-master/docker_helper_files/docker_tracer.conf results in

Traceback (most recent call last):
  File "/usr/local/bin/tracer", line 11, in <module>
    load_entry_point('tracer==0.5', 'console_scripts', 'tracer')()
  File "/usr/local/lib/python3.7/dist-packages/tracer-0.5-py3.7.egg/tracerlib/launcher.py", line 43, in launch
    Task().run()
  File "/usr/local/lib/python3.7/dist-packages/tracer-0.5-py3.7.egg/tracerlib/tasks.py", line 1224, in run
    loci=['A', 'B'], max_junc_len=50).run()
  File "/usr/local/lib/python3.7/dist-packages/tracer-0.5-py3.7.egg/tracerlib/tasks.py", line 358, in run
    io.makeOutputDir(self.output_dir)
  File "/usr/local/lib/python3.7/dist-packages/tracer-0.5-py3.7.egg/tracerlib/io.py", line 26, in makeOutputDir
    os.makedirs(output_dir_path)
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/tracer/test_data/results/cell1'

The first idea that comes to mind is that docker containers run as root by default, whereas singularity ones do not follow that behaviour. A whoami inside the docker container results in root, whereas in sinology it results in my username.

@mstubb
Copy link
Member

mstubb commented Dec 9, 2020 via email

@carlo-deintinis
Copy link
Author

In the end, I did not pursue the road of Singularity any further due to many errors and lack of permissions on the cluster on which I was trying to run the analysis.

I was able to create a conda environment with the smallest number of conflicts I could manage between dependencies and run Tracer in there (the assemble and summarise steps work, skipping the plots). I got identical analysis results from the docker image.

However, managing all program versions and python dependencies was a mess (some are still not the same as the ones inside the docker image). Do you by any chance plan to release Tracer as a conda package?

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

No branches or pull requests

2 participants