19704: Merge contributed updates to R SDK
[arvados.git] / sdk / R / man / Collection.Rd
index fbe6038664447df230ba77295f17d5df97274d29..5fbf1c1a118afb87396bcfb60f9fbc16cfce1016 100644 (file)
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/Collection.R
-\name{Collection}
-\alias{Collection}
-\title{Collection}
-\description{
-Collection class provides interface for working with Arvados collections.
-}
-\section{Usage}{
-
-\preformatted{collection = Collection$new(arv, uuid)}
-}
-
-\section{Arguments}{
-
-\describe{
-  \item{arv}{Arvados object.}
-  \item{uuid}{UUID of a collection.}
-}
-}
-
-\section{Methods}{
-
-\describe{
-  \item{add(content)}{Adds ArvadosFile or Subcollection specified by content to the collection.}
-  \item{create(files)}{Creates one or more ArvadosFiles and adds them to the collection at specified path.}
-  \item{remove(fileNames)}{Remove one or more files from the collection.}
-  \item{move(content, destination)}{Moves ArvadosFile or Subcollection to another location in the collection.}
-  \item{copy(content, destination)}{Copies ArvadosFile or Subcollection to another location in the collection.}
-  \item{getFileListing()}{Returns collections file content as character vector.}
-  \item{get(relativePath)}{If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.}
-}
-}
-
-\examples{
-\dontrun{
-arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
-collection <- Collection$new(arv, "uuid")
-
-createdFiles <- collection$create(c("main.cpp", lib.dll), "cpp/src/")
-
-collection$remove("location/to/my/file.cpp")
-
-collection$move("folder/file.cpp", "file.cpp")
-
-arvadosFile <- collection$get("location/to/my/file.cpp")
-arvadosSubcollection <- collection$get("location/to/my/directory/")
-}
-}
+% Generated by roxygen2: do not edit by hand\r
+% Please edit documentation in R/Collection.R\r
+\name{Collection}\r
+\alias{Collection}\r
+\title{R6 Class Representing Arvados Collection}\r
+\description{\r
+Collection class provides interface for working with Arvados collections,\r
+for exaplme actions like creating, updating, moving or removing are possible.\r
+}\r
+\examples{\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$new`\r
+## ------------------------------------------------\r
+\r
+collection <- Collection$new(arv, CollectionUUID)\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$readArvFile`\r
+## ------------------------------------------------\r
+\r
+collection <- Collection$new(arv, collectionUUID)\r
+readFile <- collection$readArvFile(arvadosFile, istable = 'yes')                    # table\r
+readFile <- collection$readArvFile(arvadosFile, istable = 'no')                     # text\r
+readFile <- collection$readArvFile(arvadosFile)                                     # xlsx, csv, tsv, rds, rdata\r
+readFile <- collection$readArvFile(arvadosFile, fileclass = 'lala')                 # fasta\r
+readFile <- collection$readArvFile(arvadosFile, Ncol= 4, Nrow = 32)                 # binary, only numbers\r
+readFile <- collection$readArvFile(arvadosFile, Ncol = 5, Nrow = 150, istable = "factor") # binary with factor or text\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$writeFile`\r
+## ------------------------------------------------\r
+\r
+collection <- Collection$new(arv, collectionUUID)\r
+writeFile <- collection$writeFile("myoutput.csv", file, istable = NULL)             # csv\r
+writeFile <- collection$writeFile("myoutput.fasta", file, istable = NULL)           # fasta\r
+writeFile <- collection$writeFile("myoutputtable.txt", file, istable = "yes")       # txt table\r
+writeFile <- collection$writeFile("myoutputtext.txt", file, istable = "no")         # txt text\r
+writeFile <- collection$writeFile("myoutputbinary.dat", file)                       # binary\r
+writeFile <- collection$writeFile("myoutputxlsx.xlsx", file)                        # xlsx\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$create`\r
+## ------------------------------------------------\r
+\r
+collection <- arv$collections_create(name = collectionTitle, description = collectionDescription, owner_uuid = collectionOwner, properties = list("ROX37196928443768648" = "ROX37742976443830153"))\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$remove`\r
+## ------------------------------------------------\r
+\r
+collection$remove(fileName.format)\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$move`\r
+## ------------------------------------------------\r
+\r
+collection$move("fileName.format", path)\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$copy`\r
+## ------------------------------------------------\r
+\r
+copied <- collection$copy("oldName.format", "newName.format")\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$refresh`\r
+## ------------------------------------------------\r
+\r
+collection$refresh()\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$getFileListing`\r
+## ------------------------------------------------\r
+\r
+list <- collection$getFileListing()\r
+\r
+## ------------------------------------------------\r
+## Method `Collection$get`\r
+## ------------------------------------------------\r
+\r
+arvadosFile <- collection$get(fileName)\r
+}\r
+\seealso{\r
+\code{\link{https://github.com/arvados/arvados/tree/main/sdk/R}}\r
+}\r
+\section{Public fields}{\r
+\if{html}{\out{<div class="r6-fields">}}\r
+\describe{\r
+\item{\code{uuid}}{Autentic for Collection UUID.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\section{Methods}{\r
+\subsection{Public methods}{\r
+\itemize{\r
+\item \href{#method-new}{\code{Collection$new()}}\r
+\item \href{#method-add}{\code{Collection$add()}}\r
+\item \href{#method-readArvFile}{\code{Collection$readArvFile()}}\r
+\item \href{#method-writeFile}{\code{Collection$writeFile()}}\r
+\item \href{#method-create}{\code{Collection$create()}}\r
+\item \href{#method-remove}{\code{Collection$remove()}}\r
+\item \href{#method-move}{\code{Collection$move()}}\r
+\item \href{#method-copy}{\code{Collection$copy()}}\r
+\item \href{#method-refresh}{\code{Collection$refresh()}}\r
+\item \href{#method-getFileListing}{\code{Collection$getFileListing()}}\r
+\item \href{#method-get}{\code{Collection$get()}}\r
+\item \href{#method-getRESTService}{\code{Collection$getRESTService()}}\r
+\item \href{#method-setRESTService}{\code{Collection$setRESTService()}}\r
+}\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-new"></a>}}\r
+\if{latex}{\out{\hypertarget{method-new}{}}}\r
+\subsection{Method \code{new()}}{\r
+Initialize new enviroment.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$new(api, uuid)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{api}}{Arvados enviroment.}\r
+\r
+\item{\code{uuid}}{The UUID Autentic for Collection UUID.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Returns}{\r
+A new `Collection` object.\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection <- Collection$new(arv, CollectionUUID)\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-add"></a>}}\r
+\if{latex}{\out{\hypertarget{method-add}{}}}\r
+\subsection{Method \code{add()}}{\r
+Adds ArvadosFile or Subcollection specified by content to the collection. Used only with ArvadosFile or Subcollection.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$add(content, relativePath = "")}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{content}}{Content to be added.}\r
+\r
+\item{\code{relativePath}}{Path to add content.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-readArvFile"></a>}}\r
+\if{latex}{\out{\hypertarget{method-readArvFile}{}}}\r
+\subsection{Method \code{readArvFile()}}{\r
+Read file content.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$readArvFile(\r
+  file,\r
+  con,\r
+  sep = ",",\r
+  istable = NULL,\r
+  fileclass = "SeqFastadna",\r
+  Ncol = NULL,\r
+  Nrow = NULL,\r
+  wantedFunction = NULL\r
+)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{file}}{Name of the file.}\r
+\r
+\item{\code{sep}}{Separator used in reading tsv, csv file format.}\r
+\r
+\item{\code{istable}}{Used in reading txt file to check if the file is table or not.}\r
+\r
+\item{\code{fileclass}}{Used in reading fasta file to set file class.}\r
+\r
+\item{\code{Ncol}}{Used in reading binary file to set numbers of columns in data.frame.}\r
+\r
+\item{\code{Nrow}}{Used in reading binary file to set numbers of rows in data.frame size.}\r
+\r
+\item{\code{col}}{Collection from which the file is read.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection <- Collection$new(arv, collectionUUID)\r
+readFile <- collection$readArvFile(arvadosFile, istable = 'yes')                    # table\r
+readFile <- collection$readArvFile(arvadosFile, istable = 'no')                     # text\r
+readFile <- collection$readArvFile(arvadosFile)                                     # xlsx, csv, tsv, rds, rdata\r
+readFile <- collection$readArvFile(arvadosFile, fileclass = 'lala')                 # fasta\r
+readFile <- collection$readArvFile(arvadosFile, Ncol= 4, Nrow = 32)                 # binary, only numbers\r
+readFile <- collection$readArvFile(arvadosFile, Ncol = 5, Nrow = 150, istable = "factor") # binary with factor or text\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-writeFile"></a>}}\r
+\if{latex}{\out{\hypertarget{method-writeFile}{}}}\r
+\subsection{Method \code{writeFile()}}{\r
+Write file content\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$writeFile(name, file, istable = NULL, seqName = NULL)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{name}}{Name of the file.}\r
+\r
+\item{\code{file}}{File to be saved.}\r
+\r
+\item{\code{istable}}{Used in writing txt file to check if the file is table or not.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection <- Collection$new(arv, collectionUUID)\r
+writeFile <- collection$writeFile("myoutput.csv", file, istable = NULL)             # csv\r
+writeFile <- collection$writeFile("myoutput.fasta", file, istable = NULL)           # fasta\r
+writeFile <- collection$writeFile("myoutputtable.txt", file, istable = "yes")       # txt table\r
+writeFile <- collection$writeFile("myoutputtext.txt", file, istable = "no")         # txt text\r
+writeFile <- collection$writeFile("myoutputbinary.dat", file)                       # binary\r
+writeFile <- collection$writeFile("myoutputxlsx.xlsx", file)                        # xlsx\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-create"></a>}}\r
+\if{latex}{\out{\hypertarget{method-create}{}}}\r
+\subsection{Method \code{create()}}{\r
+Creates one or more ArvadosFiles and adds them to the collection at specified path.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$create(files)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{files}}{Content to be created.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection <- arv$collections_create(name = collectionTitle, description = collectionDescription, owner_uuid = collectionOwner, properties = list("ROX37196928443768648" = "ROX37742976443830153"))\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-remove"></a>}}\r
+\if{latex}{\out{\hypertarget{method-remove}{}}}\r
+\subsection{Method \code{remove()}}{\r
+Remove one or more files from the collection.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$remove(paths)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{paths}}{Content to be removed.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection$remove(fileName.format)\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-move"></a>}}\r
+\if{latex}{\out{\hypertarget{method-move}{}}}\r
+\subsection{Method \code{move()}}{\r
+Moves ArvadosFile or Subcollection to another location in the collection.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$move(content, destination)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{content}}{Content to be moved.}\r
+\r
+\item{\code{destination}}{Path to move content.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection$move("fileName.format", path)\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-copy"></a>}}\r
+\if{latex}{\out{\hypertarget{method-copy}{}}}\r
+\subsection{Method \code{copy()}}{\r
+Copies ArvadosFile or Subcollection to another location in the collection.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$copy(content, destination)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{content}}{Content to be moved.}\r
+\r
+\item{\code{destination}}{Path to move content.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{copied <- collection$copy("oldName.format", "newName.format")\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-refresh"></a>}}\r
+\if{latex}{\out{\hypertarget{method-refresh}{}}}\r
+\subsection{Method \code{refresh()}}{\r
+Refreshes the environment.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$refresh()}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{collection$refresh()\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getFileListing"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getFileListing}{}}}\r
+\subsection{Method \code{getFileListing()}}{\r
+Returns collections file content as character vector.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$getFileListing()}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{list <- collection$getFileListing()\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-get"></a>}}\r
+\if{latex}{\out{\hypertarget{method-get}{}}}\r
+\subsection{Method \code{get()}}{\r
+If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$get(relativePath)}\if{html}{\out{</div>}}\r
+}\r
+\r
+\subsection{Arguments}{\r
+\if{html}{\out{<div class="arguments">}}\r
+\describe{\r
+\item{\code{relativePath}}{Path from content is taken.}\r
+}\r
+\if{html}{\out{</div>}}\r
+}\r
+\subsection{Examples}{\r
+\if{html}{\out{<div class="r example copy">}}\r
+\preformatted{arvadosFile <- collection$get(fileName)\r
+}\r
+\if{html}{\out{</div>}}\r
+\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-getRESTService"></a>}}\r
+\if{latex}{\out{\hypertarget{method-getRESTService}{}}}\r
+\subsection{Method \code{getRESTService()}}{\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$getRESTService()}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+\if{html}{\out{<hr>}}\r
+\if{html}{\out{<a id="method-setRESTService"></a>}}\r
+\if{latex}{\out{\hypertarget{method-setRESTService}{}}}\r
+\subsection{Method \code{setRESTService()}}{\r
+\subsection{Usage}{\r
+\if{html}{\out{<div class="r">}}\preformatted{Collection$setRESTService(newRESTService)}\if{html}{\out{</div>}}\r
+}\r
+\r
+}\r
+}\r