copy: copy

copyR Documentation

copy

Description

- This function will assist users in copying entities (Tables, Links, Files, Folders, Projects), and will recursively copy everything in directories. - A Mapping of the old entities to the new entities will be created and all the wikis of each entity will also be copied over and links to synapse Ids will be updated.

Usage

copy(entity, destinationId, skipCopyWikiPage=FALSE, skipCopyAnnotations=FALSE, version=NULL, updateExisting=FALSE, setProvenance=NULL, excludeTypes=NULL)

Arguments

entity

A synapse entity ID

destinationId

Synapse ID of a folder/project that the copied entity is being copied to

skipCopyWikiPage

Skip copying the wiki pages
Default is FALSE.

skipCopyAnnotations

Skips copying the annotations
Default is FALSE.

version

Optional named parameter. (File copy only) Can specify version of a file. Defaults to NULL.

updateExisting

Optional named parameter. (File copy only) When the destination has an entity that has the same name, users can choose to update that entity. It must be the same entity type Defaults to FALSE.

setProvenance

Optional named parameter. (File copy only) Has three values to set the provenance of the copied entity:
traceback: Sets to the source entity
existing: Sets to source entity's original provenance (if it exists)
None: No provenance is set

excludeTypes

Optional named parameter. (Folder/Project copy only) Accepts a list of entity types (file, table, link) which determines which entity types to not copy. Defaults to an empty list.

Value

A mapping between the original and copied entity: 'syn1234':'syn33455'

Examples

  ## Not run: 
    # copying files
    copy(syn, "syn12345", "syn45678", updateExisting=False, setProvenance = "traceback",version = None)
    
    # copying Folders/Projects
    copy(syn, "syn123450", "syn345678", excludeTypes = list("file","table"))
  
## End(Not run)

Sage-Bionetworks/synapserutils documentation built on Aug. 31, 2024, 10:42 a.m.