Skip to content

Instantly share code, notes, and snippets.

@actapia
Created July 10, 2023 04:22
Show Gist options
  • Select an option

  • Save actapia/78d608d70f100038bb1b3dfb48522700 to your computer and use it in GitHub Desktop.

Select an option

Save actapia/78d608d70f100038bb1b3dfb48522700 to your computer and use it in GitHub Desktop.
Download RNA-seq data from Basespace by providing project name patterns to match
#!/usr/bin/env bash
while [ $# -gt 0 ]; do
echo "$1"
readarray -d, projinfo < <(bs project list --format csv | tail -n +2 | awk -F, -v reg="$1" '($0 ~ reg) {print $0}')
proj_dir="${projinfo[0]::-1}"
mkdir "$proj_dir"
cd "$proj_dir"
bs download project --id "${projinfo[1]::-1}"
mv ./*/*.fastq.gz .
rmdir ./*/
cd ..
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment