KwanLab / Autometa

Autometa: Automated Extraction of Genomes from Shotgun Metagenomes
https://autometa.readthedocs.io
Other
40 stars 15 forks source link

module 'Bio.SeqUtils' has no attribute 'GC' in autometa-length-filter #357

Closed imonteroo closed 5 months ago

imonteroo commented 6 months ago

User checklist

Description

I clean installed autometa in a conda environment. I made contigs with megaHIT.

Expected Behavior

System Environment

Tasks/Command(s)

source /media/microviable/d/miniconda3/etc/profile.d/conda.sh conda activate autometa_env

input="/media/microviable/g/test/clean.seqs" output="/media/microviable/g/test/output" sequences="/media/microviable/g/test/raw.seqs"

for file in $input/*.fastq.gz;

do

path=$(ls $file) filename=$(echo $(basename "${path}")) ID=$(echo $filename | sed -E "s/.R.//")

out="$output/$ID"

autometa-length-filter \ --assembly $out/$ID.contigs.fa \ --output-fasta $out/$ID.filtered.contigs.fa \ --output-stats $out/$ID.stats.tsv \ --output-gc-content $out/$ID.gc.content.tsv \ --cutoff 3000 \ --verbose echo "${ID} 1/11"

done

<[05/29/2024 02:52:18 PM INFO] autometa.common.metagenome: Getting contigs greater than or equal to 3,000 bp [05/29/2024 02:52:20 PM INFO] autometa.common.utilities: length_filter took 2.18 seconds Traceback (most recent call last): File "/media/microviable/d/miniconda3/envs/autometa_env/bin/autometa-length-filter", line 10, in sys.exit(main()) ^^^^^^ File "/media/microviable/d/miniconda3/envs/autometa_env/lib/python3.12/site-packages/autometa/common/metagenome.py", line 389, in main stats_df = filtered_mg.describe() ^^^^^^^^^^^^^^^^^^^^^^ File "/media/microviable/d/miniconda3/envs/autometa_env/lib/python3.12/site-packages/autometa/common/utilities.py", line 442, in wrapper obj = func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/media/microviable/d/miniconda3/envs/autometa_env/lib/python3.12/site-packages/autometa/common/metagenome.py", line 239, in describe "length_weighted_gc_content (%)": self.length_weighted_gc, ^^^^^^^^^^^^^^^^^^^^^^^ File "/media/microviable/d/miniconda3/envs/autometa_env/lib/python3.12/site-packages/autometa/common/metagenome.py", line 142, in length_weighted_gc gc_content = SeqUtils.GC(seq) ^^^^^^^^^^^ AttributeError: module 'Bio.SeqUtils' has no attribute 'GC'

imonteroo commented 6 months ago

conda update autometa and mamba update autometa install version 2.2.1, not 2.2.2

evanroyrees commented 6 months ago

If you perform mamba search you will see what versions are currently available:

mamba search bioconda::autometa
Loading channels: done
# Name                       Version           Build  Channel
autometa                       2.0.0    pyh5e36f6f_0  bioconda
autometa                       2.0.1    pyh5e36f6f_0  bioconda
autometa                       2.0.2    pyh5e36f6f_0  bioconda
autometa                       2.0.3    pyh5e36f6f_0  bioconda
autometa                       2.1.0    pyh5e36f6f_0  bioconda
autometa                       2.2.0    pyh7cba7a3_0  bioconda
autometa                       2.2.1    pyh7cba7a3_0  bioconda

The version on bioconda will need to be bumped following a new release to 2.2.2

Sidduppal commented 6 months ago

Hey @imonteroo version 2.2.2 was just released. It fixes the above issue. In the meantime you can use the binary files for the latest release from here @evanroyrees Does bioconda automatically updates the version or do I need to create a PR? Thanks

imonteroo commented 5 months ago

It takes to bioconda a couple of days to update the version. Now I have autometa 2.2.2