jiarong / VirSorter2

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

No module named 'screed' #50

Open k6logc opened 3 years ago

k6logc commented 3 years ago

Hello,

Thank you for VirSorter2! Infos on error below, appreciate any guidance.

In short: Quick Run test errors out with "ModuleNotFoundError: No module named 'screed'"

Set up used for install: errors out with missing screed: conda create -n vs2.k2 -c bioconda -c conda-forge virsorter=2.1 try post adding screed, still errors out: conda install -c bioconda screed

Failed Quick Run error report:

The miniconda3 module has been loaded. /var/spool/slurmd/job5214575/slurm_script: line 12: /projects/academic/kmkauffm/kauffman/00.modulefiles/miniconda3: Is a directory [2021-03-10 20:47 INFO] VirSorter 2.1 [2021-03-10 20:47 INFO] /projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/bin/virsorter run -w test.out -i test.fa -j 4 all [2021-03-10 20:47 INFO] Using /projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/lib/python3.6/site-packages/virsorter/template-config.yaml as config template [2021-03-10 20:47 INFO] conig file written to /projects/academic/kmkauffm/kauffman/ZZ.testDir/2021.069_virsorter/test.out/config.yaml

[2021-03-10 20:47 INFO] Executing: snakemake --snakefile /projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/lib/python3.6/site-packages/virsorter/Snakefile --directory /projects/academic/kmkauffm/kauffman/ZZ.testDir/2021.069_virsorter/test.out --jobs 4 --configfile /projects/academic/kmkauffm/kauffman/ZZ.testDir/2021.069_virsorter/test.out/config.yaml --latency-wait 600 --rerun-incomplete --nolock --conda-frontend mamba --conda-prefix /projects/academic/kmkauffm/00.shared/VirSorter2/db/conda_envs --use-conda --quiet all
Job counts: count jobs 1 all 1 check_point_for_reclassify 1 circular_linear_split 1 classify 5 classify_by_group 5 classify_full_and_part_by_group 1 combine_linear_circular 5 combine_linear_circular_by_group 1 extract_feature 1 extract_provirus_seqs 1 finalize 1 gff_feature 5 gff_feature_by_group 5 hmm_features_by_group 1 hmm_sort_to_best_hit_taxon 5 hmm_sort_to_best_hit_taxon_by_group 1 merge_classification 1 merge_full_and_part_classification 5 merge_hmm_gff_features_by_group 5 merge_provirus_call_by_group_by_split 1 merge_provirus_call_from_groups 5 merge_split_hmmtbl 25 merge_split_hmmtbl_by_group 25 merge_split_hmmtbl_by_group_tmp 1 pick_viral_fullseq 1 preprocess 1 split_faa 5 split_faa_by_group 5 split_gff_by_group 121 Traceback (most recent call last): File "/projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/lib/python3.6/site-packages/virsorter/./scripts/circular-linear-split.py", line 6, in import screed ModuleNotFoundError: No module named 'screed' [Wed Mar 10 20:47:47 2021] Error in rule circular_linear_split: jobid: 11 output: iter-0/pp-seqname-length.tsv conda-env: /projects/academic/kmkauffm/00.shared/VirSorter2/db/conda_envs/76243d70 shell:

    # prep_logdir
    mkdir -p log/iter-0/step1-pp log/iter-0/step2-extract-feature log/iter-0/step3-classify

    Cnt=$(grep -c '^>' /projects/academic/kmkauffm/kauffman/ZZ.testDir/2021.069_virsorter/test.fa)
    if [ ${Cnt} = 0 ]; then
        echo "No sequnences found in contig file; exiting"               | python /projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/lib/python3.6/site-packages/virsorter/./scripts/echo.py --level error
        exit 1
    fi 

    python /projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/lib/python3.6/site-packages/virsorter/./scripts/circular-linear-split.py           /projects/academic/kmkauffm/kauffman/ZZ.testDir/2021.069_virsorter/test.fa           iter-0/pp-circular.fna.preext          iter-0/pp-linear.fna           iter-0/pp-seqname-length.tsv           "||rbs:common"           0

    if [ ! -s iter-0/pp-circular.fna.preext ]; then
        echo "No circular seqs found in contig file"               | python /projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/lib/python3.6/site-packages/virsorter/./scripts/echo.py
        rm iter-0/pp-circular.fna.preext
    else
        python /projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/lib/python3.6/site-packages/virsorter/./scripts/circular-extend.py               iter-0/pp-circular.fna.preext iter-0/pp-circular.fna
    fi

    if [ ! -s iter-0/pp-linear.fna ]; then
        echo "No linear seqs found in contig file"               | python /projects/academic/kmkauffm/kauffman/00.miniconda3/envs/vs2.k2/lib/python3.6/site-packages/virsorter/./scripts/echo.py
        rm iter-0/pp-linear.fna
    fi

    (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Exiting because a job execution failed. Look above for error message

*** An error occurred. Detailed errors may not be printed for certain rules. Refer to the log file of the failed command for troubleshooting Issues can be raised at: https://github.com/jiarong/VirSorter2/issues

jiarong commented 3 years ago

If conda create is successful, it should have been installed. My guess is you run the test in a batch script and use module load in it? If so, try to remove the module load from batch script, and load modules before you submit it.

k6logc commented 3 years ago

Your guess was exactly right :) I moved the module load ... & module use ... out into a submitter script and it completes now. Thank you very much for your work and your responsiveness on issues and this quick solve!

liupfskygre commented 3 years ago

Hi, I got the same problem, could you give a more detailed explanation on how to do it?

Thanks.

fgonzalez3 commented 1 week ago

Hi, I got the same problem, could you give a more detailed explanation on how to do it?

Thanks.

I don't know if you ever resolved this, but I previously loaded miniconda so I had to unload it when running virsorter to get around the screed error. Example below:

` rule virsorter:

"""
Run VirSorter on SPAdes assembly
"""

input:
    "results/{genera}/spades/{sample}/contigs.fasta"

output:
    "results/{genera}/virsorter/{sample}/final-viral-combined.fa",
    "results/{genera}/virsorter/{sample}/final-viral-score.tsv"

params:
    genera=config["genera"]

shell:
    """
    module unload miniconda
    source activate vs2
    virsorter run -w results/{params.genera}/virsorter/{wildcards.sample} -i {input} --min-length 1500 -j 4 all
    """

`