From 4ea1139fda808f75fdc58613d3a80a29fb2c374c Mon Sep 17 00:00:00 2001 From: Sina Majidian Date: Mon, 22 Sep 2025 14:23:18 -0400 Subject: [PATCH 1/8] add debug --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 925b202..6fbb90d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -58,7 +58,7 @@ jobs: - name: Test run: | - docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/output:/out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /out/output + docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/output:/out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /out/output --debug --threads 1 if [ ! -f output/tree_sample_1.nwk ] ; then exit 1; fi - name: Login to DockerHub From 450fb35422cfa7ff7c3a6d4d1a232ed8a0d95a7e Mon Sep 17 00:00:00 2001 From: Sina Majidian Date: Mon, 22 Sep 2025 14:25:31 -0400 Subject: [PATCH 2/8] add minimap2 in env --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index d4eb262..5355b12 100644 --- a/environment.yml +++ b/environment.yml @@ -19,7 +19,7 @@ dependencies: - mafft - iqtree - ngmlr - - nextgenmap + - minimap2 - samtools - filelock - pysam From d1e3c2b0ea37b0e1efa376007553c646ee867be4 Mon Sep 17 00:00:00 2001 From: Sina Majidian Date: Mon, 22 Sep 2025 14:27:13 -0400 Subject: [PATCH 3/8] add dev to github action for docker image --- .github/workflows/docker-image.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 6fbb90d..a8a18d7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,7 +2,9 @@ name: Docker Image CI on: push: - branches: [ main ] + branches: + - main + - dev pull_request: branches: [ main ] release: From 85d36d28991a2f07aa72f776ab7f2512e5b1969a Mon Sep 17 00:00:00 2001 From: Sina Majidian Date: Mon, 22 Sep 2025 14:44:21 -0400 Subject: [PATCH 4/8] fix exit code with correct output file --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a8a18d7..28c5f9c 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -61,7 +61,7 @@ jobs: name: Test run: | docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/output:/out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /out/output --debug --threads 1 - if [ ! -f output/tree_sample_1.nwk ] ; then exit 1; fi + if [ ! -f /out/output/tree_sample_1.nwk ] ; then exit 1; fi - name: Login to DockerHub if: github.event_name != 'pull_request' && github.event_name != 'push' From 97c92f80bee3b51645de2fd7f10bdcb1a053b28b Mon Sep 17 00:00:00 2001 From: Sina Majidian Date: Mon, 22 Sep 2025 14:59:18 -0400 Subject: [PATCH 5/8] wip trying to fix docker output folder --- .github/workflows/docker-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 28c5f9c..25bbb06 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -61,6 +61,9 @@ jobs: name: Test run: | docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/output:/out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /out/output --debug --threads 1 + ls -l /out/output + ls -l /out + ls -l / if [ ! -f /out/output/tree_sample_1.nwk ] ; then exit 1; fi - name: Login to DockerHub From f4b3ff10305b79ea9b84df275d797677e6dcb4f6 Mon Sep 17 00:00:00 2001 From: Sina Majidian Date: Mon, 22 Sep 2025 15:20:08 -0400 Subject: [PATCH 6/8] wip trying to fix docker output folder --- .github/workflows/docker-image.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 25bbb06..90e97d9 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -60,11 +60,10 @@ jobs: - name: Test run: | - docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/output:/out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /out/output --debug --threads 1 - ls -l /out/output - ls -l /out - ls -l / - if [ ! -f /out/output/tree_sample_1.nwk ] ; then exit 1; fi + docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/outside_docker_out:/inside_docker_out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /inside_docker_out/output --debug --threads 1 + ls -l $PWD/outside_docker_out + ls -l $PWD/outside_docker_out/output + if [ ! -f $PWD/outside_docker_out/output/tree_sample_1.nwk ] ; then exit 1; fi - name: Login to DockerHub if: github.event_name != 'pull_request' && github.event_name != 'push' From 533b34a9d637a6d75e3cf79a7c27a9e72c1b2cca Mon Sep 17 00:00:00 2001 From: Sina Majidian Date: Mon, 22 Sep 2025 15:29:53 -0400 Subject: [PATCH 7/8] fixed docker output folder --- .github/workflows/docker-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 90e97d9..8b935f0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -60,8 +60,11 @@ jobs: - name: Test run: | + echo "docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/outside_docker_out:/inside_docker_out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /inside_docker_out/output --debug --threads 1"; docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/outside_docker_out:/inside_docker_out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /inside_docker_out/output --debug --threads 1 + echo "ls -l $PWD/outside_docker_out" ls -l $PWD/outside_docker_out + echo "ls -l $PWD/outside_docker_out/output" ls -l $PWD/outside_docker_out/output if [ ! -f $PWD/outside_docker_out/output/tree_sample_1.nwk ] ; then exit 1; fi - From 430fbcca6193ac5989b93ba94307e931d8e068d0 Mon Sep 17 00:00:00 2001 From: Sina Majidian Date: Mon, 22 Sep 2025 15:46:29 -0400 Subject: [PATCH 8/8] update readme for new release --- README.md | 8 +++----- archive/requirements.txt | 1 - read2tree/TreeInference.py | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 06ecd1e..17607cd 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,8 @@ read2tree is a software tool that allows to obtain alignment matrices for tree i read2tree works in linux with [![Python 3.10.8](https://img.shields.io/badge/python-3.10.8-blue.svg)](https://www.python.org/downloads/release/python-310/) -## Important note -If you want to re-run a read2tree analysis (after facing an error, or changing the inputs), please make sure that you removed the `mplog.log` file and the output folder. Alternatively you could start from an empty folder. Otherwise, read2tree might use the faulty output of previous unfinished run. - -We are working on a new [read2tree version](https://github.com/DessimozLab/read2tree/tree/minimap2) using the [minimap2](https://github.com/lh3/minimap2) aligner, which is much faster. For this version, the `--read_type` argument could be either `short`, `long-hifi` or `long-ont`. You could also use `--threads 40` to be used with minimap2. +## New release +We are now realasing Read2Tree v2.0.0 with improved spead and logging. As the aligner, we are now using minimap2 [minimap2](https://github.com/lh3/minimap2). Also, MAFFT and IQtree are now using multiple threads. We would suggest to run r2t with `--debug` which helps to debug later. Please note that arguments have slightly changed in this release(see below for details). ## Read2Tree Talk: @@ -140,7 +138,7 @@ read2tree --tree --standalone_path marker_genes/ --reads sample_1.fastq sample_2 #### Run test example using docker (to be updated ) ``` -docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/output:/out -v $PWD/run:/run dessimozlab/read2tree:latest --tree --standalone_path /input/marker_genes --dna_reference /input/cds-marker_genes.fasta.gz --reads /reads/sample_1.fastq --output_path /out +docker run --rm -i -v $PWD/tests:/input -v $PWD/tests/:/reads -v $PWD/outside_docker_out:/inside_docker_out -v $PWD/run:/run ${{ env.TEST_TAG }} --tree --standalone_path /input/marker_genes --dna_reference /input/dna_ref.fa --reads /reads/sample_1.fastq --output_path /inside_docker_out/output --debug --threads 1 ``` ### output files diff --git a/archive/requirements.txt b/archive/requirements.txt index e6daf59..f62b0f2 100644 --- a/archive/requirements.txt +++ b/archive/requirements.txt @@ -11,6 +11,5 @@ six>=1.10.0 requests>=2.13.0 dendropy>=4.3.0 tqdm>=4.19.1 -pyham pyyaml multiprocessing_logging diff --git a/read2tree/TreeInference.py b/read2tree/TreeInference.py index 07c1f91..e8a91a4 100644 --- a/read2tree/TreeInference.py +++ b/read2tree/TreeInference.py @@ -52,6 +52,7 @@ def _infer_tree(self, concat_alignment): iqtree_wrapper.options.options['-m'].set_value('LG') iqtree_wrapper.options.options['-nt'].set_value(self.args.threads) tree = iqtree_wrapper() + logger.info("Tree is written to " + os.path.join(output_folder, "tree_" + self._species_name + ".nwk")) with open(os.path.join(output_folder, "tree_" + self._species_name + ".nwk"), "w") as text_file: text_file.write("{}".format(tree)) self.tree = "{}".format(tree)