## -----------------------------------------------------------------------
## Inspect metadata:
## -----------------------------------------------------------------------
## A useful first step in testing a new recipe is to generate and
## inspect a small number of metadata records. The combination of
## 'metadataOnly=TRUE', 'insert=FALSE' and 'justRunUnitTest=TRUE'
## generates metadata for the first 5 records and does not download or
## process any data.
meta <- updateResources("/local/path",
BiocVersion = c("3.2", "3.3"),
preparerClasses = "EnsemblFastaImportPreparer",
metadataOnly = TRUE, insert = FALSE,
justRunUnitTest = TRUE,
regex = ".*release-82")
INFO [2015-11-12 07:58:05] Preparer Class: EnsemblFastaImportPreparer
Ailuropoda_melanoleuca.ailMel1.cdna.all.fa.gz
Ailuropoda_melanoleuca.ailMel1.dna_rm.toplevel.fa.gz
Ailuropoda_melanoleuca.ailMel1.dna_sm.toplevel.fa.gz
Ailuropoda_melanoleuca.ailMel1.dna.toplevel.fa.gz
Ailuropoda_melanoleuca.ailMel1.ncrna.fa.gz
## The return value is a list of metadata for the first 5 records:
> names(meta)
[1] "FASTA cDNA sequence for Ailuropoda melanoleuca"
[2] "FASTA DNA sequence for Ailuropoda melanoleuca"
[3] "FASTA DNA sequence for Ailuropoda melanoleuca"
[4] "FASTA DNA sequence for Ailuropoda melanoleuca"
[5] "FASTA ncRNA sequence for Ailuropoda melanoleuca"
## Each record is of class AnnotationHubMetadata:
> class(meta[[1]])
[1] "AnnotationHubMetadata"
attr(,"package")
[1] "AnnotationHubData"
## -----------------------------------------------------------------------
## Insert metadata in the db and process/push data files:
## -----------------------------------------------------------------------
## This next code chunk creates the metadata and downloads and processes
## the data. If all files are successfully pushed to their
## final resting place then metadata are inserted in the AnnotationHub db.
meta <- updateResources("local/path",
BiocVersion = c("3.2", "3.3"),
preparerClasses = "EnsemblFastaImportPreparer",
metadataOnly = FALSE, insert = TRUE,
justRunUnitTest = FALSE,
regex = ".*release-81")
## -----------------------------------------------------------------------
## Recovery helpers:
## -----------------------------------------------------------------------
## pushResources() and pushMetadata() are both called from updateResources()
## but can be used solo for testing or completing a run that
## terminated unexpectedly.
## Download, process and push to S3 the last 2 files in 'meta':
sub <- meta[length(meta) - 1:length(meta)]
pushResources(sub)
## Insert metadata in the AnotationHub db for the last 2 files in 'meta':
pushMetadata(sub, url = getOption("AH_SERVER_POST_URL"))
Run the code above in your browser using DataLab