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
17 collection <- Collection$new(arv, CollectionUUID)
\r
20 ## ------------------------------------------------
\r
21 ## Method `Collection$readArvFile`
\r
22 ## ------------------------------------------------
\r
25 collection <- Collection$new(arv, collectionUUID)
\r
26 readFile <- collection$readArvFile(arvadosFile, istable = 'yes') # table
\r
27 readFile <- collection$readArvFile(arvadosFile, istable = 'no') # text
\r
28 readFile <- collection$readArvFile(arvadosFile) # xlsx, csv, tsv, rds, rdata
\r
29 readFile <- collection$readArvFile(arvadosFile, fileclass = 'fasta') # fasta
\r
30 readFile <- collection$readArvFile(arvadosFile, Ncol= 4, Nrow = 32) # binary, only numbers
\r
31 readFile <- collection$readArvFile(arvadosFile, Ncol = 5, Nrow = 150, istable = "factor") # binary with factor or text
\r
34 ## ------------------------------------------------
\r
35 ## Method `Collection$writeFile`
\r
36 ## ------------------------------------------------
\r
39 collection <- Collection$new(arv, collectionUUID)
\r
40 writeFile <- collection$writeFile(name = "myoutput.csv", file = file, fileFormat = "csv", istable = NULL, collectionUUID = collectionUUID) # csv
\r
41 writeFile <- collection$writeFile(name = "myoutput.tsv", file = file, fileFormat = "tsv", istable = NULL, collectionUUID = collectionUUID) # tsv
\r
42 writeFile <- collection$writeFile(name = "myoutput.fasta", file = file, fileFormat = "fasta", istable = NULL, collectionUUID = collectionUUID) # fasta
\r
43 writeFile <- collection$writeFile(name = "myoutputtable.txt", file = file, fileFormat = "txt", istable = "yes", collectionUUID = collectionUUID) # txt table
\r
44 writeFile <- collection$writeFile(name = "myoutputtext.txt", file = file, fileFormat = "txt", istable = "no", collectionUUID = collectionUUID) # txt text
\r
45 writeFile <- collection$writeFile(name = "myoutputbinary.dat", file = file, fileFormat = "dat", collectionUUID = collectionUUID) # binary
\r
46 writeFile <- collection$writeFile(name = "myoutputxlsx.xlsx", file = file, fileFormat = "xlsx", collectionUUID = collectionUUID) # xlsx
\r
49 ## ------------------------------------------------
\r
50 ## Method `Collection$create`
\r
51 ## ------------------------------------------------
\r
54 collection <- arv$collections_create(name = collectionTitle, description = collectionDescription, owner_uuid = collectionOwner, properties = list("ROX37196928443768648" = "ROX37742976443830153"))
\r
57 ## ------------------------------------------------
\r
58 ## Method `Collection$remove`
\r
59 ## ------------------------------------------------
\r
62 collection$remove(fileName.format)
\r
65 ## ------------------------------------------------
\r
66 ## Method `Collection$move`
\r
67 ## ------------------------------------------------
\r
70 collection$move("fileName.format", path)
\r
73 ## ------------------------------------------------
\r
74 ## Method `Collection$copy`
\r
75 ## ------------------------------------------------
\r
78 copied <- collection$copy("oldName.format", "newName.format")
\r
81 ## ------------------------------------------------
\r
82 ## Method `Collection$refresh`
\r
83 ## ------------------------------------------------
\r
86 collection$refresh()
\r
89 ## ------------------------------------------------
\r
90 ## Method `Collection$getFileListing`
\r
91 ## ------------------------------------------------
\r
94 list <- collection$getFileListing()
\r
97 ## ------------------------------------------------
\r
98 ## Method `Collection$get`
\r
99 ## ------------------------------------------------
\r
102 arvadosFile <- collection$get(fileName)
\r
106 https://git.arvados.org/arvados.git/tree/HEAD:/sdk/R
\r
108 \section{Public fields}{
\r
109 \if{html}{\out{<div class="r6-fields">}}
\r
111 \item{\code{uuid}}{Autentic for Collection UUID.}
\r
113 \if{html}{\out{</div>}}
\r
116 \subsection{Public methods}{
\r
118 \item \href{#method-Collection-new}{\code{Collection$new()}}
\r
119 \item \href{#method-Collection-add}{\code{Collection$add()}}
\r
120 \item \href{#method-Collection-readArvFile}{\code{Collection$readArvFile()}}
\r
121 \item \href{#method-Collection-writeFile}{\code{Collection$writeFile()}}
\r
122 \item \href{#method-Collection-create}{\code{Collection$create()}}
\r
123 \item \href{#method-Collection-remove}{\code{Collection$remove()}}
\r
124 \item \href{#method-Collection-move}{\code{Collection$move()}}
\r
125 \item \href{#method-Collection-copy}{\code{Collection$copy()}}
\r
126 \item \href{#method-Collection-refresh}{\code{Collection$refresh()}}
\r
127 \item \href{#method-Collection-getFileListing}{\code{Collection$getFileListing()}}
\r
128 \item \href{#method-Collection-get}{\code{Collection$get()}}
\r
129 \item \href{#method-Collection-getRESTService}{\code{Collection$getRESTService()}}
\r
130 \item \href{#method-Collection-setRESTService}{\code{Collection$setRESTService()}}
\r
133 \if{html}{\out{<hr>}}
\r
134 \if{html}{\out{<a id="method-Collection-new"></a>}}
\r
135 \if{latex}{\out{\hypertarget{method-Collection-new}{}}}
\r
136 \subsection{Method \code{new()}}{
\r
137 Initialize new enviroment.
\r
138 \subsection{Usage}{
\r
139 \if{html}{\out{<div class="r">}}\preformatted{Collection$new(api, uuid)}\if{html}{\out{</div>}}
\r
142 \subsection{Arguments}{
\r
143 \if{html}{\out{<div class="arguments">}}
\r
145 \item{\code{api}}{Arvados enviroment.}
\r
147 \item{\code{uuid}}{The UUID Autentic for Collection UUID.}
\r
149 \if{html}{\out{</div>}}
\r
151 \subsection{Returns}{
\r
152 A new `Collection` object.
\r
154 \subsection{Examples}{
\r
155 \if{html}{\out{<div class="r example copy">}}
\r
156 \preformatted{\dontrun{
\r
157 collection <- Collection$new(arv, CollectionUUID)
\r
160 \if{html}{\out{</div>}}
\r
165 \if{html}{\out{<hr>}}
\r
166 \if{html}{\out{<a id="method-Collection-add"></a>}}
\r
167 \if{latex}{\out{\hypertarget{method-Collection-add}{}}}
\r
168 \subsection{Method \code{add()}}{
\r
169 Adds ArvadosFile or Subcollection specified by content to the collection. Used only with ArvadosFile or Subcollection.
\r
170 \subsection{Usage}{
\r
171 \if{html}{\out{<div class="r">}}\preformatted{Collection$add(content, relativePath = "")}\if{html}{\out{</div>}}
\r
174 \subsection{Arguments}{
\r
175 \if{html}{\out{<div class="arguments">}}
\r
177 \item{\code{content}}{Content to be added.}
\r
179 \item{\code{relativePath}}{Path to add content.}
\r
181 \if{html}{\out{</div>}}
\r
184 \if{html}{\out{<hr>}}
\r
185 \if{html}{\out{<a id="method-Collection-readArvFile"></a>}}
\r
186 \if{latex}{\out{\hypertarget{method-Collection-readArvFile}{}}}
\r
187 \subsection{Method \code{readArvFile()}}{
\r
189 \subsection{Usage}{
\r
190 \if{html}{\out{<div class="r">}}\preformatted{Collection$readArvFile(
\r
195 fileclass = "SeqFastadna",
\r
198 wantedFunction = NULL
\r
199 )}\if{html}{\out{</div>}}
\r
202 \subsection{Arguments}{
\r
203 \if{html}{\out{<div class="arguments">}}
\r
205 \item{\code{file}}{Name of the file.}
\r
207 \item{\code{sep}}{Separator used in reading tsv, csv file format.}
\r
209 \item{\code{istable}}{Used in reading txt file to check if the file is table or not.}
\r
211 \item{\code{fileclass}}{Used in reading fasta file to set file class.}
\r
213 \item{\code{Ncol}}{Used in reading binary file to set numbers of columns in data.frame.}
\r
215 \item{\code{Nrow}}{Used in reading binary file to set numbers of rows in data.frame size.}
\r
217 \item{\code{col}}{Collection from which the file is read.}
\r
219 \if{html}{\out{</div>}}
\r
221 \subsection{Examples}{
\r
222 \if{html}{\out{<div class="r example copy">}}
\r
223 \preformatted{\dontrun{
\r
224 collection <- Collection$new(arv, collectionUUID)
\r
225 readFile <- collection$readArvFile(arvadosFile, istable = 'yes') # table
\r
226 readFile <- collection$readArvFile(arvadosFile, istable = 'no') # text
\r
227 readFile <- collection$readArvFile(arvadosFile) # xlsx, csv, tsv, rds, rdata
\r
228 readFile <- collection$readArvFile(arvadosFile, fileclass = 'fasta') # fasta
\r
229 readFile <- collection$readArvFile(arvadosFile, Ncol= 4, Nrow = 32) # binary, only numbers
\r
230 readFile <- collection$readArvFile(arvadosFile, Ncol = 5, Nrow = 150, istable = "factor") # binary with factor or text
\r
233 \if{html}{\out{</div>}}
\r
238 \if{html}{\out{<hr>}}
\r
239 \if{html}{\out{<a id="method-Collection-writeFile"></a>}}
\r
240 \if{latex}{\out{\hypertarget{method-Collection-writeFile}{}}}
\r
241 \subsection{Method \code{writeFile()}}{
\r
243 \subsection{Usage}{
\r
244 \if{html}{\out{<div class="r">}}\preformatted{Collection$writeFile(
\r
251 )}\if{html}{\out{</div>}}
\r
254 \subsection{Arguments}{
\r
255 \if{html}{\out{<div class="arguments">}}
\r
257 \item{\code{name}}{Name of the file.}
\r
259 \item{\code{file}}{File to be saved.}
\r
261 \item{\code{istable}}{Used in writing txt file to check if the file is table or not.}
\r
263 \if{html}{\out{</div>}}
\r
265 \subsection{Examples}{
\r
266 \if{html}{\out{<div class="r example copy">}}
\r
267 \preformatted{\dontrun{
\r
268 collection <- Collection$new(arv, collectionUUID)
\r
269 writeFile <- collection$writeFile(name = "myoutput.csv", file = file, fileFormat = "csv", istable = NULL, collectionUUID = collectionUUID) # csv
\r
270 writeFile <- collection$writeFile(name = "myoutput.tsv", file = file, fileFormat = "tsv", istable = NULL, collectionUUID = collectionUUID) # tsv
\r
271 writeFile <- collection$writeFile(name = "myoutput.fasta", file = file, fileFormat = "fasta", istable = NULL, collectionUUID = collectionUUID) # fasta
\r
272 writeFile <- collection$writeFile(name = "myoutputtable.txt", file = file, fileFormat = "txt", istable = "yes", collectionUUID = collectionUUID) # txt table
\r
273 writeFile <- collection$writeFile(name = "myoutputtext.txt", file = file, fileFormat = "txt", istable = "no", collectionUUID = collectionUUID) # txt text
\r
274 writeFile <- collection$writeFile(name = "myoutputbinary.dat", file = file, fileFormat = "dat", collectionUUID = collectionUUID) # binary
\r
275 writeFile <- collection$writeFile(name = "myoutputxlsx.xlsx", file = file, fileFormat = "xlsx", collectionUUID = collectionUUID) # xlsx
\r
278 \if{html}{\out{</div>}}
\r
283 \if{html}{\out{<hr>}}
\r
284 \if{html}{\out{<a id="method-Collection-create"></a>}}
\r
285 \if{latex}{\out{\hypertarget{method-Collection-create}{}}}
\r
286 \subsection{Method \code{create()}}{
\r
287 Creates one or more ArvadosFiles and adds them to the collection at specified path.
\r
288 \subsection{Usage}{
\r
289 \if{html}{\out{<div class="r">}}\preformatted{Collection$create(files)}\if{html}{\out{</div>}}
\r
292 \subsection{Arguments}{
\r
293 \if{html}{\out{<div class="arguments">}}
\r
295 \item{\code{files}}{Content to be created.}
\r
297 \if{html}{\out{</div>}}
\r
299 \subsection{Examples}{
\r
300 \if{html}{\out{<div class="r example copy">}}
\r
301 \preformatted{\dontrun{
\r
302 collection <- arv$collections_create(name = collectionTitle, description = collectionDescription, owner_uuid = collectionOwner, properties = list("ROX37196928443768648" = "ROX37742976443830153"))
\r
305 \if{html}{\out{</div>}}
\r
310 \if{html}{\out{<hr>}}
\r
311 \if{html}{\out{<a id="method-Collection-remove"></a>}}
\r
312 \if{latex}{\out{\hypertarget{method-Collection-remove}{}}}
\r
313 \subsection{Method \code{remove()}}{
\r
314 Remove one or more files from the collection.
\r
315 \subsection{Usage}{
\r
316 \if{html}{\out{<div class="r">}}\preformatted{Collection$remove(paths)}\if{html}{\out{</div>}}
\r
319 \subsection{Arguments}{
\r
320 \if{html}{\out{<div class="arguments">}}
\r
322 \item{\code{paths}}{Content to be removed.}
\r
324 \if{html}{\out{</div>}}
\r
326 \subsection{Examples}{
\r
327 \if{html}{\out{<div class="r example copy">}}
\r
328 \preformatted{\dontrun{
\r
329 collection$remove(fileName.format)
\r
332 \if{html}{\out{</div>}}
\r
337 \if{html}{\out{<hr>}}
\r
338 \if{html}{\out{<a id="method-Collection-move"></a>}}
\r
339 \if{latex}{\out{\hypertarget{method-Collection-move}{}}}
\r
340 \subsection{Method \code{move()}}{
\r
341 Moves ArvadosFile or Subcollection to another location in the collection.
\r
342 \subsection{Usage}{
\r
343 \if{html}{\out{<div class="r">}}\preformatted{Collection$move(content, destination)}\if{html}{\out{</div>}}
\r
346 \subsection{Arguments}{
\r
347 \if{html}{\out{<div class="arguments">}}
\r
349 \item{\code{content}}{Content to be moved.}
\r
351 \item{\code{destination}}{Path to move content.}
\r
353 \if{html}{\out{</div>}}
\r
355 \subsection{Examples}{
\r
356 \if{html}{\out{<div class="r example copy">}}
\r
357 \preformatted{\dontrun{
\r
358 collection$move("fileName.format", path)
\r
361 \if{html}{\out{</div>}}
\r
366 \if{html}{\out{<hr>}}
\r
367 \if{html}{\out{<a id="method-Collection-copy"></a>}}
\r
368 \if{latex}{\out{\hypertarget{method-Collection-copy}{}}}
\r
369 \subsection{Method \code{copy()}}{
\r
370 Copies ArvadosFile or Subcollection to another location in the collection.
\r
371 \subsection{Usage}{
\r
372 \if{html}{\out{<div class="r">}}\preformatted{Collection$copy(content, destination)}\if{html}{\out{</div>}}
\r
375 \subsection{Arguments}{
\r
376 \if{html}{\out{<div class="arguments">}}
\r
378 \item{\code{content}}{Content to be moved.}
\r
380 \item{\code{destination}}{Path to move content.}
\r
382 \if{html}{\out{</div>}}
\r
384 \subsection{Examples}{
\r
385 \if{html}{\out{<div class="r example copy">}}
\r
386 \preformatted{\dontrun{
\r
387 copied <- collection$copy("oldName.format", "newName.format")
\r
390 \if{html}{\out{</div>}}
\r
395 \if{html}{\out{<hr>}}
\r
396 \if{html}{\out{<a id="method-Collection-refresh"></a>}}
\r
397 \if{latex}{\out{\hypertarget{method-Collection-refresh}{}}}
\r
398 \subsection{Method \code{refresh()}}{
\r
399 Refreshes the environment.
\r
400 \subsection{Usage}{
\r
401 \if{html}{\out{<div class="r">}}\preformatted{Collection$refresh()}\if{html}{\out{</div>}}
\r
404 \subsection{Examples}{
\r
405 \if{html}{\out{<div class="r example copy">}}
\r
406 \preformatted{\dontrun{
\r
407 collection$refresh()
\r
410 \if{html}{\out{</div>}}
\r
415 \if{html}{\out{<hr>}}
\r
416 \if{html}{\out{<a id="method-Collection-getFileListing"></a>}}
\r
417 \if{latex}{\out{\hypertarget{method-Collection-getFileListing}{}}}
\r
418 \subsection{Method \code{getFileListing()}}{
\r
419 Returns collections file content as character vector.
\r
420 \subsection{Usage}{
\r
421 \if{html}{\out{<div class="r">}}\preformatted{Collection$getFileListing()}\if{html}{\out{</div>}}
\r
424 \subsection{Examples}{
\r
425 \if{html}{\out{<div class="r example copy">}}
\r
426 \preformatted{\dontrun{
\r
427 list <- collection$getFileListing()
\r
430 \if{html}{\out{</div>}}
\r
435 \if{html}{\out{<hr>}}
\r
436 \if{html}{\out{<a id="method-Collection-get"></a>}}
\r
437 \if{latex}{\out{\hypertarget{method-Collection-get}{}}}
\r
438 \subsection{Method \code{get()}}{
\r
439 If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.
\r
440 \subsection{Usage}{
\r
441 \if{html}{\out{<div class="r">}}\preformatted{Collection$get(relativePath)}\if{html}{\out{</div>}}
\r
444 \subsection{Arguments}{
\r
445 \if{html}{\out{<div class="arguments">}}
\r
447 \item{\code{relativePath}}{Path from content is taken.}
\r
449 \if{html}{\out{</div>}}
\r
451 \subsection{Examples}{
\r
452 \if{html}{\out{<div class="r example copy">}}
\r
453 \preformatted{\dontrun{
\r
454 arvadosFile <- collection$get(fileName)
\r
457 \if{html}{\out{</div>}}
\r
462 \if{html}{\out{<hr>}}
\r
463 \if{html}{\out{<a id="method-Collection-getRESTService"></a>}}
\r
464 \if{latex}{\out{\hypertarget{method-Collection-getRESTService}{}}}
\r
465 \subsection{Method \code{getRESTService()}}{
\r
466 \subsection{Usage}{
\r
467 \if{html}{\out{<div class="r">}}\preformatted{Collection$getRESTService()}\if{html}{\out{</div>}}
\r
471 \if{html}{\out{<hr>}}
\r
472 \if{html}{\out{<a id="method-Collection-setRESTService"></a>}}
\r
473 \if{latex}{\out{\hypertarget{method-Collection-setRESTService}{}}}
\r
474 \subsection{Method \code{setRESTService()}}{
\r
475 \subsection{Usage}{
\r
476 \if{html}{\out{<div class="r">}}\preformatted{Collection$setRESTService(newRESTService)}\if{html}{\out{</div>}}
\r