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

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

# --- GEO supplementary files ---
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_373_R1.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_373_R1.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_373_R2.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_373_R2.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_373_R3.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_373_R3.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_374_01.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_374_01.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_374_02.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_374_02.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_374_03.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_374_03.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_DMSO_R1.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_DMSO_R1.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_DMSO_R2.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_DMSO_R2.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_DMSO_R3.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_DMSO_R3.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_RSKBG1_R1.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_RSKBG1_R1.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_RSKBG1_R2.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_RSKBG1_R2.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_RSKBG1_R3.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_RSKBG1_R3.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_SSKBG1_R1.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_SSKBG1_R1.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_SSKBG1_R2.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_SSKBG1_R2.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_KO_SSKBG1_R3.markdup.sorted.bam.txt.gz" -O "GSE299099_KO_SSKBG1_R3.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_373_R1.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_373_R1.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_373_R2.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_373_R2.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_373_R3.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_373_R3.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_374_01.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_374_01.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_374_02.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_374_02.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_374_03.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_374_03.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_DMSO_R1.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_DMSO_R1.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_DMSO_R2.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_DMSO_R2.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_DMSO_R3.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_DMSO_R3.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_RSKBG1_R1.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_RSKBG1_R1.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_RSKBG1_R2.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_RSKBG1_R2.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_RSKBG1_R3.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_RSKBG1_R3.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_SSKBG1_R1.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_SSKBG1_R1.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_SSKBG1_R2.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_SSKBG1_R2.markdup.sorted.bam.txt.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE299nnn/GSE299099/suppl/GSE299099_WT_SSKBG1_R3.markdup.sorted.bam.txt.gz" -O "GSE299099_WT_SSKBG1_R3.markdup.sorted.bam.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 "SRR33873308"
gz1="$(_compress_if_exists 'SRR33873308_1' || true)"
gz2="$(_compress_if_exists 'SRR33873308_2' || true)"
gzs="$(_compress_if_exists 'SRR33873308' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgN-S_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgN-S_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873309"
gz1="$(_compress_if_exists 'SRR33873309_1' || true)"
gz2="$(_compress_if_exists 'SRR33873309_2' || true)"
gzs="$(_compress_if_exists 'SRR33873309' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgN-S_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgN-S_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873310"
gz1="$(_compress_if_exists 'SRR33873310_1' || true)"
gz2="$(_compress_if_exists 'SRR33873310_2' || true)"
gzs="$(_compress_if_exists 'SRR33873310' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgN-S_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgN-S_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873311"
gz1="$(_compress_if_exists 'SRR33873311_1' || true)"
gz2="$(_compress_if_exists 'SRR33873311_2' || true)"
gzs="$(_compress_if_exists 'SRR33873311' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgN-R_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgN-R_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873312"
gz1="$(_compress_if_exists 'SRR33873312_1' || true)"
gz2="$(_compress_if_exists 'SRR33873312_2' || true)"
gzs="$(_compress_if_exists 'SRR33873312' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgN-R_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgN-R_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873313"
gz1="$(_compress_if_exists 'SRR33873313_1' || true)"
gz2="$(_compress_if_exists 'SRR33873313_2' || true)"
gzs="$(_compress_if_exists 'SRR33873313' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgN-R_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgN-R_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873314"
gz1="$(_compress_if_exists 'SRR33873314_1' || true)"
gz2="$(_compress_if_exists 'SRR33873314_2' || true)"
gzs="$(_compress_if_exists 'SRR33873314' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgN-DMSO_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgN-DMSO_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873315"
gz1="$(_compress_if_exists 'SRR33873315_1' || true)"
gz2="$(_compress_if_exists 'SRR33873315_2' || true)"
gzs="$(_compress_if_exists 'SRR33873315' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgN-DMSO_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgN-DMSO_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873316"
gz1="$(_compress_if_exists 'SRR33873316_1' || true)"
gz2="$(_compress_if_exists 'SRR33873316_2' || true)"
gzs="$(_compress_if_exists 'SRR33873316' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgN-DMSO_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgN-DMSO_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873317"
gz1="$(_compress_if_exists 'SRR33873317_1' || true)"
gz2="$(_compress_if_exists 'SRR33873317_2' || true)"
gzs="$(_compress_if_exists 'SRR33873317' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgN-374_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgN-374_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873318"
gz1="$(_compress_if_exists 'SRR33873318_1' || true)"
gz2="$(_compress_if_exists 'SRR33873318_2' || true)"
gzs="$(_compress_if_exists 'SRR33873318' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgN-374_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgN-374_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873319"
gz1="$(_compress_if_exists 'SRR33873319_1' || true)"
gz2="$(_compress_if_exists 'SRR33873319_2' || true)"
gzs="$(_compress_if_exists 'SRR33873319' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgN-374_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgN-374_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873320"
gz1="$(_compress_if_exists 'SRR33873320_1' || true)"
gz2="$(_compress_if_exists 'SRR33873320_2' || true)"
gzs="$(_compress_if_exists 'SRR33873320' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgN-373_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgN-373_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873321"
gz1="$(_compress_if_exists 'SRR33873321_1' || true)"
gz2="$(_compress_if_exists 'SRR33873321_2' || true)"
gzs="$(_compress_if_exists 'SRR33873321' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgN-373_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgN-373_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873322"
gz1="$(_compress_if_exists 'SRR33873322_1' || true)"
gz2="$(_compress_if_exists 'SRR33873322_2' || true)"
gzs="$(_compress_if_exists 'SRR33873322' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgN-373_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgN-373_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873323"
gz1="$(_compress_if_exists 'SRR33873323_1' || true)"
gz2="$(_compress_if_exists 'SRR33873323_2' || true)"
gzs="$(_compress_if_exists 'SRR33873323' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgC-S_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgC-S_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873324"
gz1="$(_compress_if_exists 'SRR33873324_1' || true)"
gz2="$(_compress_if_exists 'SRR33873324_2' || true)"
gzs="$(_compress_if_exists 'SRR33873324' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgC-S_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgC-S_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873325"
gz1="$(_compress_if_exists 'SRR33873325_1' || true)"
gz2="$(_compress_if_exists 'SRR33873325_2' || true)"
gzs="$(_compress_if_exists 'SRR33873325' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgC-S_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgC-S_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873326"
gz1="$(_compress_if_exists 'SRR33873326_1' || true)"
gz2="$(_compress_if_exists 'SRR33873326_2' || true)"
gzs="$(_compress_if_exists 'SRR33873326' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgC-R_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgC-R_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873327"
gz1="$(_compress_if_exists 'SRR33873327_1' || true)"
gz2="$(_compress_if_exists 'SRR33873327_2' || true)"
gzs="$(_compress_if_exists 'SRR33873327' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgC-R_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgC-R_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873328"
gz1="$(_compress_if_exists 'SRR33873328_1' || true)"
gz2="$(_compress_if_exists 'SRR33873328_2' || true)"
gzs="$(_compress_if_exists 'SRR33873328' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgC-R_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgC-R_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873329"
gz1="$(_compress_if_exists 'SRR33873329_1' || true)"
gz2="$(_compress_if_exists 'SRR33873329_2' || true)"
gzs="$(_compress_if_exists 'SRR33873329' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgC-DMSO_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgC-DMSO_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873330"
gz1="$(_compress_if_exists 'SRR33873330_1' || true)"
gz2="$(_compress_if_exists 'SRR33873330_2' || true)"
gzs="$(_compress_if_exists 'SRR33873330' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgC-DMSO_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgC-DMSO_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873331"
gz1="$(_compress_if_exists 'SRR33873331_1' || true)"
gz2="$(_compress_if_exists 'SRR33873331_2' || true)"
gzs="$(_compress_if_exists 'SRR33873331' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgC-DMSO_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgC-DMSO_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873332"
gz1="$(_compress_if_exists 'SRR33873332_1' || true)"
gz2="$(_compress_if_exists 'SRR33873332_2' || true)"
gzs="$(_compress_if_exists 'SRR33873332' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgC-374_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgC-374_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873333"
gz1="$(_compress_if_exists 'SRR33873333_1' || true)"
gz2="$(_compress_if_exists 'SRR33873333_2' || true)"
gzs="$(_compress_if_exists 'SRR33873333' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgC-374_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgC-374_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873334"
gz1="$(_compress_if_exists 'SRR33873334_1' || true)"
gz2="$(_compress_if_exists 'SRR33873334_2' || true)"
gzs="$(_compress_if_exists 'SRR33873334' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgC-374_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgC-374_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873335"
gz1="$(_compress_if_exists 'SRR33873335_1' || true)"
gz2="$(_compress_if_exists 'SRR33873335_2' || true)"
gzs="$(_compress_if_exists 'SRR33873335' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "3-sgC-373_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "3-sgC-373_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873336"
gz1="$(_compress_if_exists 'SRR33873336_1' || true)"
gz2="$(_compress_if_exists 'SRR33873336_2' || true)"
gzs="$(_compress_if_exists 'SRR33873336' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "2-sgC-373_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "2-sgC-373_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR33873337"
gz1="$(_compress_if_exists 'SRR33873337_1' || true)"
gz2="$(_compress_if_exists 'SRR33873337_2' || true)"
gzs="$(_compress_if_exists 'SRR33873337' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "1-sgC-373_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "1-sgC-373_R2_001.fastq.gz"
fi


# Option B: Direct download (larger .sra files)
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873308/SRR33873308.lite.1"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873309/SRR33873309"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873310/SRR33873310"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873311/SRR33873311"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873312/SRR33873312"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873313/SRR33873313"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873314/SRR33873314.lite.1"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873315/SRR33873315"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873316/SRR33873316.lite.1"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873317/SRR33873317.lite.1"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873318/SRR33873318"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873319/SRR33873319"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873320/SRR33873320"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873321/SRR33873321"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873322/SRR33873322"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873323/SRR33873323"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873324/SRR33873324"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873325/SRR33873325"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873326/SRR33873326"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873327/SRR33873327"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873328/SRR33873328"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873329/SRR33873329"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873330/SRR33873330.lite.1"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873331/SRR33873331"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873332/SRR33873332"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873333/SRR33873333.lite.1"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873334/SRR33873334"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873335/SRR33873335"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873336/SRR33873336"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873337/SRR33873337"

# --- Additional data files ---
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873337/SRR33873337"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873334/SRR33873334"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873331/SRR33873331"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873328/SRR33873328"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873325/SRR33873325"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873322/SRR33873322"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873319/SRR33873319"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873313/SRR33873313"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873310/SRR33873310"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873336/SRR33873336"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873327/SRR33873327"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873324/SRR33873324"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873321/SRR33873321"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873318/SRR33873318"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873315/SRR33873315"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873312/SRR33873312"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873309/SRR33873309"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873335/SRR33873335"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873332/SRR33873332"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873329/SRR33873329"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873326/SRR33873326"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873323/SRR33873323"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873320/SRR33873320"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR33873311/SRR33873311"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873308/SRR33873308.lite.1"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873314/SRR33873314.lite.1"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873316/SRR33873316.lite.1"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873317/SRR33873317.lite.1"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873330/SRR33873330.lite.1"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos8/sra-pub-zq-820/SRR033/33873/SRR33873333/SRR33873333.lite.1"

echo "Download complete. Files saved to $OUTDIR"