1 % Generated by roxygen2: do not edit by hand
\r
2 % Please edit documentation in R/Collection.R
\r
5 \title{R6 Class Representing Arvados Collection}
\r
7 Collection class provides interface for working with Arvados collections,
\r
8 for exaplme actions like creating, updating, moving or removing are possible.
\r
12 ## ------------------------------------------------
\r
13 ## Method `Collection$new`
\r
14 ## ------------------------------------------------
\r
16 collection <- Collection$new(arv, CollectionUUID)
\r
18 ## ------------------------------------------------
\r
19 ## Method `Collection$readArvFile`
\r
20 ## ------------------------------------------------
\r
22 collection <- Collection$new(arv, collectionUUID)
\r
23 readFile <- collection$readArvFile(arvadosFile, istable = 'yes') # table
\r
24 readFile <- collection$readArvFile(arvadosFile, istable = 'no') # text
\r
25 readFile <- collection$readArvFile(arvadosFile) # xlsx, csv, tsv, rds, rdata
\r
26 readFile <- collection$readArvFile(arvadosFile, fileclass = 'lala') # fasta
\r
27 readFile <- collection$readArvFile(arvadosFile, Ncol= 4, Nrow = 32) # binary, only numbers
\r
28 readFile <- collection$readArvFile(arvadosFile, Ncol = 5, Nrow = 150, istable = "factor") # binary with factor or text
\r
30 ## ------------------------------------------------
\r
31 ## Method `Collection$writeFile`
\r
32 ## ------------------------------------------------
\r
34 collection <- Collection$new(arv, collectionUUID)
\r
35 writeFile <- collection$writeFile("myoutput.csv", file, istable = NULL) # csv
\r
36 writeFile <- collection$writeFile("myoutput.fasta", file, istable = NULL) # fasta
\r
37 writeFile <- collection$writeFile("myoutputtable.txt", file, istable = "yes") # txt table
\r
38 writeFile <- collection$writeFile("myoutputtext.txt", file, istable = "no") # txt text
\r
39 writeFile <- collection$writeFile("myoutputbinary.dat", file) # binary
\r
40 writeFile <- collection$writeFile("myoutputxlsx.xlsx", file) # xlsx
\r
42 ## ------------------------------------------------
\r
43 ## Method `Collection$create`
\r
44 ## ------------------------------------------------
\r
46 collection <- arv$collections_create(name = collectionTitle, description = collectionDescription, owner_uuid = collectionOwner, properties = list("ROX37196928443768648" = "ROX37742976443830153"))
\r
48 ## ------------------------------------------------
\r
49 ## Method `Collection$remove`
\r
50 ## ------------------------------------------------
\r
52 collection$remove(fileName.format)
\r
54 ## ------------------------------------------------
\r
55 ## Method `Collection$move`
\r
56 ## ------------------------------------------------
\r
58 collection$move("fileName.format", path)
\r
60 ## ------------------------------------------------
\r
61 ## Method `Collection$copy`
\r
62 ## ------------------------------------------------
\r
64 copied <- collection$copy("oldName.format", "newName.format")
\r
66 ## ------------------------------------------------
\r
67 ## Method `Collection$refresh`
\r
68 ## ------------------------------------------------
\r
70 collection$refresh()
\r
72 ## ------------------------------------------------
\r
73 ## Method `Collection$getFileListing`
\r
74 ## ------------------------------------------------
\r
76 list <- collection$getFileListing()
\r
78 ## ------------------------------------------------
\r
79 ## Method `Collection$get`
\r
80 ## ------------------------------------------------
\r
82 arvadosFile <- collection$get(fileName)
\r
85 \code{\link{https://github.com/arvados/arvados/tree/main/sdk/R}}
\r
87 \section{Public fields}{
\r
88 \if{html}{\out{<div class="r6-fields">}}
\r
90 \item{\code{uuid}}{Autentic for Collection UUID.}
\r
92 \if{html}{\out{</div>}}
\r
95 \subsection{Public methods}{
\r
97 \item \href{#method-new}{\code{Collection$new()}}
\r
98 \item \href{#method-add}{\code{Collection$add()}}
\r
99 \item \href{#method-readArvFile}{\code{Collection$readArvFile()}}
\r
100 \item \href{#method-writeFile}{\code{Collection$writeFile()}}
\r
101 \item \href{#method-create}{\code{Collection$create()}}
\r
102 \item \href{#method-remove}{\code{Collection$remove()}}
\r
103 \item \href{#method-move}{\code{Collection$move()}}
\r
104 \item \href{#method-copy}{\code{Collection$copy()}}
\r
105 \item \href{#method-refresh}{\code{Collection$refresh()}}
\r
106 \item \href{#method-getFileListing}{\code{Collection$getFileListing()}}
\r
107 \item \href{#method-get}{\code{Collection$get()}}
\r
108 \item \href{#method-getRESTService}{\code{Collection$getRESTService()}}
\r
109 \item \href{#method-setRESTService}{\code{Collection$setRESTService()}}
\r
112 \if{html}{\out{<hr>}}
\r
113 \if{html}{\out{<a id="method-new"></a>}}
\r
114 \if{latex}{\out{\hypertarget{method-new}{}}}
\r
115 \subsection{Method \code{new()}}{
\r
116 Initialize new enviroment.
\r
117 \subsection{Usage}{
\r
118 \if{html}{\out{<div class="r">}}\preformatted{Collection$new(api, uuid)}\if{html}{\out{</div>}}
\r
121 \subsection{Arguments}{
\r
122 \if{html}{\out{<div class="arguments">}}
\r
124 \item{\code{api}}{Arvados enviroment.}
\r
126 \item{\code{uuid}}{The UUID Autentic for Collection UUID.}
\r
128 \if{html}{\out{</div>}}
\r
130 \subsection{Returns}{
\r
131 A new `Collection` object.
\r
133 \subsection{Examples}{
\r
134 \if{html}{\out{<div class="r example copy">}}
\r
135 \preformatted{collection <- Collection$new(arv, CollectionUUID)
\r
137 \if{html}{\out{</div>}}
\r
142 \if{html}{\out{<hr>}}
\r
143 \if{html}{\out{<a id="method-add"></a>}}
\r
144 \if{latex}{\out{\hypertarget{method-add}{}}}
\r
145 \subsection{Method \code{add()}}{
\r
146 Adds ArvadosFile or Subcollection specified by content to the collection. Used only with ArvadosFile or Subcollection.
\r
147 \subsection{Usage}{
\r
148 \if{html}{\out{<div class="r">}}\preformatted{Collection$add(content, relativePath = "")}\if{html}{\out{</div>}}
\r
151 \subsection{Arguments}{
\r
152 \if{html}{\out{<div class="arguments">}}
\r
154 \item{\code{content}}{Content to be added.}
\r
156 \item{\code{relativePath}}{Path to add content.}
\r
158 \if{html}{\out{</div>}}
\r
161 \if{html}{\out{<hr>}}
\r
162 \if{html}{\out{<a id="method-readArvFile"></a>}}
\r
163 \if{latex}{\out{\hypertarget{method-readArvFile}{}}}
\r
164 \subsection{Method \code{readArvFile()}}{
\r
166 \subsection{Usage}{
\r
167 \if{html}{\out{<div class="r">}}\preformatted{Collection$readArvFile(
\r
172 fileclass = "SeqFastadna",
\r
175 wantedFunction = NULL
\r
176 )}\if{html}{\out{</div>}}
\r
179 \subsection{Arguments}{
\r
180 \if{html}{\out{<div class="arguments">}}
\r
182 \item{\code{file}}{Name of the file.}
\r
184 \item{\code{sep}}{Separator used in reading tsv, csv file format.}
\r
186 \item{\code{istable}}{Used in reading txt file to check if the file is table or not.}
\r
188 \item{\code{fileclass}}{Used in reading fasta file to set file class.}
\r
190 \item{\code{Ncol}}{Used in reading binary file to set numbers of columns in data.frame.}
\r
192 \item{\code{Nrow}}{Used in reading binary file to set numbers of rows in data.frame size.}
\r
194 \item{\code{col}}{Collection from which the file is read.}
\r
196 \if{html}{\out{</div>}}
\r
198 \subsection{Examples}{
\r
199 \if{html}{\out{<div class="r example copy">}}
\r
200 \preformatted{collection <- Collection$new(arv, collectionUUID)
\r
201 readFile <- collection$readArvFile(arvadosFile, istable = 'yes') # table
\r
202 readFile <- collection$readArvFile(arvadosFile, istable = 'no') # text
\r
203 readFile <- collection$readArvFile(arvadosFile) # xlsx, csv, tsv, rds, rdata
\r
204 readFile <- collection$readArvFile(arvadosFile, fileclass = 'lala') # fasta
\r
205 readFile <- collection$readArvFile(arvadosFile, Ncol= 4, Nrow = 32) # binary, only numbers
\r
206 readFile <- collection$readArvFile(arvadosFile, Ncol = 5, Nrow = 150, istable = "factor") # binary with factor or text
\r
208 \if{html}{\out{</div>}}
\r
213 \if{html}{\out{<hr>}}
\r
214 \if{html}{\out{<a id="method-writeFile"></a>}}
\r
215 \if{latex}{\out{\hypertarget{method-writeFile}{}}}
\r
216 \subsection{Method \code{writeFile()}}{
\r
218 \subsection{Usage}{
\r
219 \if{html}{\out{<div class="r">}}\preformatted{Collection$writeFile(name, file, istable = NULL, seqName = NULL)}\if{html}{\out{</div>}}
\r
222 \subsection{Arguments}{
\r
223 \if{html}{\out{<div class="arguments">}}
\r
225 \item{\code{name}}{Name of the file.}
\r
227 \item{\code{file}}{File to be saved.}
\r
229 \item{\code{istable}}{Used in writing txt file to check if the file is table or not.}
\r
231 \if{html}{\out{</div>}}
\r
233 \subsection{Examples}{
\r
234 \if{html}{\out{<div class="r example copy">}}
\r
235 \preformatted{collection <- Collection$new(arv, collectionUUID)
\r
236 writeFile <- collection$writeFile("myoutput.csv", file, istable = NULL) # csv
\r
237 writeFile <- collection$writeFile("myoutput.fasta", file, istable = NULL) # fasta
\r
238 writeFile <- collection$writeFile("myoutputtable.txt", file, istable = "yes") # txt table
\r
239 writeFile <- collection$writeFile("myoutputtext.txt", file, istable = "no") # txt text
\r
240 writeFile <- collection$writeFile("myoutputbinary.dat", file) # binary
\r
241 writeFile <- collection$writeFile("myoutputxlsx.xlsx", file) # xlsx
\r
243 \if{html}{\out{</div>}}
\r
248 \if{html}{\out{<hr>}}
\r
249 \if{html}{\out{<a id="method-create"></a>}}
\r
250 \if{latex}{\out{\hypertarget{method-create}{}}}
\r
251 \subsection{Method \code{create()}}{
\r
252 Creates one or more ArvadosFiles and adds them to the collection at specified path.
\r
253 \subsection{Usage}{
\r
254 \if{html}{\out{<div class="r">}}\preformatted{Collection$create(files)}\if{html}{\out{</div>}}
\r
257 \subsection{Arguments}{
\r
258 \if{html}{\out{<div class="arguments">}}
\r
260 \item{\code{files}}{Content to be created.}
\r
262 \if{html}{\out{</div>}}
\r
264 \subsection{Examples}{
\r
265 \if{html}{\out{<div class="r example copy">}}
\r
266 \preformatted{collection <- arv$collections_create(name = collectionTitle, description = collectionDescription, owner_uuid = collectionOwner, properties = list("ROX37196928443768648" = "ROX37742976443830153"))
\r
268 \if{html}{\out{</div>}}
\r
273 \if{html}{\out{<hr>}}
\r
274 \if{html}{\out{<a id="method-remove"></a>}}
\r
275 \if{latex}{\out{\hypertarget{method-remove}{}}}
\r
276 \subsection{Method \code{remove()}}{
\r
277 Remove one or more files from the collection.
\r
278 \subsection{Usage}{
\r
279 \if{html}{\out{<div class="r">}}\preformatted{Collection$remove(paths)}\if{html}{\out{</div>}}
\r
282 \subsection{Arguments}{
\r
283 \if{html}{\out{<div class="arguments">}}
\r
285 \item{\code{paths}}{Content to be removed.}
\r
287 \if{html}{\out{</div>}}
\r
289 \subsection{Examples}{
\r
290 \if{html}{\out{<div class="r example copy">}}
\r
291 \preformatted{collection$remove(fileName.format)
\r
293 \if{html}{\out{</div>}}
\r
298 \if{html}{\out{<hr>}}
\r
299 \if{html}{\out{<a id="method-move"></a>}}
\r
300 \if{latex}{\out{\hypertarget{method-move}{}}}
\r
301 \subsection{Method \code{move()}}{
\r
302 Moves ArvadosFile or Subcollection to another location in the collection.
\r
303 \subsection{Usage}{
\r
304 \if{html}{\out{<div class="r">}}\preformatted{Collection$move(content, destination)}\if{html}{\out{</div>}}
\r
307 \subsection{Arguments}{
\r
308 \if{html}{\out{<div class="arguments">}}
\r
310 \item{\code{content}}{Content to be moved.}
\r
312 \item{\code{destination}}{Path to move content.}
\r
314 \if{html}{\out{</div>}}
\r
316 \subsection{Examples}{
\r
317 \if{html}{\out{<div class="r example copy">}}
\r
318 \preformatted{collection$move("fileName.format", path)
\r
320 \if{html}{\out{</div>}}
\r
325 \if{html}{\out{<hr>}}
\r
326 \if{html}{\out{<a id="method-copy"></a>}}
\r
327 \if{latex}{\out{\hypertarget{method-copy}{}}}
\r
328 \subsection{Method \code{copy()}}{
\r
329 Copies ArvadosFile or Subcollection to another location in the collection.
\r
330 \subsection{Usage}{
\r
331 \if{html}{\out{<div class="r">}}\preformatted{Collection$copy(content, destination)}\if{html}{\out{</div>}}
\r
334 \subsection{Arguments}{
\r
335 \if{html}{\out{<div class="arguments">}}
\r
337 \item{\code{content}}{Content to be moved.}
\r
339 \item{\code{destination}}{Path to move content.}
\r
341 \if{html}{\out{</div>}}
\r
343 \subsection{Examples}{
\r
344 \if{html}{\out{<div class="r example copy">}}
\r
345 \preformatted{copied <- collection$copy("oldName.format", "newName.format")
\r
347 \if{html}{\out{</div>}}
\r
352 \if{html}{\out{<hr>}}
\r
353 \if{html}{\out{<a id="method-refresh"></a>}}
\r
354 \if{latex}{\out{\hypertarget{method-refresh}{}}}
\r
355 \subsection{Method \code{refresh()}}{
\r
356 Refreshes the environment.
\r
357 \subsection{Usage}{
\r
358 \if{html}{\out{<div class="r">}}\preformatted{Collection$refresh()}\if{html}{\out{</div>}}
\r
361 \subsection{Examples}{
\r
362 \if{html}{\out{<div class="r example copy">}}
\r
363 \preformatted{collection$refresh()
\r
365 \if{html}{\out{</div>}}
\r
370 \if{html}{\out{<hr>}}
\r
371 \if{html}{\out{<a id="method-getFileListing"></a>}}
\r
372 \if{latex}{\out{\hypertarget{method-getFileListing}{}}}
\r
373 \subsection{Method \code{getFileListing()}}{
\r
374 Returns collections file content as character vector.
\r
375 \subsection{Usage}{
\r
376 \if{html}{\out{<div class="r">}}\preformatted{Collection$getFileListing()}\if{html}{\out{</div>}}
\r
379 \subsection{Examples}{
\r
380 \if{html}{\out{<div class="r example copy">}}
\r
381 \preformatted{list <- collection$getFileListing()
\r
383 \if{html}{\out{</div>}}
\r
388 \if{html}{\out{<hr>}}
\r
389 \if{html}{\out{<a id="method-get"></a>}}
\r
390 \if{latex}{\out{\hypertarget{method-get}{}}}
\r
391 \subsection{Method \code{get()}}{
\r
392 If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.
\r
393 \subsection{Usage}{
\r
394 \if{html}{\out{<div class="r">}}\preformatted{Collection$get(relativePath)}\if{html}{\out{</div>}}
\r
397 \subsection{Arguments}{
\r
398 \if{html}{\out{<div class="arguments">}}
\r
400 \item{\code{relativePath}}{Path from content is taken.}
\r
402 \if{html}{\out{</div>}}
\r
404 \subsection{Examples}{
\r
405 \if{html}{\out{<div class="r example copy">}}
\r
406 \preformatted{arvadosFile <- collection$get(fileName)
\r
408 \if{html}{\out{</div>}}
\r
413 \if{html}{\out{<hr>}}
\r
414 \if{html}{\out{<a id="method-getRESTService"></a>}}
\r
415 \if{latex}{\out{\hypertarget{method-getRESTService}{}}}
\r
416 \subsection{Method \code{getRESTService()}}{
\r
417 \subsection{Usage}{
\r
418 \if{html}{\out{<div class="r">}}\preformatted{Collection$getRESTService()}\if{html}{\out{</div>}}
\r
422 \if{html}{\out{<hr>}}
\r
423 \if{html}{\out{<a id="method-setRESTService"></a>}}
\r
424 \if{latex}{\out{\hypertarget{method-setRESTService}{}}}
\r
425 \subsection{Method \code{setRESTService()}}{
\r
426 \subsection{Usage}{
\r
427 \if{html}{\out{<div class="r">}}\preformatted{Collection$setRESTService(newRESTService)}\if{html}{\out{</div>}}
\r