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

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

# --- GEO supplementary files ---
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE86nnn/GSE86035/suppl/GSE86035_RAW.tar" -O "GSE86035_RAW.tar"

# --- 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 "SRR4063765"
gz1="$(_compress_if_exists 'SRR4063765_1' || true)"
gz2="$(_compress_if_exists 'SRR4063765_2' || true)"
gzs="$(_compress_if_exists 'SRR4063765' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB2_293_CLIP_AIFM_1_IP_TCCGGAGA-TATAGCCT_L008_R1.A01_KB2_AIFM_1_AIFM1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB2_293_CLIP_AIFM_1_IP_TCCGGAGA-TATAGCCT_L008_R2.A01_KB2_AIFM_1_AIFM1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063766"
gz1="$(_compress_if_exists 'SRR4063766_1' || true)"
gz2="$(_compress_if_exists 'SRR4063766_2' || true)"
gzs="$(_compress_if_exists 'SRR4063766' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB2_293_CLIP_AIFM_1_IP_TCCGGAGA-TATAGCCT_L008_R1.B06_KB2_AIFM_1_AIFM1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB2_293_CLIP_AIFM_1_IP_TCCGGAGA-TATAGCCT_L008_R2.B06_KB2_AIFM_1_AIFM1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063767"
gz1="$(_compress_if_exists 'SRR4063767_1' || true)"
gz2="$(_compress_if_exists 'SRR4063767_2' || true)"
gzs="$(_compress_if_exists 'SRR4063767' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB3_293_CLIP_AIFM_2_IP_TCCGGAGA-ATAGAGGC_L008_R1.C01_KB3_AIFM_2_AIFM1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB3_293_CLIP_AIFM_2_IP_TCCGGAGA-ATAGAGGC_L008_R2.C01_KB3_AIFM_2_AIFM1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063768"
gz1="$(_compress_if_exists 'SRR4063768_1' || true)"
gz2="$(_compress_if_exists 'SRR4063768_2' || true)"
gzs="$(_compress_if_exists 'SRR4063768' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB3_293_CLIP_AIFM_2_IP_TCCGGAGA-ATAGAGGC_L008_R1.D08fixed_KB3_AIFM_2_AIFM1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB3_293_CLIP_AIFM_2_IP_TCCGGAGA-ATAGAGGC_L008_R2.D08fixed_KB3_AIFM_2_AIFM1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063769"
gz1="$(_compress_if_exists 'SRR4063769_1' || true)"
gz2="$(_compress_if_exists 'SRR4063769_2' || true)"
gzs="$(_compress_if_exists 'SRR4063769' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB5_293_CLIP_RNF219_1_input_ATTACTCG-AGGCGAAG_L008_R1.unassigned.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB5_293_CLIP_RNF219_1_input_ATTACTCG-AGGCGAAG_L008_R2.unassigned.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063770"
gz1="$(_compress_if_exists 'SRR4063770_1' || true)"
gz2="$(_compress_if_exists 'SRR4063770_2' || true)"
gzs="$(_compress_if_exists 'SRR4063770' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB6_293_CLIP_RANGAP_3_IP_CGCTCATT-TATAGCCT_L008_R1.C01_KB6_RANGAP_3_RANGAP1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB6_293_CLIP_RANGAP_3_IP_CGCTCATT-TATAGCCT_L008_R2.C01_KB6_RANGAP_3_RANGAP1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063771"
gz1="$(_compress_if_exists 'SRR4063771_1' || true)"
gz2="$(_compress_if_exists 'SRR4063771_2' || true)"
gzs="$(_compress_if_exists 'SRR4063771' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB6_293_CLIP_RANGAP_3_IP_CGCTCATT-TATAGCCT_L008_R1.D08fixed_KB6_RANGAP_3_RANGAP1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB6_293_CLIP_RANGAP_3_IP_CGCTCATT-TATAGCCT_L008_R2.D08fixed_KB6_RANGAP_3_RANGAP1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063772"
gz1="$(_compress_if_exists 'SRR4063772_1' || true)"
gz2="$(_compress_if_exists 'SRR4063772_2' || true)"
gzs="$(_compress_if_exists 'SRR4063772' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB7_293_CLIP_RANGAP_4_IP_CGCTCATT-TAATCTTA_L008_R1.C01_KB7_RANGAP_4_RANGAP1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB7_293_CLIP_RANGAP_4_IP_CGCTCATT-TAATCTTA_L008_R2.C01_KB7_RANGAP_4_RANGAP1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063773"
gz1="$(_compress_if_exists 'SRR4063773_1' || true)"
gz2="$(_compress_if_exists 'SRR4063773_2' || true)"
gzs="$(_compress_if_exists 'SRR4063773' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB7_293_CLIP_RANGAP_4_IP_CGCTCATT-TAATCTTA_L008_R1.D08fixed_KB7_RANGAP_4_RANGAP1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB7_293_CLIP_RANGAP_4_IP_CGCTCATT-TAATCTTA_L008_R2.D08fixed_KB7_RANGAP_4_RANGAP1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063774"
gz1="$(_compress_if_exists 'SRR4063774_1' || true)"
gz2="$(_compress_if_exists 'SRR4063774_2' || true)"
gzs="$(_compress_if_exists 'SRR4063774' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB8_293_CLIP_RANGAP_2_input_ATTCAGAA-CCTATCCT_L008_R1.unassigned.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB8_293_CLIP_RANGAP_2_input_ATTCAGAA-CCTATCCT_L008_R2.unassigned.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063775"
gz1="$(_compress_if_exists 'SRR4063775_1' || true)"
gz2="$(_compress_if_exists 'SRR4063775_2' || true)"
gzs="$(_compress_if_exists 'SRR4063775' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB9_293_CLIP_NUMA_1_IP_GAATTCGT-GGCTCTGA_L008_R1.A01_KB9_NUMA_1_NUMA1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB9_293_CLIP_NUMA_1_IP_GAATTCGT-GGCTCTGA_L008_R2.A01_KB9_NUMA_1_NUMA1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063776"
gz1="$(_compress_if_exists 'SRR4063776_1' || true)"
gz2="$(_compress_if_exists 'SRR4063776_2' || true)"
gzs="$(_compress_if_exists 'SRR4063776' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB9_293_CLIP_NUMA_1_IP_GAATTCGT-GGCTCTGA_L008_R1.B06_KB9_NUMA_1_NUMA1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB9_293_CLIP_NUMA_1_IP_GAATTCGT-GGCTCTGA_L008_R2.B06_KB9_NUMA_1_NUMA1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063777"
gz1="$(_compress_if_exists 'SRR4063777_1' || true)"
gz2="$(_compress_if_exists 'SRR4063777_2' || true)"
gzs="$(_compress_if_exists 'SRR4063777' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB10_293_CLIP_NUMA_2_IP_ATTACTCG-CCTATCCT_L008_R1.A01_KB10_NUMA_2_NUMA1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB10_293_CLIP_NUMA_2_IP_ATTACTCG-CCTATCCT_L008_R2.A01_KB10_NUMA_2_NUMA1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063778"
gz1="$(_compress_if_exists 'SRR4063778_1' || true)"
gz2="$(_compress_if_exists 'SRR4063778_2' || true)"
gzs="$(_compress_if_exists 'SRR4063778' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB10_293_CLIP_NUMA_2_IP_ATTACTCG-CCTATCCT_L008_R1.B06_KB10_NUMA_2_NUMA1.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB10_293_CLIP_NUMA_2_IP_ATTACTCG-CCTATCCT_L008_R2.B06_KB10_NUMA_2_NUMA1.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063779"
gz1="$(_compress_if_exists 'SRR4063779_1' || true)"
gz2="$(_compress_if_exists 'SRR4063779_2' || true)"
gzs="$(_compress_if_exists 'SRR4063779' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB11_293_CLIP_NUMA_1_input_TCCGGAGA-AGGCGAAG_L008_R1.unassigned.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB11_293_CLIP_NUMA_1_input_TCCGGAGA-AGGCGAAG_L008_R2.unassigned.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063780"
gz1="$(_compress_if_exists 'SRR4063780_1' || true)"
gz2="$(_compress_if_exists 'SRR4063780_2' || true)"
gzs="$(_compress_if_exists 'SRR4063780' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB12_293_CLIP_AIFM_1_IP_ATTACTCG-CCTATCCT_L006_R1.unassigned.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB12_293_CLIP_AIFM_1_IP_ATTACTCG-CCTATCCT_L006_R2.unassigned.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063781"
gz1="$(_compress_if_exists 'SRR4063781_1' || true)"
gz2="$(_compress_if_exists 'SRR4063781_2' || true)"
gzs="$(_compress_if_exists 'SRR4063781' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB16_293_CLIP_RNF219_3_GAATTCGT-AGGCGAAG_L007_R1.C01_KB16_RNF219_3_RNF219.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB16_293_CLIP_RNF219_3_GAATTCGT-AGGCGAAG_L007_R2.C01_KB16_RNF219_3_RNF219.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063782"
gz1="$(_compress_if_exists 'SRR4063782_1' || true)"
gz2="$(_compress_if_exists 'SRR4063782_2' || true)"
gzs="$(_compress_if_exists 'SRR4063782' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB16_293_CLIP_RNF219_3_GAATTCGT-AGGCGAAG_L007_R1.D08fixed_KB16_RNF219_3_RNF219.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB16_293_CLIP_RNF219_3_GAATTCGT-AGGCGAAG_L007_R2.D08fixed_KB16_RNF219_3_RNF219.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063783"
gz1="$(_compress_if_exists 'SRR4063783_1' || true)"
gz2="$(_compress_if_exists 'SRR4063783_2' || true)"
gzs="$(_compress_if_exists 'SRR4063783' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB20_293_CLIP_VIM_1_GAATTCGT-ATAGAGGC_L007_R1.C01_KB20_VIM_1_VIM.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB20_293_CLIP_VIM_1_GAATTCGT-ATAGAGGC_L007_R2.C01_KB20_VIM_1_VIM.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063784"
gz1="$(_compress_if_exists 'SRR4063784_1' || true)"
gz2="$(_compress_if_exists 'SRR4063784_2' || true)"
gzs="$(_compress_if_exists 'SRR4063784' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB20_293_CLIP_VIM_1_GAATTCGT-ATAGAGGC_L007_R1.D08fixed_KB20_VIM_1_VIM.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB20_293_CLIP_VIM_1_GAATTCGT-ATAGAGGC_L007_R2.D08fixed_KB20_VIM_1_VIM.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063785"
gz1="$(_compress_if_exists 'SRR4063785_1' || true)"
gz2="$(_compress_if_exists 'SRR4063785_2' || true)"
gzs="$(_compress_if_exists 'SRR4063785' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB21_293_CLIP_VIM_2_CGCTCATT-ATAGAGGC_L007_R1.C01_KB21P_VIM_2_VIM.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB21_293_CLIP_VIM_2_CGCTCATT-ATAGAGGC_L007_R2.C01_KB21P_VIM_2_VIM.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063786"
gz1="$(_compress_if_exists 'SRR4063786_1' || true)"
gz2="$(_compress_if_exists 'SRR4063786_2' || true)"
gzs="$(_compress_if_exists 'SRR4063786' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB21_293_CLIP_VIM_2_CGCTCATT-ATAGAGGC_L007_R1.D08fixed_KB21P_VIM_2_VIM.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB21_293_CLIP_VIM_2_CGCTCATT-ATAGAGGC_L007_R2.D08fixed_KB21P_VIM_2_VIM.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063787"
gz1="$(_compress_if_exists 'SRR4063787_1' || true)"
gz2="$(_compress_if_exists 'SRR4063787_2' || true)"
gzs="$(_compress_if_exists 'SRR4063787' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB22_293_CLIP_VIM_input_CGCTCATT-TAATCTTA_L007_R1.unassigned.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB22_293_CLIP_VIM_input_CGCTCATT-TAATCTTA_L007_R2.unassigned.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063788"
gz1="$(_compress_if_exists 'SRR4063788_1' || true)"
gz2="$(_compress_if_exists 'SRR4063788_2' || true)"
gzs="$(_compress_if_exists 'SRR4063788' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB23_293_INPUT_ZNF184_S70_L008_R1_001.unassigned.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB23_293_INPUT_ZNF184_S70_L008_R2_001.unassigned.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063789"
gz1="$(_compress_if_exists 'SRR4063789_1' || true)"
gz2="$(_compress_if_exists 'SRR4063789_2' || true)"
gzs="$(_compress_if_exists 'SRR4063789' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB24_293_CLIP_ZNF184_S71_L008_R1_001.A01_KB24_ZNF184_1_ZNF184.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB24_293_CLIP_ZNF184_S71_L008_R2_001.A01_KB24_ZNF184_1_ZNF184.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063790"
gz1="$(_compress_if_exists 'SRR4063790_1' || true)"
gz2="$(_compress_if_exists 'SRR4063790_2' || true)"
gzs="$(_compress_if_exists 'SRR4063790' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB24_293_CLIP_ZNF184_S71_L008_R1_001.B06_KB24_ZNF184_1_ZNF184.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB24_293_CLIP_ZNF184_S71_L008_R2_001.B06_KB24_ZNF184_1_ZNF184.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063791"
gz1="$(_compress_if_exists 'SRR4063791_1' || true)"
gz2="$(_compress_if_exists 'SRR4063791_2' || true)"
gzs="$(_compress_if_exists 'SRR4063791' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB25_293_CLIP_ZNF184_S72_L008_R1_001.C01_KB25_ZNF184_2_ZNF184.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB25_293_CLIP_ZNF184_S72_L008_R2_001.C01_KB25_ZNF184_2_ZNF184.randomer.fastq.gz"
fi

fasterq-dump --split-files "SRR4063792"
gz1="$(_compress_if_exists 'SRR4063792_1' || true)"
gz2="$(_compress_if_exists 'SRR4063792_2' || true)"
gzs="$(_compress_if_exists 'SRR4063792' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "KB25_293_CLIP_ZNF184_S72_L008_R1_001.D08fixed_KB25_ZNF184_2_ZNF184.randomer.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "KB25_293_CLIP_ZNF184_S72_L008_R2_001.D08fixed_KB25_ZNF184_2_ZNF184.randomer.fastq.gz"
fi


# Option B: Direct download (larger .sra files)
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063765/SRR4063765"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063766/SRR4063766"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063767/SRR4063767"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063768/SRR4063768"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063769/SRR4063769"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063770/SRR4063770"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063771/SRR4063771"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063772/SRR4063772"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063773/SRR4063773"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063774/SRR4063774"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063775/SRR4063775"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063776/SRR4063776"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063777/SRR4063777"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063778/SRR4063778"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063779/SRR4063779"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063780/SRR4063780"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063781/SRR4063781"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063782/SRR4063782"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063783/SRR4063783"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063784/SRR4063784"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063785/SRR4063785"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063786/SRR4063786"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063787/SRR4063787"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063788/SRR4063788"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063789/SRR4063789"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063790/SRR4063790"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063791/SRR4063791"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063792/SRR4063792"

# --- Additional data files ---
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063777/SRR4063777"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063778/SRR4063778"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063778/SRR4063778"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063779/SRR4063779"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063780/SRR4063780"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063781/SRR4063781"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063782/SRR4063782"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063783/SRR4063783"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063784/SRR4063784"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063785/SRR4063785"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063786/SRR4063786"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063787/SRR4063787"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063765/SRR4063765"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063766/SRR4063766"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063788/SRR4063788"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063789/SRR4063789"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063790/SRR4063790"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063791/SRR4063791"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063792/SRR4063792"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063767/SRR4063767"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063768/SRR4063768"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063769/SRR4063769"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063770/SRR4063770"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063771/SRR4063771"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063772/SRR4063772"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063773/SRR4063773"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063772/SRR4063772"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063774/SRR4063774"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063775/SRR4063775"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063776/SRR4063776"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063774/SRR4063774"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR4063789/SRR4063789"

echo "Download complete. Files saved to $OUTDIR"