#!/usr/bin/env bash
# Bulk download script for GSE145480
# Generated from Yeo Lab Publications Database
# Total files: 102

OUTDIR="GSE145480"
mkdir -p "$OUTDIR"
cd "$OUTDIR"

# --- GEO supplementary files ---
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE145nnn/GSE145480/suppl/GSE145480_counts_mouse_aging_timecourse.txt.gz" -O "GSE145480_counts_mouse_aging_timecourse.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE145nnn/GSE145480/suppl/GSE145480_tpms_mouse_aging_timecourse.txt.gz" -O "GSE145480_tpms_mouse_aging_timecourse.txt.gz"

# --- SRA run files ---
# Tip: use 'fasterq-dump' from SRA Toolkit for FASTQ conversion
#      with optional renaming to original submitted FASTQ names.
# Set to 1 to rename SRR outputs (e.g. SRR_1.fastq.gz -> sample_R1.fastq.gz)
RENAME_SRA_TO_ORIGINAL=1

_compress_if_exists() {
  local stem="$1"
  if [ -f "${stem}.fastq" ]; then
    gzip -f "${stem}.fastq"
    echo "${stem}.fastq.gz"
    return 0
  fi
  if [ -f "${stem}.fq" ]; then
    gzip -f "${stem}.fq"
    echo "${stem}.fq.gz"
    return 0
  fi
  return 1
}

# Option A: Download via SRA Toolkit (recommended)
fasterq-dump --split-files "SRR11102034"
gz1="$(_compress_if_exists 'SRR11102034_1' || true)"
gz2="$(_compress_if_exists 'SRR11102034_2' || true)"
gzs="$(_compress_if_exists 'SRR11102034' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98058_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98058_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102035"
gz1="$(_compress_if_exists 'SRR11102035_1' || true)"
gz2="$(_compress_if_exists 'SRR11102035_2' || true)"
gzs="$(_compress_if_exists 'SRR11102035' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98059_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98059_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102036"
gz1="$(_compress_if_exists 'SRR11102036_1' || true)"
gz2="$(_compress_if_exists 'SRR11102036_2' || true)"
gzs="$(_compress_if_exists 'SRR11102036' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98060_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98060_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102037"
gz1="$(_compress_if_exists 'SRR11102037_1' || true)"
gz2="$(_compress_if_exists 'SRR11102037_2' || true)"
gzs="$(_compress_if_exists 'SRR11102037' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98061_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98061_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102038"
gz1="$(_compress_if_exists 'SRR11102038_1' || true)"
gz2="$(_compress_if_exists 'SRR11102038_2' || true)"
gzs="$(_compress_if_exists 'SRR11102038' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98062_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98062_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102039"
gz1="$(_compress_if_exists 'SRR11102039_1' || true)"
gz2="$(_compress_if_exists 'SRR11102039_2' || true)"
gzs="$(_compress_if_exists 'SRR11102039' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98063_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98063_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102040"
gz1="$(_compress_if_exists 'SRR11102040_1' || true)"
gz2="$(_compress_if_exists 'SRR11102040_2' || true)"
gzs="$(_compress_if_exists 'SRR11102040' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98064_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98064_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102041"
gz1="$(_compress_if_exists 'SRR11102041_1' || true)"
gz2="$(_compress_if_exists 'SRR11102041_2' || true)"
gzs="$(_compress_if_exists 'SRR11102041' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98065_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98065_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102042"
gz1="$(_compress_if_exists 'SRR11102042_1' || true)"
gz2="$(_compress_if_exists 'SRR11102042_2' || true)"
gzs="$(_compress_if_exists 'SRR11102042' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98066_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98066_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102043"
gz1="$(_compress_if_exists 'SRR11102043_1' || true)"
gz2="$(_compress_if_exists 'SRR11102043_2' || true)"
gzs="$(_compress_if_exists 'SRR11102043' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98067_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98067_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102044"
gz1="$(_compress_if_exists 'SRR11102044_1' || true)"
gz2="$(_compress_if_exists 'SRR11102044_2' || true)"
gzs="$(_compress_if_exists 'SRR11102044' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98068_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98068_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102045"
gz1="$(_compress_if_exists 'SRR11102045_1' || true)"
gz2="$(_compress_if_exists 'SRR11102045_2' || true)"
gzs="$(_compress_if_exists 'SRR11102045' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98069_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98069_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102046"
gz1="$(_compress_if_exists 'SRR11102046_1' || true)"
gz2="$(_compress_if_exists 'SRR11102046_2' || true)"
gzs="$(_compress_if_exists 'SRR11102046' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98070_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98070_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102047"
gz1="$(_compress_if_exists 'SRR11102047_1' || true)"
gz2="$(_compress_if_exists 'SRR11102047_2' || true)"
gzs="$(_compress_if_exists 'SRR11102047' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98071_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98071_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102048"
gz1="$(_compress_if_exists 'SRR11102048_1' || true)"
gz2="$(_compress_if_exists 'SRR11102048_2' || true)"
gzs="$(_compress_if_exists 'SRR11102048' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98072_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98072_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102049"
gz1="$(_compress_if_exists 'SRR11102049_1' || true)"
gz2="$(_compress_if_exists 'SRR11102049_2' || true)"
gzs="$(_compress_if_exists 'SRR11102049' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98073_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98073_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102050"
gz1="$(_compress_if_exists 'SRR11102050_1' || true)"
gz2="$(_compress_if_exists 'SRR11102050_2' || true)"
gzs="$(_compress_if_exists 'SRR11102050' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98074_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98074_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102051"
gz1="$(_compress_if_exists 'SRR11102051_1' || true)"
gz2="$(_compress_if_exists 'SRR11102051_2' || true)"
gzs="$(_compress_if_exists 'SRR11102051' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98075_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98075_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102052"
gz1="$(_compress_if_exists 'SRR11102052_1' || true)"
gz2="$(_compress_if_exists 'SRR11102052_2' || true)"
gzs="$(_compress_if_exists 'SRR11102052' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98076_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98076_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102053"
gz1="$(_compress_if_exists 'SRR11102053_1' || true)"
gz2="$(_compress_if_exists 'SRR11102053_2' || true)"
gzs="$(_compress_if_exists 'SRR11102053' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98077_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98077_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102054"
gz1="$(_compress_if_exists 'SRR11102054_1' || true)"
gz2="$(_compress_if_exists 'SRR11102054_2' || true)"
gzs="$(_compress_if_exists 'SRR11102054' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98078_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98078_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102055"
gz1="$(_compress_if_exists 'SRR11102055_1' || true)"
gz2="$(_compress_if_exists 'SRR11102055_2' || true)"
gzs="$(_compress_if_exists 'SRR11102055' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98079_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98079_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102056"
gz1="$(_compress_if_exists 'SRR11102056_1' || true)"
gz2="$(_compress_if_exists 'SRR11102056_2' || true)"
gzs="$(_compress_if_exists 'SRR11102056' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98080_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98080_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102057"
gz1="$(_compress_if_exists 'SRR11102057_1' || true)"
gz2="$(_compress_if_exists 'SRR11102057_2' || true)"
gzs="$(_compress_if_exists 'SRR11102057' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98081_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98081_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102058"
gz1="$(_compress_if_exists 'SRR11102058_1' || true)"
gz2="$(_compress_if_exists 'SRR11102058_2' || true)"
gzs="$(_compress_if_exists 'SRR11102058' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98082_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98082_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102059"
gz1="$(_compress_if_exists 'SRR11102059_1' || true)"
gz2="$(_compress_if_exists 'SRR11102059_2' || true)"
gzs="$(_compress_if_exists 'SRR11102059' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98083_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98083_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102060"
gz1="$(_compress_if_exists 'SRR11102060_1' || true)"
gz2="$(_compress_if_exists 'SRR11102060_2' || true)"
gzs="$(_compress_if_exists 'SRR11102060' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98084_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98084_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102061"
gz1="$(_compress_if_exists 'SRR11102061_1' || true)"
gz2="$(_compress_if_exists 'SRR11102061_2' || true)"
gzs="$(_compress_if_exists 'SRR11102061' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98085_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98085_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102062"
gz1="$(_compress_if_exists 'SRR11102062_1' || true)"
gz2="$(_compress_if_exists 'SRR11102062_2' || true)"
gzs="$(_compress_if_exists 'SRR11102062' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98086_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98086_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102063"
gz1="$(_compress_if_exists 'SRR11102063_1' || true)"
gz2="$(_compress_if_exists 'SRR11102063_2' || true)"
gzs="$(_compress_if_exists 'SRR11102063' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98087_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98087_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102064"
gz1="$(_compress_if_exists 'SRR11102064_1' || true)"
gz2="$(_compress_if_exists 'SRR11102064_2' || true)"
gzs="$(_compress_if_exists 'SRR11102064' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98088_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98088_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102065"
gz1="$(_compress_if_exists 'SRR11102065_1' || true)"
gz2="$(_compress_if_exists 'SRR11102065_2' || true)"
gzs="$(_compress_if_exists 'SRR11102065' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98089_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98089_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102066"
gz1="$(_compress_if_exists 'SRR11102066_1' || true)"
gz2="$(_compress_if_exists 'SRR11102066_2' || true)"
gzs="$(_compress_if_exists 'SRR11102066' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98090_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98090_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102067"
gz1="$(_compress_if_exists 'SRR11102067_1' || true)"
gz2="$(_compress_if_exists 'SRR11102067_2' || true)"
gzs="$(_compress_if_exists 'SRR11102067' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98091_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98091_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102068"
gz1="$(_compress_if_exists 'SRR11102068_1' || true)"
gz2="$(_compress_if_exists 'SRR11102068_2' || true)"
gzs="$(_compress_if_exists 'SRR11102068' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98092_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98092_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102069"
gz1="$(_compress_if_exists 'SRR11102069_1' || true)"
gz2="$(_compress_if_exists 'SRR11102069_2' || true)"
gzs="$(_compress_if_exists 'SRR11102069' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98093_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98093_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102070"
gz1="$(_compress_if_exists 'SRR11102070_1' || true)"
gz2="$(_compress_if_exists 'SRR11102070_2' || true)"
gzs="$(_compress_if_exists 'SRR11102070' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98094_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98094_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102071"
gz1="$(_compress_if_exists 'SRR11102071_1' || true)"
gz2="$(_compress_if_exists 'SRR11102071_2' || true)"
gzs="$(_compress_if_exists 'SRR11102071' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98095_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98095_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102072"
gz1="$(_compress_if_exists 'SRR11102072_1' || true)"
gz2="$(_compress_if_exists 'SRR11102072_2' || true)"
gzs="$(_compress_if_exists 'SRR11102072' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98096_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98096_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102073"
gz1="$(_compress_if_exists 'SRR11102073_1' || true)"
gz2="$(_compress_if_exists 'SRR11102073_2' || true)"
gzs="$(_compress_if_exists 'SRR11102073' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98097_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98097_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102074"
gz1="$(_compress_if_exists 'SRR11102074_1' || true)"
gz2="$(_compress_if_exists 'SRR11102074_2' || true)"
gzs="$(_compress_if_exists 'SRR11102074' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98098_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98098_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102075"
gz1="$(_compress_if_exists 'SRR11102075_1' || true)"
gz2="$(_compress_if_exists 'SRR11102075_2' || true)"
gzs="$(_compress_if_exists 'SRR11102075' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98099_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98099_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102076"
gz1="$(_compress_if_exists 'SRR11102076_1' || true)"
gz2="$(_compress_if_exists 'SRR11102076_2' || true)"
gzs="$(_compress_if_exists 'SRR11102076' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98100_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98100_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102077"
gz1="$(_compress_if_exists 'SRR11102077_1' || true)"
gz2="$(_compress_if_exists 'SRR11102077_2' || true)"
gzs="$(_compress_if_exists 'SRR11102077' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98101_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98101_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102078"
gz1="$(_compress_if_exists 'SRR11102078_1' || true)"
gz2="$(_compress_if_exists 'SRR11102078_2' || true)"
gzs="$(_compress_if_exists 'SRR11102078' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98102_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98102_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102079"
gz1="$(_compress_if_exists 'SRR11102079_1' || true)"
gz2="$(_compress_if_exists 'SRR11102079_2' || true)"
gzs="$(_compress_if_exists 'SRR11102079' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98103_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98103_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102080"
gz1="$(_compress_if_exists 'SRR11102080_1' || true)"
gz2="$(_compress_if_exists 'SRR11102080_2' || true)"
gzs="$(_compress_if_exists 'SRR11102080' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98104_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98104_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102081"
gz1="$(_compress_if_exists 'SRR11102081_1' || true)"
gz2="$(_compress_if_exists 'SRR11102081_2' || true)"
gzs="$(_compress_if_exists 'SRR11102081' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98105_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98105_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102082"
gz1="$(_compress_if_exists 'SRR11102082_1' || true)"
gz2="$(_compress_if_exists 'SRR11102082_2' || true)"
gzs="$(_compress_if_exists 'SRR11102082' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98106_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98106_R2.fastq.gz"
fi

fasterq-dump --split-files "SRR11102083"
gz1="$(_compress_if_exists 'SRR11102083_1' || true)"
gz2="$(_compress_if_exists 'SRR11102083_2' || true)"
gzs="$(_compress_if_exists 'SRR11102083' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "Sample_98107_R1.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "Sample_98107_R2.fastq.gz"
fi


# Option B: Direct download (larger .sra files)
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102034/SRR11102034"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102035/SRR11102035"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102036/SRR11102036"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102037/SRR11102037"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102038/SRR11102038"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102039/SRR11102039"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102040/SRR11102040"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102041/SRR11102041"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102042/SRR11102042"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102043/SRR11102043"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102044/SRR11102044"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102045/SRR11102045"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102046/SRR11102046"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102047/SRR11102047"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102048/SRR11102048"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102049/SRR11102049"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102050/SRR11102050"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102051/SRR11102051"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102052/SRR11102052"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102053/SRR11102053"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102054/SRR11102054"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102055/SRR11102055"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102056/SRR11102056"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102057/SRR11102057"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102058/SRR11102058"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102059/SRR11102059"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102060/SRR11102060"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102061/SRR11102061"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102062/SRR11102062"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102063/SRR11102063"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102064/SRR11102064"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102065/SRR11102065"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102066/SRR11102066"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102067/SRR11102067"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102068/SRR11102068"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102069/SRR11102069"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102070/SRR11102070"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102071/SRR11102071"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102072/SRR11102072"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102073/SRR11102073"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102074/SRR11102074"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102075/SRR11102075"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102076/SRR11102076"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102077/SRR11102077"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102078/SRR11102078"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102079/SRR11102079"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102080/SRR11102080"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102081/SRR11102081"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102082/SRR11102082"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102083/SRR11102083"

# --- Additional data files ---
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102034/SRR11102034"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102035/SRR11102035"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102036/SRR11102036"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102037/SRR11102037"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102038/SRR11102038"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102039/SRR11102039"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102040/SRR11102040"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102041/SRR11102041"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102042/SRR11102042"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102043/SRR11102043"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102044/SRR11102044"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102045/SRR11102045"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102046/SRR11102046"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102047/SRR11102047"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102048/SRR11102048"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102049/SRR11102049"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102050/SRR11102050"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102051/SRR11102051"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102052/SRR11102052"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102053/SRR11102053"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102054/SRR11102054"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102055/SRR11102055"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102056/SRR11102056"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102057/SRR11102057"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102058/SRR11102058"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102059/SRR11102059"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102060/SRR11102060"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102061/SRR11102061"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102062/SRR11102062"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102063/SRR11102063"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102064/SRR11102064"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102065/SRR11102065"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102066/SRR11102066"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102067/SRR11102067"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102068/SRR11102068"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102069/SRR11102069"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102070/SRR11102070"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102071/SRR11102071"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102072/SRR11102072"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102073/SRR11102073"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102074/SRR11102074"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102075/SRR11102075"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102076/SRR11102076"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102077/SRR11102077"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102078/SRR11102078"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102079/SRR11102079"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102080/SRR11102080"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102081/SRR11102081"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102082/SRR11102082"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR11102083/SRR11102083"

echo "Download complete. Files saved to $OUTDIR"