speed up write function
[arvados.git] / sdk / R / man / Collection.Rd
index add30b1440853167eab966f0b5124b935907f67d..bb72cc1b3fe75e192f81c9c091c1a4d6f7a259df 100644 (file)
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/arvados_objects.R
-\name{Collection}
-\alias{Collection}
-\title{Collection Object}
-\usage{
-Collection(uuid = NULL, etag = NULL, owner_uuid = NULL,
-  created_at = NULL, modified_by_client_uuid = NULL,
-  modified_by_user_uuid = NULL, modified_at = NULL,
-  portable_data_hash = NULL, replication_desired = NULL,
-  replication_confirmed_at = NULL, replication_confirmed = NULL,
-  updated_at = NULL, manifest_text = NULL, name = NULL,
-  description = NULL, properties = NULL, delete_at = NULL,
-  file_names = NULL, trash_at = NULL, is_trashed = NULL)
-}
-\arguments{
-\item{uuid}{Object ID}
-
-\item{etag}{Object version}
-
-\item{owner_uuid}{No description}
-
-\item{created_at}{No description}
-
-\item{modified_by_client_uuid}{No description}
-
-\item{modified_by_user_uuid}{No description}
-
-\item{modified_at}{No description}
-
-\item{portable_data_hash}{No description}
-
-\item{replication_desired}{No description}
-
-\item{replication_confirmed_at}{No description}
-
-\item{replication_confirmed}{No description}
-
-\item{updated_at}{No description}
-
-\item{manifest_text}{No description}
-
-\item{name}{No description}
-
-\item{description}{No description}
-
-\item{properties}{No description}
-
-\item{delete_at}{No description}
-
-\item{file_names}{No description}
-
-\item{trash_at}{No description}
-
-\item{is_trashed}{No description}
-}
-\value{
-Collection object
-}
-\description{
-Collection Object
-}
-\details{
-Todo: Update description
-Collection
-}
-\concept{Collection functions}
+% 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(name = "myoutput.csv", file = file, fileFormat = "csv", istable = NULL, collectionUUID = collectionUUID)             # csv\r
+writeFile <- collection$writeFile(name = "myoutput.tsv", file = file, fileFormat = "tsv", istable = NULL, collectionUUID = collectionUUID)             # tsv\r
+writeFile <- collection$writeFile(name = "myoutput.fasta", file = file, fileFormat = "fasta", istable = NULL, collectionUUID = collectionUUID)         # fasta\r
+writeFile <- collection$writeFile(name = "myoutputtable.txt", file = file, fileFormat = "txt", istable = "yes", collectionUUID = collectionUUID)       # txt table\r
+writeFile <- collection$writeFile(name = "myoutputtext.txt", file = file, fileFormat = "txt", istable = "no", collectionUUID = collectionUUID)         # txt text\r
+writeFile <- collection$writeFile(name = "myoutputbinary.dat", file = file, fileFormat = "dat", collectionUUID = collectionUUID)                       # binary\r
+writeFile <- collection$writeFile(name = "myoutputxlsx.xlsx", file = file, fileFormat = "xlsx", collectionUUID = collectionUUID)                       # 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(\r
+  name,\r
+  file,\r
+  collectionUUID,\r
+  fileFormat,\r
+  istable = NULL,\r
+  seqName = NULL\r
+)}\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(name = "myoutput.csv", file = file, fileFormat = "csv", istable = NULL, collectionUUID = collectionUUID)             # csv\r
+writeFile <- collection$writeFile(name = "myoutput.tsv", file = file, fileFormat = "tsv", istable = NULL, collectionUUID = collectionUUID)             # tsv\r
+writeFile <- collection$writeFile(name = "myoutput.fasta", file = file, fileFormat = "fasta", istable = NULL, collectionUUID = collectionUUID)         # fasta\r
+writeFile <- collection$writeFile(name = "myoutputtable.txt", file = file, fileFormat = "txt", istable = "yes", collectionUUID = collectionUUID)       # txt table\r
+writeFile <- collection$writeFile(name = "myoutputtext.txt", file = file, fileFormat = "txt", istable = "no", collectionUUID = collectionUUID)         # txt text\r
+writeFile <- collection$writeFile(name = "myoutputbinary.dat", file = file, fileFormat = "dat", collectionUUID = collectionUUID)                       # binary\r
+writeFile <- collection$writeFile(name = "myoutputxlsx.xlsx", file = file, fileFormat = "xlsx", collectionUUID = collectionUUID)                       # 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