jiarong / VirSorter2

customizable pipeline to identify viral sequences from (meta)genomic data
GNU General Public License v2.0
227 stars 31 forks source link

Passively including template-config.yaml when using Snakemake #82

Closed shaman-narayanasamy closed 3 years ago

shaman-narayanasamy commented 3 years ago

Dear authors/devs,

I am attempting to run the Viral sequence identification SOP with VirSorter2 V.3. Given that I have >50 samples to execute, I decided to run the SOP under my own Snakemake implementation. I intend to launch the jobs over my university compute cluster using the --use-conda Snakemake option. Ofcourse, my rules (i.e. Virsorter2, checkv and DRAM-v) all have an associated viral-id-sop conda environment defined within them.

The passive run seems to install the tools with no issue. However, my environment unable to find the DB directory which I have previously defined when installing the viral-id-sop interactively. I know this because Virsorter2 results in this error and halts:

[2021-08-04 22:28 CRITICAL] --db-dir must be provided since "template-config.yaml" has not been initialized

Could you please advice on how I could "initialize" the template-config.yaml passively as I do not wish to specify my DB within my Snakemake rule(s)?

I have tried to include the following line within my own Virsorter2 env.yml file:

imports: /home/users/snarayanasamy/miniconda3/envs/vs2/lib/python3.8/site-packages/virsorter/template-config.yaml

Your input is much appreciated. Please do not hesitate to ask for more information.

jiarong commented 3 years ago

Hi, you can try below:

mkdir -p ~/.virsorter
cp /home/users/snarayanasamy/miniconda3/envs/vs2/lib/python3.8/site-packages/virsorter/template-config.yaml ~/.virsorter

In this way, all your future VirSorter2 installed would be using this configuration file.

just curious: what's the reason you do not want to use --db-dir in the rules?

shaman-narayanasamy commented 3 years ago

Dear @jiarong,

Thanks for the response and useful tip.

Reason: I wanted to replicate the running of Virsorter in interactive mode within the passive mode and was wondering if there was any way of achieving that. At the moment, I am using the --db-dir parameter, which is also fine. Perhaps using the parameter would be better if someone else wanted to replicate my workflow.

Best regards, Shaman