### Verify EukDetect installation Source: https://github.com/allind/eukdetect/blob/master/README.md Runs the EukDetect help command to verify the installation. This is the fourth step of the GitHub installation option. ```bash eukdetect --help ``` -------------------------------- ### Install EukDetect from Bioconda Source: https://github.com/allind/eukdetect/blob/master/README.md Creates a new conda environment named 'eukdetect2' and installs EukDetect from the bioconda channel. This is the recommended installation method. ```bash conda create -n eukdetect2 -c bioconda eukdetect ``` -------------------------------- ### Run test suite Source: https://github.com/allind/eukdetect/blob/master/README.md Runs the test suite to verify installation. ```bash pytest tests/ -v ``` -------------------------------- ### Install EukDetect in editable mode Source: https://github.com/allind/eukdetect/blob/master/README.md Installs EukDetect in editable mode using pip. This is the third step of the GitHub installation option. ```bash pip install -e . ``` -------------------------------- ### Using fixtures in tests Source: https://github.com/allind/eukdetect/blob/master/tests/README.md Example of using the test_fastq_files fixture to access single-end and paired-end test files. ```python def test_with_fixture(test_fastq_files): """Pytest provides test_fastq_files fixture automatically""" se_file = test_fastq_files['se'] pe1_file = test_fastq_files['pe1'] pe2_file = test_fastq_files['pe2'] # Test with these files ``` -------------------------------- ### Clone EukDetect repository from GitHub Source: https://github.com/allind/eukdetect/blob/master/README.md Clones the EukDetect repository and changes into the EukDetect directory. This is the first step of the GitHub installation option. ```bash git clone https://github.com/allind/EukDetect.git cd EukDetect ``` -------------------------------- ### Create conda environment from YAML file Source: https://github.com/allind/eukdetect/blob/master/README.md Creates the conda environment using the provided environment file and activates it. This is the second step of the GitHub installation option. ```bash conda env create -f eukdetect/envs/eukdetect2_environment.yml conda activate eukdetect ``` -------------------------------- ### Install EukDetect in development mode Source: https://github.com/allind/eukdetect/blob/master/tests/README.md Creates a conda environment from environment.yml and installs EukDetect in editable mode. The conda environment includes pytest and pytest-cov, so no additional test dependencies are needed. ```bash # Create conda environment from environment.yml conda env create -f eukdetect/envs/eukdetect2_environment.yml conda activate eukdetect # Install EukDetect in editable mode pip install -e . ``` -------------------------------- ### GitHub Actions workflow for tests Source: https://github.com/allind/eukdetect/blob/master/tests/README.md YAML configuration for a GitHub Actions workflow that sets up conda, installs the package, runs tests with coverage, and uploads coverage to Codecov. ```yaml name: Tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: conda-incubator/setup-miniconda@v2 with: environment-file: eukdetect/envs/eukdetect2_environment.yml activate-environment: eukdetect - name: Install package shell: bash -l {0} run: pip install -e . - name: Run tests shell: bash -l {0} run: pytest tests/ -v --cov=eukdetect --cov-report=xml - name: Upload coverage uses: codecov/codecov-action@v3 ``` -------------------------------- ### Download EukDetect2 database from Zenodo Source: https://github.com/allind/eukdetect/blob/master/README.md Creates a directory named 'eukdb', changes into it, and downloads the database files using zenodo_get. The database is approximately 7.1 GB and is hosted on Zenodo with DOI 10.5281/zenodo.19056625. ```bash mkdir eukdb cd eukdb zenodo_get 19056625 ``` -------------------------------- ### Run EukDetect on a single-end sample Source: https://github.com/allind/eukdetect/blob/master/README.md Processes one single-end sample with EukDetect. Requires forward reads, sample name, output directory, database path, and number of cores. ```bash eukdetect single \ -1 sample.fastq.gz \ -n sample_name \ --outdir results/ \ --database /path/to/eukdb \ --cores 16 ``` -------------------------------- ### Run EukDetect batch mode Source: https://github.com/allind/eukdetect/blob/master/README.md Processes multiple samples in parallel on a local machine. Requires a samples file, output directory, database path, and number of cores. Bowtie2 uses 1 core per sample by default. ```bash eukdetect batch \ --samples samples.tsv \ --outdir results/ \ --database /path/to/eukdb \ --cores 10 ``` -------------------------------- ### Create samples.tsv for single-end batch mode Source: https://github.com/allind/eukdetect/blob/master/README.md Tab-separated file listing sample names and paths to forward reads for batch processing. ```tsv sample_name reads1 sample1 /path/to/sample1.fastq.gz sample2 /path/to/sample2.fastq.gz sample3 /path/to/sample3.fastq.gz ``` -------------------------------- ### Run eukdetect-normalize command Source: https://github.com/allind/eukdetect/blob/master/README.md Normalizes RPKS values and combines with relative abundance data across samples. Requires --eukfrac, --library-sizes, and --output arguments. ```bash eukdetect-normalize \ --eukfrac results/*_filtered_hits_eukfrac.tsv \ --library-sizes library_sizes.tsv \ --output all_samples_normalized.tsv ``` -------------------------------- ### Run EukDetect on a single paired-end sample Source: https://github.com/allind/eukdetect/blob/master/README.md Processes one paired-end sample with EukDetect. Requires forward and reverse reads, sample name, output directory, database path, and number of cores. ```bash eukdetect single \ -1 sample_R1.fastq.gz \ -2 sample_R2.fastq.gz \ -n sample_name \ --outdir results/ \ --database /path/to/eukdb \ --cores 16 ``` -------------------------------- ### Create samples.tsv for paired-end batch mode Source: https://github.com/allind/eukdetect/blob/master/README.md Tab-separated file listing sample names and paths to forward and reverse reads for batch processing. ```tsv sample_name reads1 reads2 sample1 /path/to/sample1_R1.fastq.gz /path/to/sample1_R2.fastq.gz sample2 /path/to/sample2_R1.fastq.gz /path/to/sample2_R2.fastq.gz sample3 /path/to/sample3_R1.fastq.gz /path/to/sample3_R2.fastq.gz ``` -------------------------------- ### Run all tests with pytest Source: https://github.com/allind/eukdetect/blob/master/tests/README.md Commands to run the test suite from the project root, including options for coverage reports and running specific tests, classes, or individual test methods. ```bash # From project root pytest tests/ -v # With coverage report pytest tests/ -v --cov=eukdetect --cov-report=html # Run specific test file pytest tests/test_eukdetect.py -v # Run specific test class pytest tests/test_eukdetect.py::TestValidateCores -v # Run specific test pytest tests/test_eukdetect.py::TestValidateCores::test_valid_cores -v ``` -------------------------------- ### Create library sizes file Source: https://github.com/allind/eukdetect/blob/master/README.md Tab-separated file with sample names and total base counts. Required for normalization. ```tsv sample_name total_bases sample1 7500000000 sample2 11250000000 sample3 15000000000 ``` -------------------------------- ### Run EukDetect alignment only Source: https://github.com/allind/eukdetect/blob/master/README.md Runs only the alignment step using the --mode aln option. Requires forward and reverse reads, sample name, output directory, database path, and cores. ```bash # Run only alignment eukdetect single -1 R1.fq.gz -2 R2.fq.gz -n sample -o out/ -d eukdb/ --mode aln --cores 16 ``` -------------------------------- ### EukDetect Output Directory Structure Source: https://github.com/allind/eukdetect/blob/master/README.md Shows the directory layout created by EukDetect, including configs, logs, alignment, filtering, and final output files. ```text results/ |-- configs/ | `-- config_sample1_1.yml |-- logs/ | `-- snakemake_sample1_20260101_120000.log |-- aln/ | `-- sample1_aln_q10_lenfilter.sorted.bam |-- filtering/ | |-- sample1_aln_q10_lenfilter_complexityfilter_dupfilter.sorted.bam | |-- sample1_aln_q10_lenfilter_complexityfilter_dupfilter.sorted.bam.bai | |-- sample1_read_counts_and_mismatches.tsv | |-- sample1_read_identities.tsv | |-- sample1_reassignment_report.tsv | `-- sample1_all_hits_table.tsv |-- sample1_filtered_hits_table.tsv `-- sample1_filtered_hits_eukfrac.tsv ``` -------------------------------- ### EukDetect single mode command placeholder Source: https://github.com/allind/eukdetect/blob/master/README.md Placeholder for the single mode command-line interface. Use for individual samples or HPC job arrays. ```bash eukdetect single [options] ``` -------------------------------- ### EukDetect batch mode command placeholder Source: https://github.com/allind/eukdetect/blob/master/README.md Placeholder for the batch mode command-line interface. Use for processing multiple samples in parallel locally. ```bash eukdetect batch [options] ``` -------------------------------- ### Compute total bases from FASTQ files Source: https://github.com/allind/eukdetect/blob/master/README.md Shell script to generate library_sizes.tsv from paired-end FASTQ files. For single-end data, omit the second file from the zcat command. ```bash echo -e "sample_name\ttotal_bases" > library_sizes.tsv # Paired-end: sum bases across both read files for sample in sample1 sample2 sample3; do bases=$(zcat ${sample}_R1.fastq.gz ${sample}_R2.fastq.gz \ | awk 'NR%4==2{sum+=length($0)}END{print sum}') echo -e "${sample}\t${bases}" >> library_sizes.tsv done ``` -------------------------------- ### Activate EukDetect conda environment Source: https://github.com/allind/eukdetect/blob/master/README.md Activates the 'eukdetect' conda environment before regenerating the taxonomy database. ```bash conda activate eukdetect ``` -------------------------------- ### Testing exceptions with pytest.raises Source: https://github.com/allind/eukdetect/blob/master/tests/README.md Shows how to test that a function raises an appropriate error using pytest.raises with a match pattern. ```python def test_invalid_input_raises_error(): """Test that function raises appropriate error""" with pytest.raises(ValueError, match="error message"): function_that_should_fail("bad input") ``` -------------------------------- ### Run EukDetect analysis on existing alignments Source: https://github.com/allind/eukdetect/blob/master/README.md Runs filtering and analysis only, requiring existing alignments. Uses the --mode analyze option. ```bash # Run analysis on existing alignments eukdetect single -1 R1.fq.gz -2 R2.fq.gz -n sample -o out/ -d eukdb/ --mode analyze ``` -------------------------------- ### Generate alignment commands for manual execution Source: https://github.com/allind/eukdetect/blob/master/README.md Generates alignment commands for manual execution or cluster submission using the --mode printaln option. ```bash # Generate alignment commands for manual execution or cluster submission eukdetect single -1 R1.fq.gz -2 R2.fq.gz -n sample -o out/ -d eukdb/ --mode printaln ``` -------------------------------- ### Test structure template Source: https://github.com/allind/eukdetect/blob/master/tests/README.md Shows the standard structure for a test class with a test method, including Arrange/Act/Assert comments. ```python class TestFeatureName: """Test description""" def test_specific_behavior(self): """Test that X does Y""" # Arrange input_data = "test" # Act result = function_to_test(input_data) # Assert assert result == expected_output ``` -------------------------------- ### Regenerate ete3 taxonomy database Source: https://github.com/allind/eukdetect/blob/master/README.md Python console commands to update the NCBI taxonomy database using ete3, required if ete3 errors occur. Run from the 'eukdb/' directory. ```python from ete3 import NCBITaxa ncbi = NCBITaxa() ncbi.update_taxonomy_database(taxdump_file="taxdump.tar.gz") exit() ``` -------------------------------- ### Read TSV in Python Source: https://github.com/allind/eukdetect/blob/master/README.md Loads the tab-separated output table in Python using pandas. Missing values are written as 'NA' so the table loads without special handling. ```python pandas.read_csv("sample1_filtered_hits_table.tsv", sep="\t") # Python ``` -------------------------------- ### Read TSV in R Source: https://github.com/allind/eukdetect/blob/master/README.md Loads the tab-separated output table in R. Missing values are written as 'NA' so the table loads without special handling. ```r read.delim("sample1_filtered_hits_table.tsv") # R ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.