All Downloads are FREE. Search and download functionalities are using the official Maven repository.

R.Sample-methods.R Maven / Gradle / Ivy


# WARNING: AUTOGENERATED CODE
#
#    This code was generated by a tool.
#    
#    Manual changes to this file may cause unexpected behavior in your application.
#    Manual changes to this file will be overwritten if the code is regenerated.


# ##############################################################################
#' SampleClient methods
#' @include AllClasses.R
#' @include AllGenerics.R
#' @include commons.R

#' @description This function implements the OpenCGA calls for managing Samples.

#' The following table summarises the available *actions* for this client:
#'
#' | endpointName | Endpoint WS | parameters accepted |
#' | -- | :-- | --: |
#' | updateAcl | /{apiVersion}/samples/acl/{members}/update | study, members[*], action[*], body[*] |
#' | loadAnnotationSets | /{apiVersion}/samples/annotationSets/load | study, variableSetId[*], path[*], parents, annotationSetId, body |
#' | create | /{apiVersion}/samples/create | include, exclude, study, includeResult, body[*] |
#' | distinct | /{apiVersion}/samples/distinct | study, id, uuid, somatic, individualId, fileIds, cohortIds, creationDate, modificationDate, internalStatus, status, processingProduct, processingPreparationMethod, processingExtractionMethod, processingLabSampleId, collectionFrom, collectionType, collectionMethod, phenotypes, annotation, acl, internalRgaStatus, release, snapshot, deleted, statsId, statsVariantCount, statsChromosomeCount, statsTypeCount, statsGenotypeCount, statsTiTvRatio, statsQualityAvg, statsQualityStdDev, statsHeterozygosityRate, statsDepthCount, statsBiotypeCount, statsClinicalSignificanceCount, statsConsequenceTypeCount, field[*] |
#' | load | /{apiVersion}/samples/load | study, file[*], variableSet |
#' | search | /{apiVersion}/samples/search | include, exclude, limit, skip, count, includeIndividual, flattenAnnotations, study, id, uuid, somatic, individualId, fileIds, cohortIds, creationDate, modificationDate, internalStatus, status, processingProduct, processingPreparationMethod, processingExtractionMethod, processingLabSampleId, collectionFrom, collectionType, collectionMethod, phenotypes, annotation, acl, internalRgaStatus, release, snapshot, deleted, statsId, statsVariantCount, statsChromosomeCount, statsTypeCount, statsGenotypeCount, statsTiTvRatio, statsQualityAvg, statsQualityStdDev, statsHeterozygosityRate, statsDepthCount, statsBiotypeCount, statsClinicalSignificanceCount, statsConsequenceTypeCount |
#' | acl | /{apiVersion}/samples/{samples}/acl | samples[*], study, member, silent |
#' | delete | /{apiVersion}/samples/{samples}/delete | force, emptyFilesAction, deleteEmptyCohorts, study, samples[*] |
#' | info | /{apiVersion}/samples/{samples}/info | include, exclude, includeIndividual, flattenAnnotations, samples[*], study, version, deleted |
#' | update | /{apiVersion}/samples/{samples}/update | include, exclude, samples[*], study, annotationSetsAction, phenotypesAction, includeResult, body |
#' | updateAnnotationSetsAnnotations | /{apiVersion}/samples/{sample}/annotationSets/{annotationSet}/annotations/update | sample[*], study, annotationSet[*], action, body |
#'
#' @md
#' @seealso \url{http://docs.opencb.org/display/opencga/Using+OpenCGA} and the RESTful API documentation
#' \url{http://bioinfo.hpc.cam.ac.uk/opencga-prod/webservices/}
#' [*]: Required parameter
#' @export

setMethod("sampleClient", "OpencgaR", function(OpencgaR, annotationSet, members, sample, samples, endpointName, params=NULL, ...) {
    switch(endpointName,

        #' @section Endpoint /{apiVersion}/samples/acl/{members}/update:
        #' Update the set of permissions granted for the member.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param members Comma separated list of user or group ids.
        #' @param action Action to be performed [ADD, SET, REMOVE or RESET]. Allowed values: ['SET ADD REMOVE RESET']
        #' @param data JSON containing the parameters to update the permissions. If propagate flag is set to true, it will propagate the permissions defined to the individuals that are associated to the matching samples.
        updateAcl=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=NULL, subcategory="acl",
                subcategoryId=members, action="update", params=params, httpMethod="POST", as.queryParam=c("action"),
                ...),

        #' @section Endpoint /{apiVersion}/samples/annotationSets/load:
        #' Load annotation sets from a TSV file.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param variableSetId Variable set ID or name.
        #' @param path Path where the TSV file is located in OpenCGA or where it should be located.
        #' @param parents Flag indicating whether to create parent directories if they don't exist (only when TSV file was not previously associated).
        #' @param annotationSetId Annotation set id. If not provided, variableSetId will be used.
        #' @param data JSON containing the 'content' of the TSV file if this has not yet been registered into OpenCGA.
        loadAnnotationSets=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=NULL,
                subcategory="annotationSets", subcategoryId=NULL, action="load", params=params, httpMethod="POST",
                as.queryParam=c("variableSetId","path"), ...),

        #' @section Endpoint /{apiVersion}/samples/create:
        #' Create sample.
        #' @param include Fields included in the response, whole JSON path must be provided.
        #' @param exclude Fields excluded in the response, whole JSON path must be provided.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param includeResult Flag indicating to include the created or updated document result in the response.
        #' @param data JSON containing sample information.
        create=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=NULL, subcategory=NULL, subcategoryId=NULL,
                action="create", params=params, httpMethod="POST", as.queryParam=NULL, ...),

        #' @section Endpoint /{apiVersion}/samples/distinct:
        #' Sample distinct method.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param id Comma separated list sample IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.
        #' @param uuid Comma separated list sample UUIDs up to a maximum of 100.
        #' @param somatic Somatic sample.
        #' @param individualId Individual ID or UUID.
        #' @param fileIds Comma separated list of file IDs, paths or UUIDs.
        #' @param cohortIds Comma separated list of cohort IDs.
        #' @param creationDate Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
        #' @param modificationDate Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
        #' @param internalStatus Filter by internal status.
        #' @param status Filter by status.
        #' @param processingProduct Processing product.
        #' @param processingPreparationMethod Processing preparation method.
        #' @param processingExtractionMethod Processing extraction method.
        #' @param processingLabSampleId Processing lab sample id.
        #' @param collectionFrom Collection from.
        #' @param collectionType Collection type.
        #' @param collectionMethod Collection method.
        #' @param phenotypes Comma separated list of phenotype ids or names. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.
        #' @param annotation Annotation filters. Example: age>30;gender=FEMALE. For more information, please visit http://docs.opencb.org/display/opencga/AnnotationSets+1.4.0.
        #' @param acl Filter entries for which a user has the provided permissions. Format: acl={user}:{permissions}. Example: acl=john:WRITE,WRITE_ANNOTATIONS will return all entries for which user john has both WRITE and WRITE_ANNOTATIONS permissions. Only study owners or administrators can query by this field. .
        #' @param internalRgaStatus Index status of the sample for the Recessive Gene Analysis. Allowed values: ['NOT_INDEXED INDEXED INVALID_PERMISSIONS INVALID_METADATA INVALID']
        #' @param release Release when it was created.
        #' @param snapshot Snapshot value (Latest version of the entry in the specified release).
        #' @param deleted Boolean to retrieve deleted entries.
        #' @param statsId Sample variant stats Id. If this field is not provided and the user filters by other stats fields, it will automatically be set to ALL.
        #' @param statsVariantCount Sample variant stats VariantCount.
        #' @param statsChromosomeCount Sample variant stats ChromosomeCount.
        #' @param statsTypeCount Sample variant stats TypeCount.
        #' @param statsGenotypeCount Sample variant stats GenotypeCount.
        #' @param statsTiTvRatio Sample variant stats TiTvRatio.
        #' @param statsQualityAvg Sample variant stats QualityAvg.
        #' @param statsQualityStdDev Sample variant stats QualityStdDev.
        #' @param statsHeterozygosityRate Sample variant stats HeterozygosityRate.
        #' @param statsDepthCount Sample variant stats DepthCount.
        #' @param statsBiotypeCount Sample variant stats BiotypeCount.
        #' @param statsClinicalSignificanceCount Sample variant stats ClinicalSignificanceCount.
        #' @param statsConsequenceTypeCount Sample variant stats ConsequenceTypeCount.
        #' @param field Comma separated list of fields for which to obtain the distinct values.
        distinct=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=NULL, subcategory=NULL,
                subcategoryId=NULL, action="distinct", params=params, httpMethod="GET", as.queryParam=c("field"), ...),

        #' @section Endpoint /{apiVersion}/samples/load:
        #' Load samples from a ped file [EXPERIMENTAL].
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param file file.
        #' @param variableSet variableSet.
        load=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=NULL, subcategory=NULL, subcategoryId=NULL,
                action="load", params=params, httpMethod="GET", as.queryParam=c("file"), ...),

        #' @section Endpoint /{apiVersion}/samples/search:
        #' Sample search method.
        #' @param include Fields included in the response, whole JSON path must be provided.
        #' @param exclude Fields excluded in the response, whole JSON path must be provided.
        #' @param limit Number of results to be returned.
        #' @param skip Number of results to skip.
        #' @param count Get the total number of results matching the query. Deactivated by default.
        #' @param includeIndividual Include Individual object as an attribute.
        #' @param flattenAnnotations Flatten the annotations?.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param id Comma separated list sample IDs up to a maximum of 100. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.
        #' @param uuid Comma separated list sample UUIDs up to a maximum of 100.
        #' @param somatic Somatic sample.
        #' @param individualId Individual ID or UUID.
        #' @param fileIds Comma separated list of file IDs, paths or UUIDs.
        #' @param cohortIds Comma separated list of cohort IDs.
        #' @param creationDate Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
        #' @param modificationDate Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
        #' @param internalStatus Filter by internal status.
        #' @param status Filter by status.
        #' @param processingProduct Processing product.
        #' @param processingPreparationMethod Processing preparation method.
        #' @param processingExtractionMethod Processing extraction method.
        #' @param processingLabSampleId Processing lab sample id.
        #' @param collectionFrom Collection from.
        #' @param collectionType Collection type.
        #' @param collectionMethod Collection method.
        #' @param phenotypes Comma separated list of phenotype ids or names. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search.
        #' @param annotation Annotation filters. Example: age>30;gender=FEMALE. For more information, please visit http://docs.opencb.org/display/opencga/AnnotationSets+1.4.0.
        #' @param acl Filter entries for which a user has the provided permissions. Format: acl={user}:{permissions}. Example: acl=john:WRITE,WRITE_ANNOTATIONS will return all entries for which user john has both WRITE and WRITE_ANNOTATIONS permissions. Only study owners or administrators can query by this field. .
        #' @param internalRgaStatus Index status of the sample for the Recessive Gene Analysis. Allowed values: ['NOT_INDEXED INDEXED INVALID_PERMISSIONS INVALID_METADATA INVALID']
        #' @param release Release when it was created.
        #' @param snapshot Snapshot value (Latest version of the entry in the specified release).
        #' @param deleted Boolean to retrieve deleted entries.
        #' @param statsId Sample variant stats Id. If this field is not provided and the user filters by other stats fields, it will automatically be set to ALL.
        #' @param statsVariantCount Sample variant stats VariantCount.
        #' @param statsChromosomeCount Sample variant stats ChromosomeCount.
        #' @param statsTypeCount Sample variant stats TypeCount.
        #' @param statsGenotypeCount Sample variant stats GenotypeCount.
        #' @param statsTiTvRatio Sample variant stats TiTvRatio.
        #' @param statsQualityAvg Sample variant stats QualityAvg.
        #' @param statsQualityStdDev Sample variant stats QualityStdDev.
        #' @param statsHeterozygosityRate Sample variant stats HeterozygosityRate.
        #' @param statsDepthCount Sample variant stats DepthCount.
        #' @param statsBiotypeCount Sample variant stats BiotypeCount.
        #' @param statsClinicalSignificanceCount Sample variant stats ClinicalSignificanceCount.
        #' @param statsConsequenceTypeCount Sample variant stats ConsequenceTypeCount.
        search=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=NULL, subcategory=NULL, subcategoryId=NULL,
                action="search", params=params, httpMethod="GET", as.queryParam=NULL, ...),

        #' @section Endpoint /{apiVersion}/samples/{samples}/acl:
        #' Returns the acl of the samples. If member is provided, it will only return the acl for the member.
        #' @param samples Comma separated list sample IDs or UUIDs up to a maximum of 100.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param member User or group id.
        #' @param silent Boolean to retrieve all possible entries that are queried for, false to raise an exception whenever one of the entries looked for cannot be shown for whichever reason.
        acl=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=samples, subcategory=NULL, subcategoryId=NULL,
                action="acl", params=params, httpMethod="GET", as.queryParam=NULL, ...),

        #' @section Endpoint /{apiVersion}/samples/{samples}/delete:
        #' Delete samples.
        #' @param force Force the deletion of samples even if they are associated to files, individuals or cohorts.
        #' @param emptyFilesAction Action to be performed over files that were associated only to the sample to be deleted. Possible actions are NONE, TRASH, DELETE.
        #' @param deleteEmptyCohorts Boolean indicating if the cohorts associated only to the sample to be deleted should be also deleted.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param samples Comma separated list sample IDs or UUIDs up to a maximum of 100.
        delete=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=samples, subcategory=NULL,
                subcategoryId=NULL, action="delete", params=params, httpMethod="DELETE", as.queryParam=NULL, ...),

        #' @section Endpoint /{apiVersion}/samples/{samples}/info:
        #' Get sample information.
        #' @param include Fields included in the response, whole JSON path must be provided.
        #' @param exclude Fields excluded in the response, whole JSON path must be provided.
        #' @param includeIndividual Include Individual object as an attribute.
        #' @param flattenAnnotations Flatten the annotations?.
        #' @param samples Comma separated list sample IDs or UUIDs up to a maximum of 100.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param version Comma separated list of sample versions. 'all' to get all the sample versions. Not supported if multiple sample ids are provided.
        #' @param deleted Boolean to retrieve deleted entries.
        info=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=samples, subcategory=NULL,
                subcategoryId=NULL, action="info", params=params, httpMethod="GET", as.queryParam=NULL, ...),

        #' @section Endpoint /{apiVersion}/samples/{samples}/update:
        #' Update some sample attributes.
        #' @param include Fields included in the response, whole JSON path must be provided.
        #' @param exclude Fields excluded in the response, whole JSON path must be provided.
        #' @param samples Comma separated list sample IDs or UUIDs up to a maximum of 100.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param annotationSetsAction Action to be performed if the array of annotationSets is being updated. Allowed values: ['ADD SET REMOVE']
        #' @param phenotypesAction Action to be performed if the array of phenotypes is being updated [SET, ADD, REMOVE]. Allowed values: ['ADD SET REMOVE']
        #' @param includeResult Flag indicating to include the created or updated document result in the response.
        #' @param data body.
        update=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=samples, subcategory=NULL,
                subcategoryId=NULL, action="update", params=params, httpMethod="POST", as.queryParam=NULL, ...),

        #' @section Endpoint /{apiVersion}/samples/{sample}/annotationSets/{annotationSet}/annotations/update:
        #' Update annotations from an annotationSet.
        #' @param sample Sample ID.
        #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID.
        #' @param annotationSet AnnotationSet ID to be updated.
        #' @param action Action to be performed: ADD to add new annotations; REPLACE to replace the value of an already existing annotation; SET to set the new list of annotations removing any possible old annotations; REMOVE to remove some annotations; RESET to set some annotations to the default value configured in the corresponding variables of the VariableSet if any. Allowed values: ['ADD SET REMOVE RESET REPLACE']
        #' @param data Json containing the map of annotations when the action is ADD, SET or REPLACE, a json with only the key 'remove' containing the comma separated variables to be removed as a value when the action is REMOVE or a json with only the key 'reset' containing the comma separated variables that will be set to the default value when the action is RESET.
        updateAnnotationSetsAnnotations=fetchOpenCGA(object=OpencgaR, category="samples", categoryId=sample,
                subcategory="annotationSets", subcategoryId=annotationSet, action="annotations/update", params=params,
                httpMethod="POST", as.queryParam=NULL, ...),
    )
})




© 2015 - 2025 Weber Informatics LLC | Privacy Policy