mapfile -t listarr<hglist.txt
for line in ${listarr[@]}
do
  sarr=(${line//,/ })
  ERRID=(${sarr[0]})

  wget -O ${ERRID}_chrM.bam "https://trace.ncbi.nlm.nih.gov/Traces/sra-cl-be/sra_web?cmd=file&run=${ERRID}&ref=chrM&seqid=J01415.2&output=bam&local=undefined"
  wget -O ${ERRID}_chrY.bam "https://trace.ncbi.nlm.nih.gov/Traces/sra-cl-be/sra_web?cmd=file&run=${ERRID}&ref=chrY&seqid=CM000686.1&output=bam&local=undefined"

  # wget -O download/${ERRID}_Y.bam "https://trace.ncbi.nlm.nih.gov/Traces/sra-cl-be/sra_web?cmd=file&run=${ERRID}&ref=Y&seqid=CM000664.1&output=bam&local=undefined"
  # wget -O download/${ERRID}_MT.bam "https://trace.ncbi.nlm.nih.gov/Traces/sra-cl-be/sra_web?cmd=file&run=${ERRID}&ref=MT&seqid=J01415.2&output=bam&local=undefined"
done
