Awesome, this looks like the best answer. It's a bit unfortunate you have to load a ~4GB file, but its still completely viable!
I have a lot of SRS values from the SRA values/ids for relevant entries in the SRA, and I would like to find the corresponding GSM ids that match to these. I can find them via the SRA webpage manually, but would really like a way to use curl or python (not R) to get these values--is that possible?
2 answers
Can you give an example to test?
Take a look at this answer: A: Get a complete GSM-to-SRX/SRR table
If you don't want to download the entire SRA_Accessions.tab file, you can use Entrez Direct for this:
esearch -db sra -q 'SRS213308' | elink -db sra -target gds -name sra_gds | esummary | xtract -pattern DocumentSummary -subset DocumentSummary -if Accession -starts-with 'GSM' -first Accession
GSE30198
GSM747492
Curious why this is picking a GSE accession when you are asking for GSM?
The SRS accession is linked to both the GSM sample accession and the GSE series accessions in GEO Datasets. I could not come up with a good xtract command that will filter out the GSE hit. But it can be easily dropped using unix grep.
Log in to answer this question.