Skip to content

Add skip trimming and single-end read support to AutDeNovo pipeline - #14

Closed
capoony with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-d460916a-8bc4-4769-9513-88f394e3a0a1
Closed

Add skip trimming and single-end read support to AutDeNovo pipeline#14
capoony with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-d460916a-8bc4-4769-9513-88f394e3a0a1

Conversation

Copilot AI commented Jul 16, 2025

Copy link
Copy Markdown

This PR implements two major new features for the AutDeNovo pipeline while maintaining full backward compatibility:

New Features

1. Skip Trimming (SkipTrimming=yes)

Allows bypassing the trimming step entirely while maintaining compatibility with downstream processing:

  • Copies raw input files to expected trimmed file names (*_val_1.fq.gz, *_val_2.fq.gz)
  • Downstream steps process raw reads seamlessly as if they were trimmed
  • Useful for high-quality or pre-trimmed reads
./AutDeNovo_exp_skiptrim.sh \
  Name=Sample1 \
  Fwd=reads_R1.fq.gz \
  Rev=reads_R2.fq.gz \
  SkipTrimming=yes \
  [other parameters...]

2. Single-End Read Support (SingleEnd=yes)

Processes forward-only reads without requiring reverse reads:

  • Auto-detects single-end mode when only Fwd= is provided
  • Can be explicitly set with SingleEnd=yes
  • Works with both trimmed and skip-trimmed modes
  • Supports hybrid assemblies (single-end Illumina + ONT/PacBio)
# Auto-detection
./AutDeNovo_exp_skiptrim.sh \
  Name=Sample1 \
  Fwd=reads.fq.gz \
  [other parameters...]

# Explicit mode
./AutDeNovo_exp_skiptrim.sh \
  Name=Sample1 \
  Fwd=reads.fq.gz \
  SingleEnd=yes \
  [other parameters...]

Implementation Details

New Script: AutDeNovo_exp_skiptrim.sh

  • Created as separate script to avoid modifying original AutDeNovo_exp.sh
  • Maintains all original functionality and parameters
  • Adds comprehensive usage documentation and examples

Updated Data Type Detection

The pipeline now recognizes additional data types:

  • ILL_SE - Single-end Illumina only
  • ILL_SE_ONT - Single-end Illumina + ONT
  • ILL_SE_PB - Single-end Illumina + PacBio
  • ILL_SE_ONT_PB - Single-end Illumina + ONT + PacBio

Modified Downstream Scripts

Updated existing pipeline scripts to handle single-end data:

  • genomesize.sh: Modified Jellyfish commands for single-end k-mer counting
  • denovo.sh: Added SPAdes single-end assembly support (-s parameter)
  • mapping.sh: Updated BWA mem commands for single-end alignment
  • kraken.sh: Added single-end decontamination without --paired flag

Enhanced Validation

  • Auto-detects single-end mode when reverse read is not provided
  • Improved error messages for missing parameters
  • Validates trimmer selection and parameter combinations

Testing

Comprehensive test suite validates:

  • ✅ Skip trimming with paired-end reads
  • ✅ Skip trimming with single-end reads
  • ✅ Single-end auto-detection
  • ✅ File copying and renaming logic
  • ✅ Backward compatibility with original functionality
  • ✅ Integration with real test data from repository

Usage Examples

Combined Features

# Single-end reads without trimming
./AutDeNovo_exp_skiptrim.sh \
  Name=Sample1 \
  Fwd=reads.fq.gz \
  SkipTrimming=yes \
  SingleEnd=yes \
  BLASTdb=/path/to/nt \
  [other parameters...]

Hybrid Assembly

# Single-end Illumina + ONT, skip trimming
./AutDeNovo_exp_skiptrim.sh \
  Name=Hybrid \
  Fwd=illumina.fq.gz \
  ONT=/path/to/ont_reads \
  SkipTrimming=yes \
  BLASTdb=/path/to/nt

Documentation

  • Added comprehensive usage instructions in script header
  • Created README_SkipTrimming.md with detailed examples and technical documentation
  • Updated help text with new parameters

Backward Compatibility

✅ All existing parameter combinations work exactly as before
✅ Original AutDeNovo_exp.sh remains unchanged
✅ No breaking changes to existing workflows

Fixes requirements for skip trimming and single-end read support while maintaining the pipeline's robust functionality for genome assembly projects.

This pull request was created as a result of the following prompt from Copilot chat.

Add the following features to AutDeNovo_exp.sh as a new script file (e.g., AutDeNovo_exp_skiptrim.sh):

  1. Add ability to skip the trimming step and instead copy and rename the raw input files into the expected output folder, so downstream steps work as usual. Trigger this with a shell variable: SkipTrimming=yes.
  2. Support single-end reads (forward only, no reverse). Trigger this if only $fwd is set and $rev is empty, or by SingleEnd=yes. If single-end, copy or process only the forward read file.
  3. Ensure downstream steps reference the correct files (${name}_1_val_1.fq.gz for single-end, and both files for paired-end) whether they are trimmed or raw.
  4. Add clear comments and usage instructions for these options at the top of the script.
  5. Do not modify original AutDeNovo_exp.sh, but create a new file with these changes.

Use the latest version of AutDeNovo_exp.sh as the starting point. Make sure all logic that previously required trimmed files works with these copied raw files if trimming is skipped. Downstream processing should be seamless whether trimming is skipped or not.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@capoony
capoony marked this pull request as ready for review July 16, 2025 13:31
@capoony capoony closed this Jul 16, 2025
Copilot AI changed the title [WIP] Add skip trimming and single-end support to AutDeNovo_exp.sh as new script Add skip trimming and single-end read support to AutDeNovo pipeline Jul 16, 2025
Copilot AI requested a review from capoony July 16, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants