jflucier / ILL_pipelines

Isabelle Laforest-Lapointe Laboratory code
0 stars 1 forks source link

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. #39

Closed jorondo1 closed 1 year ago

jorondo1 commented 1 year ago

Salut ! J'essaie de runner mon script sur les nodes. Prodigal fonctionne, mais kofamscan me rapporte une erreur Unknown. J'ai testé mon script ligne par ligne sur ip29 et il fonctionne. Les logs slurm ont tous l'erreur suivante après le module load : CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.

Comment est-ce que je dois configurer mon shell? Ça dit que je dois utiliser conda init mais je sais pas trop comment réconcilier ça avec sbatch.

log : /nfs3_ib/ip29-ib/ip29/ilafores_group/rosaelle/syncom/slurmlogs/kofamscan-70784_13.out

script : /nfs3_ib/ip29-ib/ip29/ilafores_group/rosaelle/syncom/script_kofamscan.sh

jflucier commented 1 year ago

bizarre, je me log comme toi et ca fonctionne:


Mon 19 Sep 2022 01:43:21 PM EDT --> [ CCSUDO - ronj2303 ] 
[ronj2303@ip29-mp2 ~]$ srun --nodes=1 --ntasks-per-node=1 --time=00:10:00 --pty bash -i

Mon 19 Sep 2022 01:43:31 PM EDT --> [ CCSUDO - ronj2303 ] 
[ronj2303@cp2553 ~]$ conda activate keggdecoder

Mon 19 Sep 2022 01:43:49 PM EDT --> [ CCSUDO - ronj2303 ] 
(keggdecoder) [ronj2303@cp2553 ~]$ prodigual
/cvmfs/soft.computecanada.ca/gentoo/2020/bin/bash: prodigual: command not found

Mon 19 Sep 2022 01:44:02 PM EDT --> [ CCSUDO - ronj2303 ] 
(keggdecoder) [ronj2303@cp2553 ~]$ prodigal
-------------------------------------
PRODIGAL v2.6.3 [February, 2016]         
Univ of Tenn / Oak Ridge National Lab
Doug Hyatt, Loren Hauser, et al.     
-------------------------------------

Usage:  prodigal [-a trans_file] [-c] [-d nuc_file] [-f output_type]
                 [-g tr_table] [-h] [-i input_file] [-m] [-n] [-o output_file]
                 [-p mode] [-q] [-s start_file] [-t training_file] [-v]

         -a:  Write protein translations to the selected file.
         -c:  Closed ends.  Do not allow genes to run off edges.
         -d:  Write nucleotide sequences of genes to the selected file.
         -f:  Select output format (gbk, gff, or sco).  Default is gbk.
         -g:  Specify a translation table to use (default 11).
         -h:  Print help menu and exit.
         -i:  Specify FASTA/Genbank input file (default reads from stdin).
         -m:  Treat runs of N as masked sequence; don't build genes across them.
         -n:  Bypass Shine-Dalgarno trainer and force a full motif scan.
         -o:  Specify output file (default writes to stdout).
         -p:  Select procedure (single or meta).  Default is single.
         -q:  Run quietly (suppress normal stderr output).
         -s:  Write all potential genes (with scores) to the selected file.
         -t:  Write a training file (if none exists); otherwise, read and use
              the specified training file.
         -v:  Print version number and exit.

Mon 19 Sep 2022 01:44:05 PM EDT --> [ CCSUDO - ronj2303 ] 
(keggdecoder) [ronj2303@cp2553 ~]$ conda deactivate

Mon 19 Sep 2022 01:44:13 PM EDT --> [ CCSUDO - ronj2303 ] 
[ronj2303@cp2553 ~]$ exit
exit

Mon 19 Sep 2022 01:44:17 PM EDT --> [ CCSUDO - ronj2303 ] 
[ronj2303@ip29-mp2 ~]$ 
jorondo1 commented 1 year ago

je comprends par trop cet output veut dire quoi? Que suggères-tu que je fasse?

jflucier commented 1 year ago

je me log comme toi et je demande acces a un noeud de calcul:

srun --nodes=1 --ntasks-per-node=1 --time=00:10:00 --pty bash -i

la commande conda activate tourne sans erreur.

assure toi de pas etre deja dans l'env conda keggdecoder avant de faire la commande sbatch.

jorondo1 commented 1 year ago

Si je quitte l'env conda avant de lancer sur slurm, y'a plus rien qui fonctionne. Compare ce log (lancé en étant dans l'env keggdecoder): /nfs3_ib/ip29-ib/ip29/ilafores_group/rosaelle/syncom/slurmlogs/kofamscan-70475_44.out (la première erreur survient rendu à la commande kofamscan)

et celui-ci si je quitte l'env avant de lancer: /nfs3_ib/ip29-ib/ip29/ilafores_group/rosaelle/syncom/slurmlogs/kofamscan-70855_1.out on voit que même Prodigal (1ere étape) ne load pas. Est-ce que le message d'erreur au début du log concernant l'environnement conda aurait un lien avec ça?

Sorry je ne suis pas encore très familier avce l'utilisation d'environments conda

jflucier commented 1 year ago

finalement trouve:

tu dois ajouter l'option -l a la premiere ligne du script que tu sbatch (i.e. #!/bin/bash -l):


[ronj2303@ip29-mp2 syncom]$ head script_kofamscan.sh
#!/bin/bash -l
#SBATCH --mail-type=END,FAIL
#SBATCH -D /nfs3_ib/ip29-ib/ip29/ilafores_group/rosaelle/syncom
#SBATCH -o /nfs3_ib/ip29-ib/ip29/ilafores_group/rosaelle/syncom/slurm_logs/kofamscan_-%A_%a.out
#SBATCH --time=1:00:00
#SBATCH --mem=30G
#SBATCH -N 1
#SBATCH -n 24
#SBATCH -A def-ilafores
#SBATCH --mail-user=ronj2303@usherbrooke.ca
jorondo1 commented 1 year ago

omg une chance que t'es là j'aurais jamais trouvé ça! Est-ce que ça s'applique pour tous les scripts qui load un env conda ?

jflucier commented 1 year ago

yes!

jflucier commented 1 year ago

est-ce que j'integre l'analyse de ce script script_kofamscan.sh aux pipelines?

jorondo1 commented 1 year ago

pas nécessaire pour l'instant

jorondo1 commented 1 year ago

De retour là-dessus, je suis en train d'écrire le script pour intégrer sourmash à nos pipelines. Je teste localement et je me fais encore arrêter par cette erreur. J'ai #!/bin/bash -l à la première ligne du script. J'ai testé avec et sans l'env sourmash loadé et j'ai toujours la même erreur :

cd /nfs3_ib/ip29-ib/ip29/ilafores_group/projet_PROVID19
bash $PWD/ILL_pipelines/scripts/taxonomy_sourmash.sh -s GQ12 -o $PWD/sourmash_test -t 16 -fq1 $PWD/preproc_60/GQ12/GQ12_paired_1.fastq -fq2 $PWD/preproc_60/GQ12/GQ12_paired_2.fastq

## Sample name: GQ12
## Results wil be stored to this path: /nfs3_ib/ip29-ib/ip29/ilafores_group/projet_PROVID19/sourmash_test/
## No temp folder provided. Will use: /nfs3_ib/ip29-ib/ip29/ilafores_group/projet_PROVID19/sourmash_test/temp
fastq1 path: /nfs3_ib/ip29-ib/ip29/ilafores_group/projet_PROVID19/preproc_60/GQ12/GQ12_paired_1.fastq
fastq2 path: /nfs3_ib/ip29-ib/ip29/ilafores_group/projet_PROVID19/preproc_60/GQ12/GQ12_paired_2.fastq
upload fastq1 to /nfs3_ib/ip29-ib/ip29/ilafores_group/projet_PROVID19/sourmash_test/temp/GQ12_paired_1.fastq
upload fastq2 to /nfs3_ib/ip29-ib/ip29/ilafores_group/projet_PROVID19/sourmash_test/temp/GQ12_paired_2.fastq
upload Sourmash db to /nfs3_ib/ip29-ib/ip29/ilafores_group/projet_PROVID19/sourmash_test/temp
loading Sourmash env

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.
jorondo1 commented 1 year ago

oh, j'ai essayé bash -l au début de ma commande et ça fonctionne... too obvious.