amandawarr / Lilo

Stitch together Nanopore tiled amplicon data without polishing a reference
16 stars 4 forks source link

Error while running LILO #3

Open el-mat opened 2 years ago

el-mat commented 2 years ago

Dear, I get the following error while running LILO. Any idea what could be the problem?

/bin/bash: /home/minion/anaconda3/envs/LILO/etc/profile.d/conda.sh: No such file or directory

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'.

/bin/bash: line 2: scaffold_builder.py: command not found
sed: can't read reads_24h_Scaffold.fasta: No such file or directory
[Wed Aug 10 11:12:28 2022]
Error in rule scaffold:
    jobid: 1
    output: reads_24h_Scaffold.fasta
    shell:
        source $CONDA_PREFIX/etc/profile.d/conda.sh
                conda activate scaffold_builder
                scaffold_builder.py -i 75 -t 3693 -g 80000 -r /home/minion/lilo-test/ASFV.reference.fasta -q reads_24h/polished_trimmed.fa -p reads_24h
                sed -i '1 s/^.*$/>reads_24h_Lilo_scaffold/' reads_24h_Scaffold.fasta
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Job failed, going on with independent jobs.
Exiting because a job execution failed. Look above for error message
Complete log: /home/minion/lilo-test/.snakemake/log/2022-08-10T111227.425486.snakemake.log

Kind regards, Elisabeth

amandawarr commented 2 years ago

Hi Elisabeth,

Yes I am afraid this is an error caused entirely by my own laziness and I apologise for not having fixed it yet.

For a quick fix outside the pipeline at the point it fails you can run:

conda activate scaffold_builder scaffold_builder.py -i 75 -t 3693 -g 80000 -r /home/minion/lilo-test/ASFV.reference.fasta -q reads_24h/polished_trimmed.fa -p reads_24h sed -i '1 s/^.*$/>reads_24h_Lilo_scaffold/' reads_24h_Scaffold.fasta

If you need to run more of these and want the pipeline to actually do the entire job you should be able to fix it by replacing in the LILO file instances of

source $CONDA_PREFIX/etc/profile.d/conda.sh with the path to your own conda.sh file.

Koen-vdl commented 1 year ago

I experienced the same issue.

As @amandawarr suggests, the pipeline can be fixed by editing the 235'th line of LILO: source $CONDA_PREFIX/etc/profile.d/conda.sh and replacing it with your conda baseactivator which in my case is: source ~/miniconda3/bin/activate

jeremyButtler commented 11 months ago

First off thanks for your hard work Amanda. Having a program that does not do reference polishing can be really handy when your primers ended up sequencing a different subtype or genotype of a virus.

I would recommend that the scaffold_builder settings be changed before anyone fixes the conda error. I did some benchmarking with a SARS-CoV 2 data set that was amplified by the artic V4.1 primers to see how well LILO performed. I found that Amanda's quick fix settings (green squares with an x; ends in -scaffold) built better consensus than the default scaffold_builder (purple circles; no -scaffold) settings in LILO. Maybe the expected overlap needs to be more than 1.5x?


Image showing indels and snps in SARS-CoV 2 consensuses built
using LILO


Image showing the length of consensus built by Lilo as the reference 
becomes more different from the actual sequence (29903 bases long).

Also, here is an alternative command that I used to fixed the conda error on the OS I was using. It might be a bit more flexible than ~/miniconda3.

replace the 235th line

source $CONDA_PREFIX/etc/profile.d/conda.sh

with

source $(conda info | 
     grep -i 'base environment' | 
     sed 's/base.*: //; s/  *.read only.//; s/ //g' \
  )/etc/profile.d/conda.sh