### Install miniforge Source: https://hybracter.readthedocs.io/en/latest/install Install miniforge and follow the prompts. ```bash sh Miniforge3-Linux-x86_64.sh ``` -------------------------------- ### Install miniconda Source: https://hybracter.readthedocs.io/en/latest/install Install miniconda and follow the prompts. ```bash sh Miniconda3-latest-Linux-x86_64.sh ``` -------------------------------- ### Download miniforge installer for Linux Source: https://hybracter.readthedocs.io/en/latest/install Download the miniforge installer for Linux x86_64. For other architectures, replace the URL. ```bash curl -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh ``` -------------------------------- ### Copy example Slurm profile files Source: https://hybracter.readthedocs.io/en/latest/profiles Copy the example Slurm profile files (config.yaml and slurm-status.py) into the new profile directory. ```bash # go to your new profile directory cd ~/.config/snakemake/slurm/ # copy the files (either from GitHub or from where you installed hybracter) wget https://raw.githubusercontent.com/gbouras13/hybracter/main/profiles/slurm/config.yaml wget https://raw.githubusercontent.com/gbouras13/hybracter/main/profiles/slurm/slurm_status.py ``` -------------------------------- ### Download miniforge installer for Mac Source: https://hybracter.readthedocs.io/en/latest/install Download the miniforge installer for Mac (Intel, will also work with M1). ```bash curl -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh ``` -------------------------------- ### Install Hybracter with Pip Source: https://hybracter.readthedocs.io/en/latest/install Creates a conda environment with pip, activates it, installs hybracter via pip, and verifies with hybracter --help and hybracter install. Requires conda to be available for dependency installation. ```bash conda create -n hybracterENV pip conda activate hybracterENV pip install hybracter hybracter --help hybracter install ``` -------------------------------- ### Install pbtk with conda Source: https://hybracter.readthedocs.io/en/latest/input Creates a conda environment named 'pacbio' and installs pbtk from bioconda. Activate the environment before using the extraction commands. ```bash conda create -n pacbio -c bioconda pbtk conda activate pacbio ``` -------------------------------- ### Download miniconda installer for Linux Source: https://hybracter.readthedocs.io/en/latest/install Download the miniconda installer for Linux x86_64. For other architectures, replace the URL. ```bash curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh ``` -------------------------------- ### Install Hybracter with Conda Source: https://hybracter.readthedocs.io/en/latest/install Creates a conda environment named hybracterENV, installs hybracter from bioconda and conda-forge, then activates the environment and verifies the installation with hybracter --help and hybracter install. ```bash conda create -n hybracterENV -c bioconda -c conda-forge hybracter conda activate hybracterENV hybracter --help hybracter install ``` -------------------------------- ### Example comparison output from compare_assemblies.py Source: https://hybracter.readthedocs.io/en/latest/output Example visual representation from the comparisons directory showing differences between polishing rounds for a sample. The asterisk (*) marks the position of each difference. An empty file indicates no differences between assemblies. ```text contig_1 37368-37398: ACCATTTTTGTTTTATTTTTTGTAAAGACAC contig_1 37368-37397: ACCATTTTTGTTTTA-TTTTTGTAAAGACAC * contig_1 43247-43277: CAACGTTGTTTTCCCTGAGCCTAAATAACCA contig_1 43246-43276: CAACGTTGTTTTCCCCGAGCCTAAATAACCA * contig_1 44658-44688: CTTGATCTTTATCTATGATTTCATTAATACT contig_1 44657-44687: CTTGATCTTTATCTACGATTTCATTAATACT * ``` -------------------------------- ### Install hybracter databases to a custom directory Source: https://hybracter.readthedocs.io/en/latest/install Installs the hybracter databases to a specified directory using the -d or --databases flag. ```bash hybracter install -d ``` -------------------------------- ### Download miniconda installer for Mac Source: https://hybracter.readthedocs.io/en/latest/install Download the miniconda installer for Mac (Intel, will also work with M1). ```bash curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh ``` -------------------------------- ### Install Hybracter from Source Source: https://hybracter.readthedocs.io/en/latest/install Clones the development version of hybracter from GitHub, installs it in editable mode with pip, and verifies with hybracter --help. This version may include untested features. ```bash git clone https://github.com/gbouras13/hybracter.git cd hybracter pip install -e . hybracter --help ``` -------------------------------- ### Install hybracter databases Source: https://hybracter.readthedocs.io/en/latest/install Installs the hybracter databases (consisting of a plassembler database). Note: users have reported errors due to an MD5 file error caused by Zenodo issues; waiting a few minutes and trying again usually works. ```bash hybracter install ``` -------------------------------- ### hybracter -h command Source: https://hybracter.readthedocs.io/en/latest/input Run 'hybracter -h' to display the help message, which lists all available commands and options. The output shows the usage, options, and the list of commands including install, hybrid, hybrid-single, long, long-single, test-hybrid, test-long, config, citation, and version. ```bash hybracter -h ``` -------------------------------- ### hybracter install Source: https://hybracter.readthedocs.io/en/latest/run Installs the hybracter databases. Optionally specify a directory to store them, which must be provided later with -d when running hybracter. ```APIDOC ## hybracter install ### Description Installs the hybracter databases required for running hybracter. ### Usage ``` hybracter install ``` ### Options - `-d ` (string) - Optional - Directory to store databases. Must be specified with `-d` when running hybracter. ### Example ``` hybracter install -d ``` ``` -------------------------------- ### Run hybracter hybrid test Source: https://hybracter.readthedocs.io/en/latest/install Run a test to verify hybracter installs all required dependencies. Takes 5-10 minutes. ```bash hybracter test-hybrid --threads 8 ``` -------------------------------- ### Run Hybracter with Docker Source: https://hybracter.readthedocs.io/en/latest/install Pulls the Hybracter Docker image (v0.11.0) and runs a hybrid-single assembly with test fastqs, mounting local directories for input and output. The container includes the database and all dependencies, so no separate install or database directory is needed. ```bash docker pull quay.io/gbouras13/hybracter:0.11.0 docker run quay.io/gbouras13/hybracter:0.11.0 hybracter -h # -v mounts directories from your local filesystem to the docker contaier docker run --rm -v /path/to/my/test/fastqs:/data -v /path/to/where/i/want/the/output:/output quay.io/gbouras13/hybracter:0.11.0 hybracter hybrid-single \ -l /data/test_long_reads.fastq.gz \ -1 /data/test_short_reads_R1.fastq.gz \ -2 /data/test_short_reads_R2.fastq.gz \ -o /output/output_test_docker -t 4 –auto ``` -------------------------------- ### Run Hybracter with Singularity Source: https://hybracter.readthedocs.io/en/latest/install Pulls the Hybracter Docker image (v0.10.0) using singularity, sets the container path, and runs a hybrid-single assembly with test fastqs. The container includes the database and all dependencies, so no separate install or database directory is needed. ```bash IMAGE_DIR="" singularity pull --dir $IMAGE_DIR docker://quay.io/gbouras13/hybracter:0.10.0 container="$IMAGE_DIR/hybracter_0.10.0.sif" # example command with test fastqs singularity exec $container hybracter hybrid-single -l test_data/Fastqs/test_long_reads.fastq.gz \ -1 test_data/Fastqs/test_short_reads_R1.fastq.gz -2 test_data/Fastqs/test_short_reads_R2.fastq.gz \ -o output_test_singularity -t 4 -c 50000 ``` -------------------------------- ### Create hybracter environment with miniforge Source: https://hybracter.readthedocs.io/en/latest/install Create a fresh conda environment named hybracterENV with hybracter installed, activate it, and verify with hybracter -h. ```bash conda create -n hybracterENV hybracter conda activate hybracterENV hybracter -h ``` -------------------------------- ### hybracter long-single CLI options and defaults Source: https://hybracter.readthedocs.io/en/latest/run Command-line help output for hybracter long-single, listing all options, defaults, and constraints. Note the --min_depth behavior: Hybracter errors and exits if a sample has less than min_depth*chromosome_size bases of long-reads left after filtlong and porechop-ABI steps. The --mac flag installs Medaka v1.8.0 on Mac because higher versions break. ```bash Usage: hybracter long-single [OPTIONS] [SNAKE_ARGS]... Run hybracter long on 1 isolate Options: -l, --longreads TEXT FASTQ file of longreads [required] -s, --sample TEXT Sample name. [default: sample] -c, --chromosome INTEGER FApproximate lower-bound chromosome length (in base pairs). [default: 1000000] -o, --output PATH Output directory [default: hybracter_out] --configfile TEXT Custom config file [default: config.yaml] -t, --threads INTEGER Number of threads to use [default: 1] --min_length INTEGER min read length for long reads [default: 1000] --min_quality INTEGER min read quality score for long reads in bp. [default: 9] --skip_qc Do not run porechop_abi, filtlong and fastp to QC the reads -d, --databases PATH Plassembler Databases directory. --subsample_depth INTEGER subsampled long read depth to subsample with Filtlong. By default is 100x. [default: 100] --min_depth INTEGER minimum long read depth to continue the run. By default is 0x. Hybracter will error and exit if a sample has less than min_depth*chromosome_size bases of long- reads left AFTER filtlong and porechop-ABI steps are run. [default: 0] --medakaModel [r1041_e82_400bps_sup_v5.0.0|r1041_e82_400bps_hac_v5.0.0|r1041_e82_400bps_hac_v4.3.0|r1041_e82_400bps_sup_v4.3.0|r1041_e82_400bps_hac_v4.2.0|r1041_e82_400bps_sup_v4.2.0|r941_sup_plant_g610|r941_min_fast_g507|r941_prom_fast_g507|r941_min_fast_g303|r941_min_high_g303|r941_min_high_g330|r941_prom_fast_g303|r941_prom_high_g303|r941_prom_high_g330|r941_min_high_g344|r941_min_high_g351|r941_min_high_g360|r941_prom_high_g344|r941_prom_high_g360|r941_prom_high_g4011|r10_min_high_g303|r10_min_high_g340|r103_min_high_g345|r103_min_high_g360|r103_prom_high_g360|r103_fast_g507|r103_hac_g507|r103_sup_g507|r104_e81_fast_g5015|r104_e81_sup_g5015|r104_e81_hac_g5015|r104_e81_sup_g610|r1041_e82_400bps_hac_g615|r1041_e82_400bps_fast_g615|r1041_e82_400bps_fast_g632|r1041_e82_260bps_fast_g632|r1041_e82_400bps_hac_g632|r1041_e82_400bps_sup_g615|r1041_e82_260bps_hac_g632|r1041_e82_260bps_sup_g632|r1041_e82_400bps_hac_v4.0.0|r1041_e82_400bps_sup_v4.0.0|r1041_e82_260bps_hac_v4.0.0|r1041_e82_260bps_sup_v4.0.0|r1041_e82_260bps_hac_v4.1.0|r1041_e82_260bps_sup_v4.1.0|r1041_e82_400bps_hac_v4.1.0|r1041_e82_400bps_sup_v4.1.0|r941_min_high_g340_rle|r941_min_hac_g507|r941_min_sup_g507|r941_prom_hac_g507|r941_prom_sup_g507|r941_e81_fast_g514|r941_e81_hac_g514|r941_e81_sup_g514] Medaka Model. [default: r1041_e82_400bps_sup_v5.0.0] --flyeModel [--nano-hq|--nano-corr|--nano-raw|--pacbio-raw|--pacbio-corr|--pacbio-hifi] Flye Assembly Parameter [default: --nano- hq] --contaminants PATH Contaminants FASTA file to map long readsagainst to filter out. Choose --contaminants lambda to filter out phage lambda long reads. --dnaapler_custom_db PATH Custom amino acid FASTA file of sequences to be used as a database with dnaapler custom. --no_medaka Do not polish the long read assembly with Medaka. --auto Automatically estimate the chromosome size using KMC. --depth_filter FLOAT Depth filter to pass to Plassembler. Filters out all putative plasmid contigs below this fraction of the chromosome read depth (needs to be below in both long and short read sets for hybrid). --mac If you are running Hybracter on Mac - installs v1.8.0 of Medaka as higher versions break. ``` -------------------------------- ### Example conda environment error log Source: https://hybracter.readthedocs.io/en/latest/install Example error log from hybracter.log showing a failed rule (plassembler_long) with paths to input, output, log, and conda-env. Use this to locate the conda environment that failed to install. ```text Error in rule plassembler_long: jobid: 56 input: hybracter_out/processing/qc/Sample1_filt_trim.fastq.gz output: hybracter_out/processing/plassembler/Sample1/plassembler_plasmids.fasta, hybracter_out/processing/plassembler/Sample1/plassembler_summary.tsv, hybracter_out/versions/Sample1/plassembler.version log: hybracter_out/stderr/plassembler_long/Sample1.log (check log file(s) for error details) conda-env: ``` -------------------------------- ### Create profile directory Source: https://hybracter.readthedocs.io/en/latest/profiles Create a directory for the new Slurm profile. ```bash mkdir -p ~/.config/snakemake/slurm ``` -------------------------------- ### Index PacBio BAM file with pbindex Source: https://hybracter.readthedocs.io/en/latest/input Creates a .pbi index file for the PacBio BAM file, required before extracting fastq. ```bash pbindex yourpacbiofile.bam ``` -------------------------------- ### Output fastq filename Source: https://hybracter.readthedocs.io/en/latest/input The command produces a gzipped fastq file named 'yourfastqfilename.fastq.gz'. ```text yourfastqfilename.fastq.gz ``` -------------------------------- ### hybracter hybrid-single CLI options and defaults Source: https://hybracter.readthedocs.io/en/latest/run Command-line help output for hybracter hybrid-single, showing all options and defaults. Note the --min_depth behavior: hybracter errors and exits if a sample has less than min_depth*chromosome_size bases of long-reads left after filtlong and porechop-ABI steps. ```bash Usage: hybracter hybrid-single [OPTIONS] [SNAKE_ARGS]... Run hybracter hybrid on 1 isolate Options: -l, --longreads TEXT FASTQ file of longreads [required] -1, --short_one TEXT R1 FASTQ file of paired end short reads [required] -2, --short_two TEXT R2 FASTQ file of paired end short reads [required] -s, --sample TEXT Sample name. [default: sample] -c, --chromosome INTEGER Approximate lower-bound chromosome length (in base pairs). [default: 1000000] --no_pypolca Do not use pypolca to polish assemblies with short reads --logic [best|last] Hybracter logic to select best assembly. Use --best to pick best assembly based on ALE (hybrid) or pyrodigal mean length (long). Use --last to pick the last polishing round regardless. [default: last] -o, --output PATH Output directory [default: hybracter_out] --configfile TEXT Custom config file [default: config.yaml] -t, --threads INTEGER Number of threads to use [default: 1] --min_length INTEGER min read length for long reads [default: 1000] --min_quality INTEGER min read quality score for long reads in bp. [default: 9] --skip_qc Do not run porechop_abi, filtlong and fastp to QC the reads -d, --databases PATH Plassembler Databases directory. --subsample_depth INTEGER subsampled long read depth to subsample with Filtlong. By default is 100x. [default: 100] --min_depth INTEGER minimum long read depth to continue the run. By default is 0x. Hybracter will error and exit if a sample has less than min_depth*chromosome_size bases of long- reads left AFTER filtlong and porechop-ABI steps are run. [default: 0] --medakaModel [r1041_e82_400bps_sup_v5.0.0|r1041_e82_400bps_hac_v5.0.0|r1041_e82_400bps_hac_v4.3.0|r1041_e82_400bps_sup_v4.3.0|r1041_e82_400bps_hac_v4.2.0|r1041_e82_400bps_sup_v4.2.0|r941_sup_plant_g610|r941_min_fast_g507|r941_prom_fast_g507|r941_min_fast_g303|r941_min_high_g303|r941_min_high_g330|r941_prom_fast_g303|r941_prom_high_g303|r941_prom_high_g330|r941_min_high_g344|r941_min_high_g351|r941_min_high_g360|r941_prom_high_g344|r941_prom_high_g360|r941_prom_high_g4011|r10_min_high_g303|r10_min_high_g340|r103_min_high_g345|r103_min_high_g360|r103_prom_high_g360|r103_fast_g507|r103_hac_g507|r103_sup_g507|r104_e81_fast_g5015|r104_e81_sup_g5015|r104_e81_hac_g5015|r104_e81_sup_g610|r1041_e82_400bps_hac_g615|r1041_e82_400bps_fast_g615|r1041_e82_400bps_fast_g632|r1041_e82_260bps_fast_g632|r1041_e82_400bps_hac_g632|r1041_e82_400bps_sup_g615|r1041_e82_260bps_hac_g632|r1041_e82_260bps_sup_g632|r1041_e82_400bps_hac_v4.0.0|r1041_e82_400bps_sup_v4.0.0|r1041_e82_260bps_hac_v4.0.0|r1041_e82_260bps_sup_v4.0.0|r1041_e82_260bps_hac_v4.1.0|r1041_e82_260bps_sup_v4.1.0|r1041_e82_400bps_hac_v4.1.0|r1041_e82_400bps_sup_v4.1.0|r941_min_high_g340_rle|r941_min_hac_g507|r941_min_sup_g507|r941_prom_hac_g507|r941_prom_sup_g507|r941_e81_fast_g514|r941_e81_hac_g514|r941_e81_sup_g514] Medaka Model. [default: r1041_e82_400bps_sup_v5.0.0] --flyeModel [--nano-hq|--nano-corr|--nano-raw|--pacbio-raw|--pacbio-corr|--pacbio-hifi] Flye Assembly Parameter [default: --nano- hq] --contaminants PATH Contaminants FASTA file to map long readsagainst to filter out. Choose --contaminants lambda to filter out phage lambda long reads. ``` -------------------------------- ### Use Slurm profile with hybracter Source: https://hybracter.readthedocs.io/en/latest/profiles Use the installed Slurm profile with hybracter. ```bash hybracter test-hybrid --profile slurm ``` -------------------------------- ### Add conda channels after miniforge installation Source: https://hybracter.readthedocs.io/en/latest/install Add the defaults, bioconda, and conda-forge channels to your conda configuration. ```bash conda config --add channels defaults conda config --add channels bioconda conda config --add channels conda-forge ```