Collection | R Documentation |
Collection class provides interface for working with Arvados collections, for exaplme actions like creating, updating, moving or removing are possible.
uuid
Autentic for Collection UUID.
new()
Initialize new enviroment.
Collection$new(api, uuid)
api
Arvados enviroment.
uuid
The UUID Autentic for Collection UUID.
A new 'Collection' object.
collection <- Collection$new(arv, CollectionUUID)
add()
Adds ArvadosFile or Subcollection specified by content to the collection. Used only with ArvadosFile or Subcollection.
Collection$add(content, relativePath = "")
content
Content to be added.
relativePath
Path to add content.
readArvFile()
Read file content.
Collection$readArvFile( file, con, sep = ",", istable = NULL, fileclass = "SeqFastadna", Ncol = NULL, Nrow = NULL, wantedFunction = NULL )
file
Name of the file.
sep
Separator used in reading tsv, csv file format.
istable
Used in reading txt file to check if the file is table or not.
fileclass
Used in reading fasta file to set file class.
Ncol
Used in reading binary file to set numbers of columns in data.frame.
Nrow
Used in reading binary file to set numbers of rows in data.frame size.
col
Collection from which the file is read.
collection <- Collection$new(arv, collectionUUID) readFile <- collection$readArvFile(arvadosFile, istable = 'yes') # table readFile <- collection$readArvFile(arvadosFile, istable = 'no') # text readFile <- collection$readArvFile(arvadosFile) # xlsx, csv, tsv, rds, rdata readFile <- collection$readArvFile(arvadosFile, fileclass = 'lala') # fasta readFile <- collection$readArvFile(arvadosFile, Ncol= 4, Nrow = 32) # binary, only numbers readFile <- collection$readArvFile(arvadosFile, Ncol = 5, Nrow = 150, istable = "factor") # binary with factor or text
writeFile()
Write file content
Collection$writeFile(name, file, istable = NULL, seqName = NULL)
name
Name of the file.
file
File to be saved.
istable
Used in writing txt file to check if the file is table or not.
collection <- Collection$new(arv, collectionUUID) writeFile <- collection$writeFile("myoutput.csv", file, istable = NULL) # csv writeFile <- collection$writeFile("myoutput.fasta", file, istable = NULL) # fasta writeFile <- collection$writeFile("myoutputtable.txt", file, istable = "yes") # txt table writeFile <- collection$writeFile("myoutputtext.txt", file, istable = "no") # txt text writeFile <- collection$writeFile("myoutputbinary.dat", file) # binary writeFile <- collection$writeFile("myoutputxlsx.xlsx", file) # xlsx
create()
Creates one or more ArvadosFiles and adds them to the collection at specified path.
Collection$create(files)
files
Content to be created.
collection <- arv$collections_create(name = collectionTitle, description = collectionDescription, owner_uuid = collectionOwner, properties = list("ROX37196928443768648" = "ROX37742976443830153"))
remove()
Remove one or more files from the collection.
Collection$remove(paths)
paths
Content to be removed.
collection$remove(fileName.format)
move()
Moves ArvadosFile or Subcollection to another location in the collection.
Collection$move(content, destination)
content
Content to be moved.
destination
Path to move content.
collection$move("fileName.format", path)
copy()
Copies ArvadosFile or Subcollection to another location in the collection.
Collection$copy(content, destination)
content
Content to be moved.
destination
Path to move content.
copied <- collection$copy("oldName.format", "newName.format")
refresh()
Refreshes the environment.
Collection$refresh()
collection$refresh()
getFileListing()
Returns collections file content as character vector.
Collection$getFileListing()
list <- collection$getFileListing()
get()
If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.
Collection$get(relativePath)
relativePath
Path from content is taken.
arvadosFile <- collection$get(fileName)
getRESTService()
Collection$getRESTService()
setRESTService()
Collection$setRESTService(newRESTService)
https://github.com/arvados/arvados/tree/main/sdk/R
## ------------------------------------------------ ## Method `Collection$new` ## ------------------------------------------------ collection <- Collection$new(arv, CollectionUUID) ## ------------------------------------------------ ## Method `Collection$readArvFile` ## ------------------------------------------------ collection <- Collection$new(arv, collectionUUID) readFile <- collection$readArvFile(arvadosFile, istable = 'yes') # table readFile <- collection$readArvFile(arvadosFile, istable = 'no') # text readFile <- collection$readArvFile(arvadosFile) # xlsx, csv, tsv, rds, rdata readFile <- collection$readArvFile(arvadosFile, fileclass = 'lala') # fasta readFile <- collection$readArvFile(arvadosFile, Ncol= 4, Nrow = 32) # binary, only numbers readFile <- collection$readArvFile(arvadosFile, Ncol = 5, Nrow = 150, istable = "factor") # binary with factor or text ## ------------------------------------------------ ## Method `Collection$writeFile` ## ------------------------------------------------ collection <- Collection$new(arv, collectionUUID) writeFile <- collection$writeFile("myoutput.csv", file, istable = NULL) # csv writeFile <- collection$writeFile("myoutput.fasta", file, istable = NULL) # fasta writeFile <- collection$writeFile("myoutputtable.txt", file, istable = "yes") # txt table writeFile <- collection$writeFile("myoutputtext.txt", file, istable = "no") # txt text writeFile <- collection$writeFile("myoutputbinary.dat", file) # binary writeFile <- collection$writeFile("myoutputxlsx.xlsx", file) # xlsx ## ------------------------------------------------ ## Method `Collection$create` ## ------------------------------------------------ collection <- arv$collections_create(name = collectionTitle, description = collectionDescription, owner_uuid = collectionOwner, properties = list("ROX37196928443768648" = "ROX37742976443830153")) ## ------------------------------------------------ ## Method `Collection$remove` ## ------------------------------------------------ collection$remove(fileName.format) ## ------------------------------------------------ ## Method `Collection$move` ## ------------------------------------------------ collection$move("fileName.format", path) ## ------------------------------------------------ ## Method `Collection$copy` ## ------------------------------------------------ copied <- collection$copy("oldName.format", "newName.format") ## ------------------------------------------------ ## Method `Collection$refresh` ## ------------------------------------------------ collection$refresh() ## ------------------------------------------------ ## Method `Collection$getFileListing` ## ------------------------------------------------ list <- collection$getFileListing() ## ------------------------------------------------ ## Method `Collection$get` ## ------------------------------------------------ arvadosFile <- collection$get(fileName)