setwd("/Users/usri/Desktop/")
library(GEOquery)
## Loading required package: Biobase
## Warning: package 'Biobase' was built under R version 4.3.1
## Loading required package: BiocGenerics
## Warning: package 'BiocGenerics' was built under R version 4.3.1
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
##     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
##     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
##     table, tapply, union, unique, unsplit, which.max, which.min
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## Setting options('download.file.method.GEOquery'='auto')
## Setting options('GEOquery.inmemory.gpl'=FALSE)
#GEO dataset download 
#https://ftp.ncbi.nlm.nih.gov/geo/series/GSE157nnn/GSE157827/" (YOU CAN USE THIS AS EXAMPLE)
getGEOSuppFiles(GEO = "GSE114297", makeDirectory = TRUE)
##                                                      size isdir mode
## /Users/usri/Desktop/GSE114297/GSE114297_RAW.tar 140871680 FALSE  644
##                                                               mtime
## /Users/usri/Desktop/GSE114297/GSE114297_RAW.tar 2024-03-09 22:42:13
##                                                               ctime
## /Users/usri/Desktop/GSE114297/GSE114297_RAW.tar 2024-03-09 22:42:13
##                                                               atime uid gid
## /Users/usri/Desktop/GSE114297/GSE114297_RAW.tar 2024-03-09 22:42:07 501  20
##                                                 uname grname
## /Users/usri/Desktop/GSE114297/GSE114297_RAW.tar  usri  staff
untar("/Users/usri/Desktop/GSE114297/GSE114297_RAW.tar", exdir = "/Users/usri/Desktop/GSE114297/")
#done
#you can see files in your directory as here for example ("/Users/usri/Desktop/GSE114297/")