Created
July 10, 2023 04:22
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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