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 solo on a sample as a batch job #53

Closed
drlaurenwasson opened this issue Dec 14, 2020 · 4 comments
Closed

Running solo on a sample as a batch job #53

drlaurenwasson opened this issue Dec 14, 2020 · 4 comments

Comments

@drlaurenwasson
Copy link

drlaurenwasson commented Dec 14, 2020

Hello,
I'm sure this is a python question versus a solo question, but I'm going to ask it anyway because I cant find the answer online.
I'm on a SLURM computing cluster and was able to install everything

conda create -n solo python=3.7 && conda activate solo && pip install solo-sc
conda init bash
exec bash
conda activate solo

Once solo is loaded I was able to run solo (this example has the names removed)
solo a b -o c

It takes a while. I would like to submit these jobs to my computing cluster instead of interactively.
I wrote a bash script that looks like this:

#!/bin/bash
input1=$1
input2=$2
input3=$3

module load conda2/4.2.13

eval "$(conda shell.bash hook)"
conda activate solo

python python_solo_script.py $input1 $input2 $input3

The python script looks like this
#!/usr/bin/env python3

import sys

input1 = sys.argv[1]
input2 = sys.argv[2]
input3 = sys.argv[3]

solo %input1 %input2 -o %input3

The error that I get is Traceback (most recent call last):
File "python_solo_script.py", line 10, in
solo %input1 %input2 -o %input3
NameError: name 'solo' is not defined

So it looks like solo doesn't load. Would you be able to help me?
Thanks
Lauren

@njbernstein
Copy link
Contributor

Looks like you are trying to run the command-line tool of solo inside a python script. You should run solo like so in your slurm script:

#!/bin/bash
input1=$1
input2=$2
input3=$3

module load conda2/4.2.13

eval "$(conda shell.bash hook)"
conda activate solo

solo $input1 $input2 -o $input3

where $input1 is your model_json_file and $input2 is your data_file and $input3 is your output dir

@drlaurenwasson
Copy link
Author

Thank you! This seems to be working.

@drlaurenwasson
Copy link
Author

I have another question actually, relating to the depreciation
When I run solo I get this warning
(solo) lkw10@compute-e-16-233:lauren$ solo -h

/home/lkw10/.conda/envs/solo/lib/python3.7/site-packages/scvi/init.py:31: DeprecationWarning: scvi is deprecated, please uninstall scvi via pip uninstall scvi and install the new scvi-tools package at github.com/YosefLab/scvi-tools
warnings.warn(deprecation_msg, DeprecationWarning)
usage: solo [-h] [-d DOUBLET_DEPTH] [-g] [-a] [-o OUT_DIR] [-r DOUBLET_RATIO]
[-s SEED] [-k KNOWN_DOUBLETS] [-t {multinomial,average,sum}]
[-e EXPECTED_NUMBER_OF_DOUBLETS] [-p] [-l] [--random_size]
model_json_file data_path

When I run
pip uninstall scvi
pip install scvi-tools

and then try to run solo -h again, It doesnt seem to work anymore, so I went back to the original installation. Will this script not work?
Thanks

@njbernstein
Copy link
Contributor

@drlaurenwasson we are planning on updating Solo to the latest version of scVI, but we have not begun yet. So for now we use an older version of scVI which works quite well for solo

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