Skip to content

Commit

Permalink
add Rd files
Browse files Browse the repository at this point in the history
  • Loading branch information
kimyen committed Feb 28, 2018
1 parent baf4038 commit 64bee76
Show file tree
Hide file tree
Showing 25 changed files with 1,055 additions and 24 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Expand Up @@ -8,7 +8,7 @@ Maintainer: Kimyen Ladia <kimyen.ladia@sageabse.org>
Description: Provides convenience R functions for interacting with Synapse.
License: Apache License 2.0
Encoding: UTF-8
Depends: synapser (>= 0.1.25)
Depends: synapser (>= 0.2)
Suggests: testthat, knitr, rmarkdown
URL: https://www.sagebase.org
BugReports: https://github.com/Sage-Bionetworks/synapserutils/issues
Expand Down
8 changes: 8 additions & 0 deletions R/shared.R
@@ -0,0 +1,8 @@
.getSynapseUtilsFunctionInfo <- function(rootDir) {
pyImport("synapseutils")
pyExec("info = functionInfo.functionInfo(synapseutils)")
functionInfo <- pyGet("info")
result <- lapply(X = functionInfo, function(x) {
list(name = x$name, synName = x$name, functionContainerName = "synapseutils", args = x$args, doc = x$doc, title = x$name)
})
}
9 changes: 0 additions & 9 deletions R/zzz.R
Expand Up @@ -2,15 +2,6 @@
.defineUtilFunctions()
}

.getSynapseUtilsFunctionInfo <- function(rootDir) {
pyImport("synapseutils")
pyExec("info = functionInfo.functionInfo(synapseutils)")
functionInfo <- pyGet("info")
result <- lapply(X = functionInfo, function(x) {
list(name = x$name, synName = x$name, functionContainerName = "synapseutils", args = x$args, doc = x$doc, title = x$name)
})
}

.defineFunction <- function(synName, pyName, functionContainerName) {
force(synName)
force(pyName)
Expand Down
49 changes: 49 additions & 0 deletions auto-man/changeFileMetaData.Rd
@@ -0,0 +1,49 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{changeFileMetaData}
\alias{changeFileMetaData}
\docType{methods}
\title{
changeFileMetaData
}
\description{

}
\usage{
changeFileMetaData(syn, entity, downloadAs=NA, contentType=NA)
}
\arguments{
\item{syn}{}
\item{entity}{ Synapse entity Id or object}
\item{downloadAs}{ Specify filename to change the filename of a filehandle}
\item{contentType}{ Specify content type to change the content type of a filehandle}
}
\details{
% A detailed if possible precise description of the functionality provided, extending the basic information in the \description slot.
}
\value{
Synapse Entity
}
\references{
% A section with references to the literature. Use \url{} or \href{}{} for web pointers.
}
\note{
% Use this for a special note you want to have pointed out.
}
\seealso{
% Pointers to related R objects, using \code{\link{...}} to refer to them.
}
% Examples of how to use the function.
% Examples are not only useful for documentation purposes, but also provide test code used for diagnostic checking of R code.
% By default, text will be displayed in the output of the help page and run by example() and by R CMD check.
% You can use \dontrun{} for text that should only be shown, but not run, and \dontshow{} for extra commands
% for testing that should not be shown to users, but will be run by example().
\examples{

}



67 changes: 67 additions & 0 deletions auto-man/copy.Rd
@@ -0,0 +1,67 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{copy}
\alias{copy}
\docType{methods}
\title{
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(syn, entity, destinationId, skipCopyWikiPage=FALSE, skipCopyAnnotations=FALSE, version=NULL, updateExisting=NULL, setProvenance=NULL, excludeTypes=NULL)
}
\arguments{
\item{syn}{ A synapse object: syn = synapseclient.login()- Must be logged into synapse}
\item{entity}{ A synapse entity ID}
\item{destinationId}{ Synapse ID of a folder/project that the copied entity is being copied to}
\item{skipCopyWikiPage}{ Skip copying the wiki pages\cr
Default is False}
\item{skipCopyAnnotations}{ Skips copying the annotations\cr
Default is False}
\item{version}{optional named parameter: Can specify version of a file. \cr
Default to None}
\item{updateExisting}{optional named parameter: When the destination has an entity that has the same name, \cr
users can choose to update that entity. \cr
It must be the same entity type\cr
Default to False}
\item{setProvenance}{optional named parameter: Has three values to set the provenance of the copied entity:\cr
traceback: Sets to the source entity\cr
existing: Sets to source entity's original provenance (if it exists)\cr
None: No provenance is set}
\item{excludeTypes}{optional named parameter: Accepts a list of entity types (file, table, link) which determines which entity types to not copy.\cr
Defaults to an empty list.}
}
\details{
% A detailed if possible precise description of the functionality provided, extending the basic information in the \description slot.
}
\value{
a mapping between the original and copied entity: {'syn1234':'syn33455'}
}
\references{
% A section with references to the literature. Use \url{} or \href{}{} for web pointers.
}
\note{
% Use this for a special note you want to have pointed out.
}
\seealso{
% Pointers to related R objects, using \code{\link{...}} to refer to them.
}
% Examples of how to use the function.
% Examples are not only useful for documentation purposes, but also provide test code used for diagnostic checking of R code.
% By default, text will be displayed in the output of the help page and run by example() and by R CMD check.
% You can use \dontrun{} for text that should only be shown, but not run, and \dontshow{} for extra commands
% for testing that should not be shown to users, but will be run by example().
\examples{
}
51 changes: 51 additions & 0 deletions auto-man/copyFileHandles.Rd
@@ -0,0 +1,51 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{copyFileHandles}
\alias{copyFileHandles}
\docType{methods}
\title{
copyFileHandles
}
\description{
Given a list of fileHandle Objects, copy the fileHandles
}
\usage{
copyFileHandles(syn, fileHandles, associateObjectTypes, associateObjectIds, contentTypes, fileNames)
}
\arguments{
\item{syn}{}
\item{fileHandles}{ List of fileHandle Ids or Objects}
\item{associateObjectTypes}{ List of associated object types: FileEntity, TableEntity, WikiAttachment, UserProfileAttachment, MessageAttachment, TeamAttachment, SubmissionAttachment, VerificationSubmission (Must be the same length as fileHandles)}
\item{associateObjectIds}{ List of associated object Ids: If copying a file, the objectId is the synapse id, and if copying a wiki attachment, the object id is the wiki subpage id. (Must be the same length as fileHandles)}
\item{contentTypes}{ List of content types (Can change a filetype of a filehandle).}
\item{fileNames}{ List of filenames (Can change a filename of a filehandle).}
}
\details{
% A detailed if possible precise description of the functionality provided, extending the basic information in the \description slot.
}
\value{
List of batch filehandle copy results, can include failureCodes: UNAUTHORIZED and NOT_FOUND
}
\references{
% A section with references to the literature. Use \url{} or \href{}{} for web pointers.
}
\note{
% Use this for a special note you want to have pointed out.
}
\seealso{
% Pointers to related R objects, using \code{\link{...}} to refer to them.
}
% Examples of how to use the function.
% Examples are not only useful for documentation purposes, but also provide test code used for diagnostic checking of R code.
% By default, text will be displayed in the output of the help page and run by example() and by R CMD check.
% You can use \dontrun{} for text that should only be shown, but not run, and \dontshow{} for extra commands
% for testing that should not be shown to users, but will be run by example().
\examples{

}



60 changes: 60 additions & 0 deletions auto-man/copyWiki.Rd
@@ -0,0 +1,60 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{copyWiki}
\alias{copyWiki}
\docType{methods}
\title{
copyWiki
}
\description{
Copies wikis and updates internal links
}
\usage{
copyWiki(syn, entity, destinationId, entitySubPageId=NA, destinationSubPageId=NA, updateLinks=TRUE, updateSynIds=TRUE, entityMap=NA)
}
\arguments{
\item{syn}{ A synapse object: syn = synapseclient.login()- Must be logged into synapse}
\item{entity}{ A synapse ID of an entity whose wiki you want to copy}
\item{destinationId}{ Synapse ID of a folder/project that the wiki wants to be copied to}
\item{entitySubPageId}{ Can specify subPageId and copy all of its subwikis\cr
Defaults to None, which copies the entire wiki\cr
subPageId can be found: https://www.synapse.org/#!Synapse:syn123/wiki/1234\cr
In this case, 1234 is the subPageId. }
\item{destinationSubPageId}{ Can specify destination subPageId to copy wikis to\cr
Defaults to None}
\item{updateLinks}{ Update all the internal links. (e.g. syn1234/wiki/34345 becomes syn3345/wiki/49508)\cr
Defaults to True}
\item{updateSynIds}{ Update all the synapse ID's referenced in the wikis. (e.g. syn1234 becomes syn2345)\cr
Defaults to True but needs an entityMap}
\item{entityMap}{ An entity map {'oldSynId','newSynId'} to update the synapse IDs referenced in the wiki\cr
Defaults to None }
}
\details{
% A detailed if possible precise description of the functionality provided, extending the basic information in the \description slot.
}
\value{
A list of Objects with three fields: id, title and parentId.
}
\references{
% A section with references to the literature. Use \url{} or \href{}{} for web pointers.
}
\note{
% Use this for a special note you want to have pointed out.
}
\seealso{
% Pointers to related R objects, using \code{\link{...}} to refer to them.
}
% Examples of how to use the function.
% Examples are not only useful for documentation purposes, but also provide test code used for diagnostic checking of R code.
% By default, text will be displayed in the output of the help page and run by example() and by R CMD check.
% You can use \dontrun{} for text that should only be shown, but not run, and \dontshow{} for extra commands
% for testing that should not be shown to users, but will be run by example().
\examples{
}
71 changes: 71 additions & 0 deletions auto-man/notifyMe.Rd
@@ -0,0 +1,71 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{notifyMe}
\alias{notifyMe}
\docType{methods}
\title{
notifyMe
}
\description{
Function decorator that notifies you via email whenever an function completes running or
there is a failure.
}
\usage{
notifyMe(syn, messageSubject=, retries=0)
}
\arguments{
\item{syn}{ A synapse object as obtained with syn = synapseclient.login()}
\item{messageSubject}{ A string with subject line for sent out messages.}
\item{retries}{ Number of retries to attempt on failure (default=0)}
}
\details{
% A detailed if possible precise description of the functionality provided, extending the basic information in the \description slot.
}
\value{

}
\references{
% A section with references to the literature. Use \url{} or \href{}{} for web pointers.
}
\note{
% Use this for a special note you want to have pointed out.
}
\seealso{
% Pointers to related R objects, using \code{\link{...}} to refer to them.
}
% Examples of how to use the function.
% Examples are not only useful for documentation purposes, but also provide test code used for diagnostic checking of R code.
% By default, text will be displayed in the output of the help page and run by example() and by R CMD check.
% You can use \dontrun{} for text that should only be shown, but not run, and \dontshow{} for extra commands
% for testing that should not be shown to users, but will be run by example().
\examples{
%\dontrun{
% # to decorate a function that you define
% from synapseutils import notifyMe
% import synapseclient
% syn = synapseclient.login()
%
% @notifyMe(syn, 'Long running function', retries=2)
% def my_function(x):
% doing_something()
% return long_runtime_func(x)
%
% my_function(123)
%
% #############################
% # to wrap a function that already exists
% from synapseutils import notifyMe
% import synapseclient
% syn = synapseclient.login()
%
% notify_decorator = notifyMe(syn, 'Long running query', retries=2)
% my_query = notify_decorator(syn.tableQuery)
% results = my_query("select id from syn1223")
%}
}



56 changes: 56 additions & 0 deletions auto-man/syncFromSynapse.Rd
@@ -0,0 +1,56 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{syncFromSynapse}
\alias{syncFromSynapse}
\docType{methods}
\title{
syncFromSynapse
}
\description{
Synchronizes all the files in a folder (including subfolders) from Synapse and adds a readme manifest with file metadata.
}
\usage{
syncFromSynapse(syn, entity, path=NULL, ifcollision=overwrite.local, allFiles=NULL, followLink=FALSE)
}
\arguments{
\item{syn}{ A synapse object as obtained with syn = synapseclient.login()}
\item{entity}{ A Synapse ID, a Synapse Entity object of type folder or project.}
\item{path}{ An optional path where the file hierarchy will be\cr
reproduced. If not specified the files will by default\cr
be placed in the synapseCache.}
\item{ifcollision}{ Determines how to handle file collisions.\cr
May be "overwrite.local", "keep.local", or "keep.both".\cr
Defaults to "overwrite.local".}
\item{allFiles}{}
\item{followLink}{ Determines whether the link returns the target Entity.\cr
Defaults to False}
}
\details{
% A detailed if possible precise description of the functionality provided, extending the basic information in the \description slot.
}
\value{
list of entities (files, tables, links)
}
\references{
% A section with references to the literature. Use \url{} or \href{}{} for web pointers.
}
\note{
% Use this for a special note you want to have pointed out.
}
\seealso{
% Pointers to related R objects, using \code{\link{...}} to refer to them.
}
% Examples of how to use the function.
% Examples are not only useful for documentation purposes, but also provide test code used for diagnostic checking of R code.
% By default, text will be displayed in the output of the help page and run by example() and by R CMD check.
% You can use \dontrun{} for text that should only be shown, but not run, and \dontshow{} for extra commands
% for testing that should not be shown to users, but will be run by example().
\examples{

}



0 comments on commit 64bee76

Please sign in to comment.