Skip to contents

Walk a local directory, mirror its folder hierarchy under this container in Synapse, and write a CSV manifest ready for synSyncToSynapse().

The manifest has two columns: path (absolute, symlink-resolved) and parentId (the Synapse ID of the file's containing folder). Existing Synapse folders with matching names and parents are reused. Directory symlinks inside directory_path are not followed; file symlinks record the symlink path and upload the target's contents. Zero-byte files are skipped with a warning — Synapse rejects empty files. I/O errors during walk are logged and skipped; an empty source directory produces a warning and a header-only manifest.

Usage

synGenerateSyncManifest(instance, directory_path, manifest_path, synapse_client=NULL)

Arguments

instance

(Project) The Project instance to operate on.

directory_path

(character) Path to the local directory to be pushed to Synapse.

manifest_path

(character) Path where the generated manifest CSV will be written.

synapse_client

(Optional[Synapse]) If not passed in, the last created instance from the Synapse class constructor will be used.

Value

NULL

Errors

- An error is raised if this container's id is NULL, or if directory_path does not exist or is not a directory, or if this container's id exists in Synapse but is not a Folder or Project.
- An error is also raised if this container's id does not exist in Synapse.

Examples

if (FALSE) { # \dontrun{
## Generate a manifest and upload the files
    # Mirror ./my_data under a Synapse project and then upload it.
    library(synapser)
    synLogin()

    project = Project(id = "syn12345")
    project |> synGenerateSyncManifest(
        directory_path = "./my_data",
        manifest_path = "manifest.csv"
    )
    project |> synSyncToSynapse(manifest_path = "manifest.csv")
} # }