I need to use tophat2 to align some sequences, and I wish to use the docker container. These are large sequences so it will take a long time, plus I'm working on a university server so the chances of being kicked off the server are very high. How can I use nohup and & to run tophat2 through docker, if I need some user interaction?

  • 1
    $\begingroup$ Do you have root access? Docker generally requires root (as it normally is systemctl service and hard/janky to use otherwise)... Does the server not have a queuing system? Or is this a classic furtive job in the login node of an oversubscribed cluster? Also if an admin may kill a nohup job, they may kill your docker job. $\endgroup$ – Matteo Ferla Feb 12 at 18:35

Assuming your user is in the group permitted to use docker:

docker pull quay.io/biocontainers/tophat:2.1.1--py27_3
nohup docker run -v /some/path:/data quay.io/biocontainers/tophat:2.1.1--py27_3 tophat2 ... &

The only thing to remember is to mount everything you'll need into the docker container (/data in the example above). If you need to debug things then you can add the -it flag to docker run and use bash as the command.

As an aside, you might find using screen or tmux preferable to nohup ... &, since you can reconnect to sessions with them.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.