Skip to content

Instantly share code, notes, and snippets.

@suimye
Last active April 2, 2020 12:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save suimye/d8edec74cce9ecad86cd to your computer and use it in GitHub Desktop.
Save suimye/d8edec74cce9ecad86cd to your computer and use it in GitHub Desktop.
For retrieving fastq file from NCBI GEO using GSM number.
#!/bin/sh
if ! type "efetch" > /dev/null; then
print "Please install E-utilitie."
fi
GSM_LIST=$1
GSMs=`cat $GSM_LIST|cut -f1`
#echo $SRRs
! type "foo" > /dev/null 2>&1;
for GSM in $GSMs; do
echo $GSM retrieves from NCBI GEO.....
SRR=`esearch -db sra -query $GSM |efetch -format docsum |xtract -pattern DocumentSummary -element Run@acc`
fastq-dump -A $SRR -O sra_fastq
echo fastq-dump done.....
done
@abmmki
Copy link

abmmki commented Apr 2, 2020

not working

/getFastaFromGEO.sh GSM.List
GSM4432378 retrieves from NCBI GEO.....
unrecognized option: '-f'
fastq-dump done.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment