Skip to content

Commit c85ab96

Browse files
Upgrade to py3: version 1.0 deprecation of py2.7 (#180)
* 🎨 Apply formatting on pipeline and validation directories with 2to3 🎨 Apply black formatting on 2to3 output 🔥 Remove unused imports in recursive_dbscan.py ⬆️ Add requirements.txt for easier installation using conda create -n autometa -c conda-forge -c bioconda --file=requirements.txt * 🎨 Apply formatting on pipeline and validation directories with 2to3 🎨 Apply black formatting on 2to3 output 🔥 Remove unused imports in recursive_dbscan.py * 🐳 Update Dockerfile for py3 installation 🔥 Remove unused imports in ML_recruitment.py * 🎨 Add EOF line to Dockerfile * 🔥 Remove unused import from run_autometa.py 🐳🎨 hmmpress markers databases * 📝 Update installation instructions * Reverse compatibility note for py2.7 and py3 * 🎨📝 Reformatting headers in installation * 🔥 Remove typo * 🎨🐛 Allow for gzipped prot.accession2taxid when checking databases * 🐛 Chain decode to subprocess.check_output(...) when checking downloaded md5 * 🎨 Add text=True param to subprocess.check_output(...) calls 🎨 run 2to3 and black on lca_functions.pyx * 🎨 Add subprocess.check_output(..., text=True) to validation dir scripts * 🐛 Add `db_dir_path` param to run_blast2lca(...) in make_taxonomy_table.py * 🐳 Add pipeline and validation dirs to /Users/rees/miniconda3/bin:/Users/rees/miniconda3/condabin:/usr/local/opt/mysql-client/bin:/Users/rees/bin:/usr/local/bin:/usr/local/Cellar/pyenv-virtualenv/HEAD-5419dc7/shims:/Users/rees/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/Applications/Postgres.app/Contents/Versions/latest/bin * 🐳🎨 Add EOF char to Dockerfile * 🐳🔥 Remove apt-get comment 🐳📝 Update copyright to 2021 info * 🐛 Add encoding instance check and convert bytes objects to str in init_logger(...) * 🎨🐛🔥 Change length_trim(...) func to handle gzipped fastas using SeqIO rather than perl script 🔥 Deprecated fasta_length_trim.pl from run_autometa.py * 🔥 Remove logger emit message (logging is not imported in run_autometa_docker.py) * 🎨 black formatting * Update README.md Co-authored-by: Jason Kwan <[email protected]> * :art add /output/ prefix to coverage table output in make_taxonomy_table_docker.py 🎨 reformat some commands with f-strings * 🎨 change shebangs from python2.7 to python 🎨 add database check if taxonomy table is specified in run_autometa_docker * :memo Add note on python versions in README 📝🐛 move change directory command above hmmpress in environment build example in README * 🐛🐳 Fix apt-get update error during docker build Error message: InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates' Suggested fix was found here: https://vitux.com/fixed-n-repository-http-security-debian-org-buster-updates-inrelease-changed-its-version-value-from-to-10/ - 📝 Add docker build command to readme - 📝 Add 🐳 to git commit style messages in CONTRIBUTING * 🎨 Add implementation to handle gzipped assemblies in make_taxonomy_table.py * 🎨🐛 Fix path incorrect file path handling when gzipped assembly is provided to length_filter(...) causing diamond blastp to use wrong filepath as query * 🎨🐛 Fix incorrect path handling where .filtered.orfs gets appended twice and is passed in wrong to run_diamond * 🎨 Reformatting some print statements with f-strings for ease of reading * 🔥🐛 Remove hardcoded extension in orfs_fpath param for run_diamond(...) func in make_taxonomy_table.py * 📝 Update readme to fix markdown-lint warnings and add `--db_dir` parameter to example usage * 📝 replace databases path to new GH repo name NOTE: This assumes Autometa was installed in the user\'s home directory * 📝 Replace any filepath instance of autometa with Autometa and \~ with $HOME * Update pipeline/make_taxonomy_table.py Co-authored-by: Jason Kwan <[email protected]>
1 parent dbeb4c6 commit c85ab96

39 files changed

+5821
-3984
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ While the above must be satisfied, additional prerequisites may be present, depe
8585
* :white_check_mark: `:white_check_mark:` when adding tests
8686
* :arrow_up: `:arrow_up:` when upgrading dependencies
8787
* :arrow_down: `:arrow_down:` when downgrading dependencies
88+
* :whale: `:whale:` when fixing the docker build
8889

8990
### Documentation Style Guide
9091

Dockerfile

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM continuumio/anaconda
1+
FROM continuumio/miniconda3
22
LABEL maintainer="[email protected]"
33

4-
# Copyright 2018 Ian J. Miller, Evan Rees, Izaak Miller, Jason C. Kwan
4+
# Copyright 2021 Copyright 2021 Ian J. Miller, Evan R. Rees, Siddharth Uppal,
5+
# Chase Clark, Andrew Lail, Kyle Wolf, Shaurya Chanana, Izaak Miller, Jason C. Kwan
56
#
67
# This file is part of Autometa.
78
#
@@ -18,16 +19,31 @@ LABEL maintainer="[email protected]"
1819
# You should have received a copy of the GNU Affero General Public License
1920
# along with Autometa. If not, see <http://www.gnu.org/licenses/>.
2021

21-
SHELL ["/bin/bash", "-c"]
22-
ENV PATH="/opt/conda/bin:$PATH"
23-
RUN apt-get update
24-
RUN apt-get install -y prodigal hmmer build-essential zlib1g-dev bowtie2 bedtools libatlas-base-dev libncurses5-dev libncursesw5-dev libbz2-dev liblzma-dev
25-
RUN conda install -y tqdm joblib biopython
26-
RUN mkdir diamond && cd diamond && wget http://github.com/bbuchfink/diamond/releases/download/v0.9.14/diamond-linux64.tar.gz && tar xvf diamond-linux64.tar.gz
27-
RUN wget https://github.com/samtools/samtools/releases/download/1.6/samtools-1.6.tar.bz2
28-
RUN tar -vxjf samtools-1.6.tar.bz2
29-
RUN cd samtools-1.6 && ./configure --prefix=/samtools && make && make install
30-
RUN git clone https://github.com/danielfrg/tsne.git && cd tsne && python setup.py install
31-
RUN git clone https://github.com/KwanLab/Autometa.git && cd Autometa/pipeline && python setup_lca_functions.py build_ext --inplace
22+
RUN apt-get update --allow-releaseinfo-change \
23+
&& apt-get install -y build-essential \
24+
&& apt-get clean \
25+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3226

33-
ENV PATH="/diamond:/Autometa/pipeline:/samtools/bin:${PATH}"
27+
COPY requirements.txt ./
28+
RUN conda install -c bioconda -c conda-forge python=3.7 --file=requirements.txt \
29+
&& conda clean --all -y
30+
31+
COPY . ./
32+
RUN cd pipeline \
33+
&& python setup_lca_functions.py build_ext --inplace \
34+
&& cd - \
35+
&& hmmpress -f single-copy_markers/Bacteria_single_copy.hmm \
36+
&& hmmpress -f single-copy_markers/Archaea_single_copy.hmm
37+
38+
ENV PATH="/pipeline:/validation:${PATH}"
39+
# Test pipeline entrypoints
40+
RUN recursive_dbscan.py -h \
41+
&& calculate_read_coverage.py -h \
42+
&& run_autometa.py -h \
43+
&& make_contig_table.py -h \
44+
&& make_marker_table.py -h \
45+
&& cluster_taxonomy.py -h \
46+
&& lca.py -h \
47+
&& cluster_process.py -h \
48+
&& make_taxonomy_table.py -h \
49+
&& add_contig_taxonomy.py &> /dev/null

README.md

Lines changed: 164 additions & 110 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)