Mercurial > repos > taoufik > microarrays
comparison query_microarray_datasets/GetDatasets.R @ 0:cf862e6a6ddb draft
Uploaded
| author | taoufik |
|---|---|
| date | Thu, 27 Dec 2018 05:54:24 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:cf862e6a6ddb |
|---|---|
| 1 log_file=file("Query_Geo_Database.log", open = "wt") | |
| 2 sink(log_file) | |
| 3 sink(log_file, type = "out") | |
| 4 suppressWarnings(suppressMessages(library("batch"))) | |
| 5 suppressWarnings(suppressMessages(library(GEOquery))) | |
| 6 listArguments = parseCommandArgs(evaluate=FALSE) | |
| 7 GeoCode=listArguments[["GeoCode"]] | |
| 8 GeoCode=toupper(GeoCode) | |
| 9 gethelp.df =tryCatch(eList <- getGEOSuppFiles(GeoCode), error = function(cond)"skip") | |
| 10 if(is.null(gethelp.df)){ | |
| 11 gethelp.df =tryCatch(eList <- getGEOSuppFiles(GeoCode), error = function(cond)"skip") | |
| 12 } | |
| 13 if(is.null(gethelp.df)){ | |
| 14 print('GeoCode with no raw data, choose another code or retry.') | |
| 15 }else{ | |
| 16 if(is.data.frame(gethelp.df)==TRUE){ | |
| 17 rawdata=rownames(eList)[grep('RAW',rownames(eList))][1] | |
| 18 untar(rawdata, exdir = 'CEL') | |
| 19 }else{ | |
| 20 if(gethelp.df=="skip"){ | |
| 21 print('Network Trouble Try Again Or Check your GeoCode') | |
| 22 }else{ | |
| 23 print('GeoCode with no raw data, choose another code or retry.') | |
| 24 } | |
| 25 } | |
| 26 } | |
| 27 |
