diff --git a/README.rst b/README.rst index 651aae7..2a43625 100644 --- a/README.rst +++ b/README.rst @@ -28,9 +28,8 @@ Author Citations --------- -Einarsson, SV and Rivers, AR. ITSxpress Version 2: Software to rapidly trim internal - transcribed spacer sequences with quality scores for amplicon sequencing. -Microbiology Spectrum. In press, 2024. +Einarsson, SV and Rivers, AR. ITSxpress Version 2: Software to rapidly trim internal +transcribed spacer sequences with quality scores for amplicon sequencing. Microbiology Spectrum. In press, 2024. Rivers AR, Weber KC, Gardner TG, Liu, S, Armstrong, SD. ITSxpress: Software to rapidly trim internally transcribed spacer sequences with quality scores for marker gene @@ -71,7 +70,7 @@ Installing ITSxpress for use as a QIIME2 Plugin To install ITSxpress as a plugin for QIIME 2 first install QIIME 2 as a separate Conda/Mamba environemnt using thier instructions https://docs.qiime2.org/2024.5/install/ then add ITSxress to the QIIME 2 Conda environment. The examples below are for QIIME2 2 -version 2024.5 an so please update the commands if you want a newer release. +version 2024.2 an so please update the commands if you want a newer release. For Linux: diff --git a/changelog.md b/changelog.md index 3ecc419..c66cf05 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ -2.1.1 (2024-9-19) ------------------- +# 2.1.2 (2024-9-23) + +- Fixed bug [Issue 54](https://github.com/USDA-ARS-GBRU/itsxpress/issues/54) that casued `--tempdir` input to be ignored in the ITSxpress CLI and updated q2_itsxpress.py and test code for this change. +- updates to Dockerfile +- updates to changelog formatting and readme + + +# 2.1.1 (2024-9-19) + - Changed settings to allow FASTQ quality scores up to 93. This prevents an error in processing some reads from PacBio, Nanopore and Element Biosciences AVITI sequencers with quality scores over 41. - Updated from manual software versioning to automated versioning based on git tag metadata and `setuptools-scm`. - Updated Github action workflow for QIIME 2024.5 and Python 3.9.19 @@ -9,8 +16,8 @@ - Cleaned up some PEP formatting -2.1.0 (2024-4-10) ------------------- +# 2.1.0 (2024-4-10) + - HMMs are updated to version 2 of the HMM database curated by Henrik Nilson at the University of Gothenburg. -Version 2 (see https://github.com/USDA-ARS-GBRU/ITS_HMMs) -5 April 2024 @@ -21,22 +28,22 @@ - Added option of Y.hmm to ITSxpress standalone and Qiime2 plugin - Added documentation for Apple Silicon chip support. -2.0.2 (2024-3-20) ------------------- +# 2.0.2 (2024-3-20) + - Fixed a bug where the 3' end of the ITS region was not being trimmed from both forward and reverse reads if the read extended past the ITS region. This was due to the trimming being done at the start of both forward and reverse reads and not the end of each read. Thus if the read overlaped the opposite end of the ITS read, part of the conserved region would still be found on the ends of the forward and reverse read. This was fixed by trimming to just the ITS region for both forward and reverse reads. This bug did not affect the results of ASV calling with Dada2 becasue Dada2 ignored sequecne beyond the ITS region. This fix will make the output more consistent with expectation. - Fixed a bug for submodule logging, where submodules were not logging to the main log file. This was fixed by passing the log file to the submodules and having them write to the same log file. This issue was introduced in version 2.0.0. - Added unit test to confirm that the 3' end of the ITS region is being trimmed from both forward and reverse reads. -2.0.1 (2023-11-07) ------------------- +# 2.0.1 (2023-11-07) + Fix single-end logic bug, which looked for a reverse read file even if single-end reads were provided because the single_end flag wasn't indicated by user. Fix unit test bug, which was failing because the test data was interleaved and the test was expecting single-end reads. This was due to the logic bug mentioned above being fixed. -2.0.0 (2023-06-28) ------------------- +# 2.0.0 (2023-06-28) + Release Highlights - Removed BBmap dependency - BBmap scripts are no longer used in the pipeline, including: @@ -52,8 +59,8 @@ Release Highlights Bug Fixes - Fixed bug where the q2-itsxpress plugin was not handling single-end reads correctly, and was looking for a reverse read file -1.8.1 (2023-06-02) ------------------- +# 1.8.1 (2023-06-02) + Release Highlights - This is the final version that uses BBmap scripts. The next version will remove the BBmap dependency and use Vsearch for all steps. @@ -66,58 +73,58 @@ Release Highlights - Added read count output to log file -1.8.0 (2019-12-9) ------------------ +# 1.8.0 (2019-12-9) + - Added support for primer sets in the reverse orientation - Fixed a bug that could cause crashes when an intermediate file was empty -1.7.2 (2018-11-8) ------------------ +# 1.7.2 (2018-11-8) + - This release fixes issue [#8](https://github.com/USDA-ARS-GBRU/itsxpress/issues/8) - This issue caused ITSxpress to incorrectly trim about 0.2% of read pairs. Sometimes this would result in it writing blank fastq records which would cause Qiime to detect an error and stop processing. -1.7.0 (2018-09-12) ------------------- +# 1.7.0 (2018-09-12) + New Features: - Support for the output of unmerged paired end files. This allows users to use Dada2 for sequence variant calling. - The API is now documented at ReadTheDocs -1.6.4 (2018-7-26) ------------------ +# 1.6.4 (2018-7-26) + - Fix for issue validating fastq.gz files that was not solved by v1.6.3 -1.6.3 (2018-7-25) ------------------ +# 1.6.3 (2018-7-25) + - Fixed issue validating fastq.gz and added tests. -1.6.2 (2018-7-25) ------------------ +# 1.6.2 (2018-7-25) + - This release fixes an error that occasionally occurred when validating FASTQ files. ITSxpress used BBtools reformat.sh which occasionally threw an exception when validating FASTQ files due to a race condition. FASTQ file validation is now done with Biopython instead. -1.6.1 (2018-7-19) ------------------ +# 1.6.1 (2018-7-19) + - Changed the default clustering identity to 99.5%. - Experiments with fungal soil samples showed that ITSxpress and ITSx trimmed 99.822% of reads in the ITS1 region within 2 bases of each other and 99.099% of reads in the ITS2 region within 2 bases of each other at 99.5% identity. For higher accuracy, dereplication can be run at at 100% identity. -1.6.0 (2018-7-13) ------------------ +# 1.6.0 (2018-7-13) + - This release adds a new feature to cluster merged sequences at less than 100% identity. This speeds up typical dataset trimming by about 10x over previous versions depending on the sample, without major effects on trimming accuracy. This feature is controlled with the --cluster_id flag. Default behavior is now to cluster at 0.987 identity. -1.5.6 (2018-7-3) ------------------ +# 1.5.6 (2018-7-3) + - Database is now included in the release -1.5.4 (2018-6-27) ------------------ +# 1.5.4 (2018-6-27) + - Fixed bug in handling of temporary files files specified with the --tempfile flag - updated readme - fixed issues with exception handling -1.5.2 (2018-6-21) ------------------ +# 1.5.2 (2018-6-21) + - Fixed an indexing error causing ITS trimming to be off by 1 base. - Fixed error when raising file not found exception - removed old readme diff --git a/docker-images/Dockerfile b/docker-images/Dockerfile index 9124793..405492a 100644 --- a/docker-images/Dockerfile +++ b/docker-images/Dockerfile @@ -2,7 +2,7 @@ FROM condaforge/mambaforge:24.7.1-0 # # Install system dependencies RUN apt-get update && \ - apt-get install -y build-essential && \ + apt-get install -y --no-install-recommends build-essential && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -14,8 +14,7 @@ RUN mamba install -c bioconda vsearch=2.22.1 hmmer=3.1b2 # Copy the itsxpress package files and install dependencies COPY .. /app -WORKDIR /app -RUN git clone https://github.com/USDA-ARS-GBRU/itsxpress.git && cd itsxpress && pip install . +RUN cd /app && git clone https://github.com/USDA-ARS-GBRU/itsxpress.git && cd itsxpress && pip install . # Set the default command to run itsxpress CMD ["itsxpress"] diff --git a/itsxpress/Dedup.py b/itsxpress/Dedup.py index 08e03af..103f6ff 100644 --- a/itsxpress/Dedup.py +++ b/itsxpress/Dedup.py @@ -1,7 +1,6 @@ import logging import gzip import os -import tempfile from itertools import tee import pyzstd as zstd @@ -271,7 +270,7 @@ def map_func(record): return map(map_func, filt) - def create_trimmed_seqs(self, outfile, gzipped,zstd_file, itspos,wri_file, tempdir=None): + def create_trimmed_seqs(self, outfile, gzipped,zstd_file, itspos,wri_file, tempdir): """Creates a FASTQ file, optionally gzipped, with the reads trimmed to the selected region. Args: @@ -281,14 +280,6 @@ def create_trimmed_seqs(self, outfile, gzipped,zstd_file, itspos,wri_file, tempd itspos (object): an ItsPosition object wri_file (bool): Should file be written or checked for empty sequences? """ - if tempdir: - if not os.path.exists(tempdir): - logging.warning("Specified location for tempfile ({}) does not exist, using default location.".format(tempdir)) - self.tempdir = tempfile.mkdtemp(prefix='itsxpress_') - else: - self.tempdir = tempfile.mkdtemp(prefix='itsxpress_', dir=tempdir) - else: - self.tempdir = tempfile.mkdtemp(prefix='itsxpress_') def _write_seqs(): if gzipped: diff --git a/itsxpress/SeqSample.py b/itsxpress/SeqSample.py index 465ef70..32d2c59 100644 --- a/itsxpress/SeqSample.py +++ b/itsxpress/SeqSample.py @@ -1,6 +1,5 @@ import os import logging -import tempfile import subprocess logger = logging.getLogger(__name__) @@ -16,15 +15,8 @@ class SeqSample: """ - def __init__(self, fastq, tempdir=None): - if tempdir: - if not os.path.exists(tempdir): - logging.warning("Specified location for tempfile ({}) does not exist, using default location.".format(tempdir)) - self.tempdir = tempfile.mkdtemp(prefix='itsxpress_') - else: - self.tempdir = tempfile.mkdtemp(prefix='itsxpress_', dir=tempdir) - else: - self.tempdir = tempfile.mkdtemp(prefix='itsxpress_') + def __init__(self, fastq, tempdir): + self.tempdir = tempdir self.fastq = fastq self.uc_file = None self.rep_file = None diff --git a/itsxpress/__init__.py b/itsxpress/__init__.py index a2a22bd..9b5d83e 100644 --- a/itsxpress/__init__.py +++ b/itsxpress/__init__.py @@ -12,7 +12,7 @@ except ModuleNotFoundError as e: #logging print("{}.Could not initialize the Qiime plugin portion of ITSxpress. Command line ITSxpress will still work normally. If you wish to use the Qiime2 ITSxpress plugin, you need to install Qiime2 first into your environment.\n".format(e)) - pass + __all__ = ["main", "definitions"] diff --git a/itsxpress/main.py b/itsxpress/main.py index 50adf77..e876d85 100755 --- a/itsxpress/main.py +++ b/itsxpress/main.py @@ -35,6 +35,7 @@ import os import shutil import math +import tempfile from itertools import tee from numpy import empty @@ -233,6 +234,46 @@ def core(file): reads = core(file2) logging.info("Total number of reads in file {} is {}.".format(file2, reads)) +def create_temp_directory(tempdir_arg=None): + """ + Creates a temporary directory at a user-defined location or at the default location. + The directory name is prefixed with 'itsxpress_'. + + Ensures no file with the same name exists before creating the directory. + + Parameters: + - tempdir_arg (str): Path to a directory provided by the user. If None, + a new temporary directory is created at the default location. + + Returns: + - str: Path to the temporary directory, or None if there was an error. + """ + try: + if tempdir_arg: + if not os.path.exists(tempdir_arg): + os.makedirs(tempdir_arg) + logging.info(f"Directory '{tempdir_arg}' has been created.") + else: + if os.path.isfile(tempdir_arg): + logging.error(f"A file with the same name '{tempdir_arg}' already exists. Cannot create directory.") + return None + logging.info(f"Directory '{tempdir_arg}' already exists.") + + # Try creating a unique temporary directory inside user-specified directory + temp_dir = tempfile.mkdtemp(prefix="itsxpress_", dir=tempdir_arg) + logging.info(f"Temporary directory '{temp_dir}' has been created at the user-defined location.") + else: + # Create a temporary directory at default location + temp_dir = tempfile.mkdtemp(prefix="itsxpress_") + logging.info(f"Temporary directory '{temp_dir}' has been created at the default location.") + + return temp_dir + + except Exception as e: + logging.error(f"Failed to create temporary directory: {e}") + return None + + def main(args=None): """Run Complete ITS trimming workflow. """ @@ -248,14 +289,14 @@ def main(args=None): _check_fastqs(args.fastq, args.fastq2) # Parse input types paired_end = _is_paired(args.fastq, args.fastq2, args.single_end) + session_tempdir = create_temp_directory(tempdir_arg=args.tempdir) if paired_end: logging.info("Sequences are paired-end in two files. They will be merged using Vsearch.") - sobj = SeqSamplePairedNotInterleaved(fastq=args.fastq, fastq2=args.fastq2, tempdir=args.tempdir, reversed_primers=args.reversed_primers) + sobj = SeqSamplePairedNotInterleaved(fastq=args.fastq, fastq2=args.fastq2, tempdir=session_tempdir, reversed_primers=args.reversed_primers) sobj._merge_reads(threads=str(args.threads), stagger=args.allow_staggered_reads) elif not paired_end: logging.info("Sequences are assumed to be single-end.") - sobj = SeqSampleNotPaired(fastq=args.fastq, tempdir=args.tempdir) - logging.info("Temporary directory is: {}".format(sobj.tempdir)) + sobj = SeqSampleNotPaired(fastq=args.fastq, tempdir=session_tempdir) # Deduplicate logging.info("Unique sequences are being written to a temporary FASTA file with Vsearch.") if math.isclose(args.cluster_id, 1, rel_tol=1e-05): @@ -320,12 +361,11 @@ def main(args=None): finally: try: if not args.keeptemp: - shutil.rmtree(sobj.tempdir) + shutil.rmtree(session_tempdir) except UnboundLocalError: pass except AttributeError: pass - if __name__ == '__main__': main() diff --git a/itsxpress/q2_itsxpress.py b/itsxpress/q2_itsxpress.py index 3ab980a..00f7392 100644 --- a/itsxpress/q2_itsxpress.py +++ b/itsxpress/q2_itsxpress.py @@ -19,6 +19,7 @@ import pathlib import shutil import math +import tempfile import pandas as pd from q2_types.per_sample_sequences import (SingleLanePerSamplePairedEndFastqDirFmt, @@ -28,11 +29,13 @@ from itsxpress.definitions import (taxa_dict, ROOT_DIR) -default_cluster_id=0.995 +#default_cluster_id=0.995 +default_cluster_id=1.0 def _set_fastqs_and_check(fastq: str, fastq2: str, + tempdir: str, sample_id: str, single_end: bool, reversed_primers: bool, @@ -67,18 +70,18 @@ def _set_fastqs_and_check(fastq: str, raise ValueError("There is a problem with the fastq file(s) you selected") # Create SeqSample objects and merge if needed. - + if paired_end: sobj = itsxpress.SeqSamplePairedNotInterleaved(fastq=fastq, fastq2=fastq2, - tempdir=None, + tempdir=tempdir, reversed_primers=reversed_primers) sobj._merge_reads(threads=threads,stagger=allow_staggered_reads) return sobj elif not paired_end: sobj = itsxpress.SeqSampleNotPaired(fastq=fastq, - tempdir=None) + tempdir=tempdir) return sobj @@ -189,6 +192,11 @@ def main(per_sample_sequences, # Setting the taxa taxa = _taxa_prefix_to_taxa(taxa) samples = per_sample_sequences.manifest.view(pd.DataFrame) + try: + tempdir = tempfile.mkdtemp(prefix='itsxpress_') + # print("tempdir location {}".format(tempdir)) + except Exception as e: + raise ValueError("Could not create temporary directory") # Creating result dir results = CasavaOneEightSingleLanePerSampleDirFmt() # Running the for loop for each sample @@ -197,6 +205,7 @@ def main(per_sample_sequences, sobj = _set_fastqs_and_check( fastq=sample.forward, fastq2=sample.reverse if paired_in else None, + tempdir=tempdir, sample_id=sample.Index, single_end=False if paired_in else True, reversed_primers=reversed_primers, @@ -250,6 +259,6 @@ def main(per_sample_sequences, wri_file=True, tempdir=sobj.tempdir) # Deleting the temp files. - shutil.rmtree(sobj.tempdir) + shutil.rmtree(tempdir) # Writing out the results. return results diff --git a/tests/test_main_pytest.py b/tests/test_main_pytest.py index d4241d2..8b0762f 100755 --- a/tests/test_main_pytest.py +++ b/tests/test_main_pytest.py @@ -117,39 +117,32 @@ def test_dedup_create_trimmed_seqs_zst(): assert length == 42637 shutil.rmtree(tf) -#Following test is removed in ITSxpress version 2.0.0, as interleaved files are no longer supported. - -# def test_seq_sample_paired_interleaved(): -# fastq = os.path.join(TEST_DIR, "test_data", "4774-1-MSITS3_interleaved.fastq") -# sobj = itsxpress.main.SeqSamplePairedInterleaved(fastq=fastq, tempdir=".") -# sobj._merge_reads(threads=1) -# sobj.deduplicate(threads=1) -# sobj._search(hmmfile=hmmfile, threads=1) -# shutil.rmtree(sobj.tempdir) - #Following test will fail if Vsearch version is less than 2.20 or hmmer is not installed def test_seq_sample_not_paired(): + tf = tempfile.mkdtemp() fastq = os.path.join(TEST_DIR,"test_data", "4774-1-MSITS3_merged.fastq") - sobj = itsxpress.main.SeqSampleNotPaired(fastq=fastq, tempdir=".") + sobj = itsxpress.main.SeqSampleNotPaired(fastq=fastq, tempdir=tf) sobj.deduplicate(threads=1) sobj._search(hmmfile=hmmfile, threads=1) - shutil.rmtree(sobj.tempdir) + shutil.rmtree(tf) def test_seq_sample_not_paired_clustered(): + tf = tempfile.mkdtemp() fastq = os.path.join(TEST_DIR,"test_data", "4774-1-MSITS3_merged.fastq") - sobj = itsxpress.main.SeqSampleNotPaired(fastq=fastq, tempdir=".") + sobj = itsxpress.main.SeqSampleNotPaired(fastq=fastq, tempdir=tf) sobj.cluster(threads=1, cluster_id=0.995) sobj._search(hmmfile=hmmfile, threads=1) - shutil.rmtree(sobj.tempdir) + shutil.rmtree(tf) def test_seq_sample_paired_not_interleaved(): + tf = tempfile.mkdtemp() fastq = os.path.join(TEST_DIR, "test_data", "4774-1-MSITS3_R1.fastq") fastq2 = os.path.join(TEST_DIR, "test_data", "4774-1-MSITS3_R2.fastq") - sobj = itsxpress.main.SeqSamplePairedNotInterleaved(fastq=fastq, tempdir=".", fastq2=fastq2) + sobj = itsxpress.main.SeqSamplePairedNotInterleaved(fastq=fastq, tempdir=tf, fastq2=fastq2) sobj._merge_reads(stagger = True, threads=1) sobj.deduplicate(threads=1) sobj._search(hmmfile=hmmfile, threads=1) - shutil.rmtree(sobj.tempdir) + shutil.rmtree(tf) def test_is_paired(): @@ -168,28 +161,14 @@ def test_myparser(): args = parser.parse_args(['--fastq', 'test.fastq','--outfile', 'test.out','--tempdir', 'dirt','--region','ITS1','--taxa', 'Fungi']) assert (args.fastq == 'test.fastq') -#Following test is removed as interleaved files aren't supported in version 2 of itsxpress -# def test_main_interleaved(): -# parser = itsxpress.main.myparser() -# tf = tempfile.mkdtemp() -# print(tf) -# fastq = os.path.join(TEST_DIR, "test_data", "4774-1-MSITS3_interleaved.fastq") -# outfile = os.path.join(tf,'testout.fastq') -# args = parser.parse_args(['--fastq', fastq,'--outfile', outfile, '--region','ITS2', '--taxa', 'Fungi', '--keeptemp']) -# itsxpress.main.main(args=args) -# seqs = SeqIO.parse(outfile, 'fastq') -# n = sum(1 for _ in seqs) -# print(n) -# assert (n == 227) -# shutil.rmtree(tf) def test_main_paired(): parser = itsxpress.main.myparser() tf = tempfile.mkdtemp() - fastq = os.path.join(TEST_DIR,"test_data", "4774-1-MSITS3_R1.fastq") - fastq2 = os.path.join(TEST_DIR,"test_data", "4774-1-MSITS3_R2.fastq") - outfile = os.path.join(tf,'testout.fastq') - validation = os.path.join(TEST_DIR,"test_data", "testout.fastq") + fastq = os.path.join(TEST_DIR, "test_data", "4774-1-MSITS3_R1.fastq") + fastq2 = os.path.join(TEST_DIR, "test_data", "4774-1-MSITS3_R2.fastq") + outfile = os.path.join(tf, 'testout.fastq') + validation = os.path.join(TEST_DIR, "test_data", "testout.fastq") args = parser.parse_args(['--fastq', fastq, '--fastq2', fastq2, '--outfile', outfile, '--region','ITS2', '--taxa', 'Fungi', '--threads', '1']) itsxpress.main.main(args=args) seqs = SeqIO.parse(outfile, 'fastq') @@ -202,16 +181,15 @@ def test_main_paired_high_qual(): """ parser = itsxpress.main.myparser() tf = tempfile.mkdtemp() - fastq = os.path.join(TEST_DIR,"test_data", "high_qual_scores_R1.fastq.gz") - fastq2 = os.path.join(TEST_DIR,"test_data", "high_qual_scores_R2.fastq.gz") - outfile = os.path.join(tf,'testout.fastq') + fastq = os.path.join(TEST_DIR, "test_data", "high_qual_scores_R1.fastq.gz") + fastq2 = os.path.join(TEST_DIR, "test_data", "high_qual_scores_R2.fastq.gz") + outfile = os.path.join(tf, 'testout.fastq') validation = os.path.join(TEST_DIR,"test_data", "testout.fastq") args = parser.parse_args(['--fastq', fastq, '--fastq2', fastq2, '--outfile', outfile, '--region','ITS2', '--taxa', 'Fungi', '--threads', '1']) itsxpress.main.main(args=args) seqs = SeqIO.parse(outfile, 'fastq') n = sum(1 for _ in seqs) print(n) - #assert (n == 227) #assert (n==235) shutil.rmtree(tf) @@ -276,7 +254,7 @@ def test_create_paired_trimmed_seqs(): fastq2 = os.path.join(TEST_DIR, "test_data", "4774-1-MSITS3_R2.fastq") dedup = itsxpress.main.Dedup(uc_file=uc, rep_file=rep, seq_file=seq, fastq=fastq, fastq2=fastq2) itspos = itsxpress.main.ItsPosition(os.path.join(TEST_DIR,"test_data", "ex_tmpdir", "domtbl.txt"), "ITS2") - tf = tempfile.mkdtemp(".") + tf = tempfile.mkdtemp() print(tf) t1 = os.path.join(tf,'t2_r1.fq') t2 = os.path.join(tf,'t2_r2.fq') @@ -300,6 +278,8 @@ def test_create_paired_trimmed_seqs(): import pandas as pd import itsxpress.q2_itsxpress as q2_itsxpress import itsxpress.plugin_setup + + tempdir = tempfile.mkdtemp() # The test data dir TEST_DIR = os.path.join(os.path.dirname(os.path.abspath(__name__)),"tests") # Test info 1 @@ -363,6 +343,7 @@ def test_single(self): for sample in samples.itertuples(): obs = q2_itsxpress._set_fastqs_and_check(fastq=sample.forward, fastq2=None, + tempdir=tempdir, sample_id=sample.Index, single_end=True, reversed_primers=False, @@ -374,6 +355,7 @@ def test_paired(self): for sample in samples.itertuples(): obs = q2_itsxpress._set_fastqs_and_check(fastq=sample.forward, fastq2=sample.reverse, + tempdir=tempdir, sample_id=sample.Index, single_end=True, reversed_primers=False, @@ -381,25 +363,6 @@ def test_paired(self): threads=1) self.assertTrue("4774-1-MSITS3" in obs.fastq) - #This test seems to test bbmap? It doesn't fail in V2 - # def test_trim_pair_no_bb(self): - # samples = TEST_DATA.manifest.view(pd.DataFrame) - # for sample in samples.itertuples(): - # with pytest.raises(ValueError): - # q2_itsxpress._set_fastqs_and_check(fastq=sample.forward, - # fastq2=sample.reverse, - # sample_id=sample.Index, - # single_end=False, - # reversed_primers=False, - # threads=1) - # with pytest.raises(ValueError): - # q2_itsxpress._set_fastqs_and_check(fastq=sample.forward, - # fastq2=sample.reverse, - # sample_id=sample.Index, - # single_end=True, - # reversed_primers=False, - # threads=1) - def test_trim_single_no_cluster(): threads = 1 taxa = "F" @@ -407,6 +370,7 @@ def test_trim_single_no_cluster(): # Fix for missing argument obs = q2_itsxpress._set_fastqs_and_check(fastq=sample.forward, fastq2=None, + tempdir=tempdir, sample_id=sample.Index, single_end=True, reversed_primers=False, @@ -416,25 +380,6 @@ def test_trim_single_no_cluster(): -#This test seems to test bbmap? It doesn't fail in V2 - # def test_trim_pair_no_bb(self): - # samples = TEST_DATA.manifest.view(pd.DataFrame) - # for sample in samples.itertuples(): - # with pytest.raises(ValueError): - # q2_itsxpress._set_fastqs_and_check(fastq=sample.forward, - # fastq2=sample.reverse, - # sample_id=sample.Index, - # single_end=False, - # reversed_primers=False, - # threads=1) - # with pytest.raises(ValueError): - # q2_itsxpress._set_fastqs_and_check(fastq=sample.forward, - # fastq2=sample.reverse, - # sample_id=sample.Index, - # single_end=True, - # reversed_primers=False, - # threads=1) - def test_trim_single_no_cluster(): threads = 1 taxa = "F"