Last active
July 25, 2017 13:43
-
-
Save slowkow/69d882bebbea9d8f8eac to your computer and use it in GitHub Desktop.
Get SRR ids corresponding to an SRA id.
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 | |
# sra2srr.sh | |
# | |
# Example | |
# ------- | |
# To download all of the read archive files for SRP012001: | |
# sra2srr.sh SRP012001 | while read srr; do prefetch $srr; done | |
# | |
# For 'esearch', 'efetch', 'xtract', you must install Entrez Direct: | |
# http://www.ncbi.nlm.nih.gov/books/NBK179288/ | |
# | |
# For 'prefetch', you must install SRA Tools: | |
# https://github.com/ncbi/sra-tools | |
SRA=$1 | |
esearch -db sra -query $SRA | \ | |
efetch -format docsum | \ | |
xtract -pattern DocumentSummary -element Run@acc | \ | |
tr '\t' '\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment