Skip to content

Commit

Permalink
Merge branch 'develop' into TASK-6013
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Jun 6, 2024
2 parents e9cb0a5 + 83ca8d0 commit 52fa900
Show file tree
Hide file tree
Showing 88 changed files with 162 additions and 2,184 deletions.
13 changes: 13 additions & 0 deletions opencga-app/app/misc/clients/copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2015-2024 OpenCB

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
15 changes: 1 addition & 14 deletions opencga-app/app/misc/clients/java_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,7 @@ def get_imports(self):

headers = []
headers.append('/*')
headers.append('* Copyright 2015-' + str(date.today().year) + ' OpenCB')
headers.append('*')
headers.append('* Licensed under the Apache License, Version 2.0 (the "License");')
headers.append('* you may not use this file except in compliance with the License.')
headers.append('* You may obtain a copy of the License at')
headers.append('*')
headers.append('* http://www.apache.org/licenses/LICENSE-2.0')
headers.append('*')
headers.append('* Unless required by applicable law or agreed to in writing, software')
headers.append('* distributed under the License is distributed on an "AS IS" BASIS,')
headers.append('* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.')
headers.append('* See the License for the specific language governing permissions and')
headers.append('* limitations under the License.')
headers.append(self.get_copyright_message(prefix='* '))
headers.append('*/')
headers.append('')
# We need to calculate the Java package and no use: headers.append('package org.opencb.opencga.client.rest.clients;')
Expand Down Expand Up @@ -99,7 +87,6 @@ def get_class_definition(self, category):
text.append('/**')
text.append(' * This class contains methods for the {} webservices.'.format(
self.categories[self.get_category_name(category)]))
text.append(' *{}Client version: {}'.format(' ' * 4, self.version))
text.append(' *{}PATH: {}'.format(' ' * 4, self.get_category_path(category)))
text.append(' */')
text.append('public class {}Client extends {} {{'.format(self.categories[self.get_category_name(category)], parentClientClass))
Expand Down
12 changes: 2 additions & 10 deletions opencga-app/app/misc/clients/javascript_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,10 @@ def __init__(self, server_url, output_dir):
}

def get_imports(self):
copyright = self.get_copyright_message(prefix=' * ')
auto_msg = "\n * ".join(self.get_autogenerated_message())
return (f'/**\n'
f' * Copyright 2015-2020 OpenCB\n'
f' * Licensed under the Apache License, Version 2.0 (the "License");\n'
f' * you may not use this file except in compliance with the License.\n'
f' * You may obtain a copy of the License at\n'
f' * http://www.apache.org/licenses/LICENSE-2.0\n'
f' * Unless required by applicable law or agreed to in writing, software\n'
f' * distributed under the License is distributed on an "AS IS" BASIS,\n'
f' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n'
f' * See the License for the specific language governing permissions and\n'
f' * limitations under the License.\n'
f'{copyright}\n'
f' * {auto_msg}'
f' \n *\n**/\n\n'
f'import OpenCGAParentClass from "./../opencga-parent-class.js";\n\n')
Expand Down
1 change: 0 additions & 1 deletion opencga-app/app/misc/clients/python_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def get_class_definition(self, category):
text.append('{}"""'.format(' ' * 4))
text.append('{}This class contains methods for the \'{}\' webservices'.format(' ' * 4,
self.get_category_name(category)))
text.append('{}Client version: {}'.format(' ' * 4, self.version))
text.append('{}PATH: {}'.format(' ' * 4, category['path']))
text.append('{}"""'.format(' ' * 4))
text.append('')
Expand Down
1 change: 1 addition & 0 deletions opencga-app/app/misc/clients/r_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def get_class_definition(self, category):
myEndpoint['path'],
", ".join(endpoint_params)))
path_params = set(class_path_params)
path_params = sorted(list(path_params))
text.append("#'\n#' @md")
text.append("#' @seealso \\url{http://docs.opencb.org/display/opencga/Using+OpenCGA} and the RESTful API documentation")
text.append("#' \\url{http://bioinfo.hpc.cam.ac.uk/opencga-prod/webservices/}")
Expand Down
29 changes: 27 additions & 2 deletions opencga-app/app/misc/clients/rest_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,39 @@ def __init__(self, rest_api_file, output_dir):
'Admin': 'Admin'
}

@staticmethod
def get_copyright_message(prefix=""):
# copyright = [
# 'Copyright 2015-2024 OpenCB',
# '',
# 'Licensed under the Apache License, Version 2.0 (the "License");',
# 'you may not use this file except in compliance with the License.',
# 'You may obtain a copy of the License at',
# '',
# ' http://www.apache.org/licenses/LICENSE-2.0',
# '',
# 'Unless required by applicable law or agreed to in writing, software',
# 'distributed under the License is distributed on an "AS IS" BASIS,',
# 'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.',
# 'See the License for the specific language governing permissions and',
# 'limitations under the License.'
# ]
copyright_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'copyright.txt')
print("Reading from file: ", copyright_file)
with open(copyright_file, 'r') as file:
copyright = file.read().splitlines()
## Add prefix to each line
if prefix:
for line in range(len(copyright)):
copyright[line] = (prefix + copyright[line]).rstrip()
return "\n".join(copyright)

@staticmethod
def get_autogenerated_message():
date_ = datetime.now().strftime("%Y-%m-%d")
return [
'WARNING: AUTOGENERATED CODE',
'',
'This code was generated by a tool.',
'Autogenerated on: ' + date_,
'',
'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.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
* Copyright 2015-2024-05-24 OpenCB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.opencb.opencga.app.cli.main;

import org.jline.reader.Candidate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
* Copyright 2015-2024-05-24 OpenCB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.opencb.opencga.app.cli.main;

import com.beust.jcommander.JCommander;
Expand Down
1 change: 0 additions & 1 deletion opencga-client/src/main/R/R/Admin-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down
1 change: 0 additions & 1 deletion opencga-client/src/main/R/R/Alignment-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down
20 changes: 10 additions & 10 deletions opencga-client/src/main/R/R/AllGenerics.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# ##############################################################################
## OrganizationClient
setGeneric("organizationClient", function(OpencgaR, id, user, organization, endpointName, params=NULL, ...)
setGeneric("organizationClient", function(OpencgaR, id, organization, user, endpointName, params=NULL, ...)
standardGeneric("organizationClient"))

# ##############################################################################
## UserClient
setGeneric("userClient", function(OpencgaR, users, user, filterId, endpointName, params=NULL, ...)
setGeneric("userClient", function(OpencgaR, filterId, user, users, endpointName, params=NULL, ...)
standardGeneric("userClient"))

# ##############################################################################
## ProjectClient
setGeneric("projectClient", function(OpencgaR, projects, project, endpointName, params=NULL, ...)
setGeneric("projectClient", function(OpencgaR, project, projects, endpointName, params=NULL, ...)
standardGeneric("projectClient"))

# ##############################################################################
## StudyClient
setGeneric("studyClient", function(OpencgaR, id, studies, members, study, variableSet, group, templateId, endpointName, params=NULL, ...)
setGeneric("studyClient", function(OpencgaR, group, id, members, studies, study, templateId, variableSet, endpointName, params=NULL, ...)
standardGeneric("studyClient"))

# ##############################################################################
## FileClient
setGeneric("fileClient", function(OpencgaR, annotationSet, members, folder, file, files, endpointName, params=NULL, ...)
setGeneric("fileClient", function(OpencgaR, annotationSet, file, files, folder, members, endpointName, params=NULL, ...)
standardGeneric("fileClient"))

# ##############################################################################
Expand All @@ -30,12 +30,12 @@ setGeneric("jobClient", function(OpencgaR, job, jobs, members, endpointName, par

# ##############################################################################
## SampleClient
setGeneric("sampleClient", function(OpencgaR, annotationSet, samples, members, sample, endpointName, params=NULL, ...)
setGeneric("sampleClient", function(OpencgaR, annotationSet, members, sample, samples, endpointName, params=NULL, ...)
standardGeneric("sampleClient"))

# ##############################################################################
## IndividualClient
setGeneric("individualClient", function(OpencgaR, annotationSet, individuals, individual, members, endpointName, params=NULL, ...)
setGeneric("individualClient", function(OpencgaR, annotationSet, individual, individuals, members, endpointName, params=NULL, ...)
standardGeneric("individualClient"))

# ##############################################################################
Expand All @@ -45,12 +45,12 @@ setGeneric("familyClient", function(OpencgaR, annotationSet, families, family, m

# ##############################################################################
## CohortClient
setGeneric("cohortClient", function(OpencgaR, cohorts, annotationSet, cohort, members, endpointName, params=NULL, ...)
setGeneric("cohortClient", function(OpencgaR, annotationSet, cohort, cohorts, members, endpointName, params=NULL, ...)
standardGeneric("cohortClient"))

# ##############################################################################
## PanelClient
setGeneric("panelClient", function(OpencgaR, panels, members, endpointName, params=NULL, ...)
setGeneric("panelClient", function(OpencgaR, members, panels, endpointName, params=NULL, ...)
standardGeneric("panelClient"))

# ##############################################################################
Expand All @@ -65,7 +65,7 @@ setGeneric("variantClient", function(OpencgaR, endpointName, params=NULL, ...)

# ##############################################################################
## ClinicalClient
setGeneric("clinicalClient", function(OpencgaR, interpretation, interpretations, annotationSet, members, clinicalAnalysis, clinicalAnalyses, endpointName, params=NULL, ...)
setGeneric("clinicalClient", function(OpencgaR, annotationSet, clinicalAnalyses, clinicalAnalysis, interpretation, interpretations, members, endpointName, params=NULL, ...)
standardGeneric("clinicalClient"))

# ##############################################################################
Expand Down
3 changes: 1 addition & 2 deletions opencga-client/src/main/R/R/Clinical-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down Expand Up @@ -62,7 +61,7 @@
#' [*]: Required parameter
#' @export

setMethod("clinicalClient", "OpencgaR", function(OpencgaR, interpretation, interpretations, annotationSet, members, clinicalAnalysis, clinicalAnalyses, endpointName, params=NULL, ...) {
setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinicalAnalyses, clinicalAnalysis, interpretation, interpretations, members, endpointName, params=NULL, ...) {
switch(endpointName,

#' @section Endpoint /{apiVersion}/analysis/clinical/acl/{members}/update:
Expand Down
3 changes: 1 addition & 2 deletions opencga-client/src/main/R/R/Cohort-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down Expand Up @@ -38,7 +37,7 @@
#' [*]: Required parameter
#' @export

setMethod("cohortClient", "OpencgaR", function(OpencgaR, cohorts, annotationSet, cohort, members, endpointName, params=NULL, ...) {
setMethod("cohortClient", "OpencgaR", function(OpencgaR, annotationSet, cohort, cohorts, members, endpointName, params=NULL, ...) {
switch(endpointName,

#' @section Endpoint /{apiVersion}/cohorts/acl/{members}/update:
Expand Down
1 change: 0 additions & 1 deletion opencga-client/src/main/R/R/Family-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down
3 changes: 1 addition & 2 deletions opencga-client/src/main/R/R/File-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down Expand Up @@ -54,7 +53,7 @@
#' [*]: Required parameter
#' @export

setMethod("fileClient", "OpencgaR", function(OpencgaR, annotationSet, members, folder, file, files, endpointName, params=NULL, ...) {
setMethod("fileClient", "OpencgaR", function(OpencgaR, annotationSet, file, files, folder, members, endpointName, params=NULL, ...) {
switch(endpointName,

#' @section Endpoint /{apiVersion}/files/acl/{members}/update:
Expand Down
1 change: 0 additions & 1 deletion opencga-client/src/main/R/R/GA4GH-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down
3 changes: 1 addition & 2 deletions opencga-client/src/main/R/R/Individual-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down Expand Up @@ -38,7 +37,7 @@
#' [*]: Required parameter
#' @export

setMethod("individualClient", "OpencgaR", function(OpencgaR, annotationSet, individuals, individual, members, endpointName, params=NULL, ...) {
setMethod("individualClient", "OpencgaR", function(OpencgaR, annotationSet, individual, individuals, members, endpointName, params=NULL, ...) {
switch(endpointName,

#' @section Endpoint /{apiVersion}/individuals/acl/{members}/update:
Expand Down
1 change: 0 additions & 1 deletion opencga-client/src/main/R/R/Job-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down
1 change: 0 additions & 1 deletion opencga-client/src/main/R/R/Meta-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down
1 change: 0 additions & 1 deletion opencga-client/src/main/R/R/Operation-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down
3 changes: 1 addition & 2 deletions opencga-client/src/main/R/R/Organization-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down Expand Up @@ -36,7 +35,7 @@
#' [*]: Required parameter
#' @export

setMethod("organizationClient", "OpencgaR", function(OpencgaR, id, user, organization, endpointName, params=NULL, ...) {
setMethod("organizationClient", "OpencgaR", function(OpencgaR, id, organization, user, endpointName, params=NULL, ...) {
switch(endpointName,

#' @section Endpoint /{apiVersion}/organizations/create:
Expand Down
3 changes: 1 addition & 2 deletions opencga-client/src/main/R/R/Panel-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# WARNING: AUTOGENERATED CODE
#
# This code was generated by a tool.
# Autogenerated on: 2024-05-24
#
# 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.
Expand Down Expand Up @@ -36,7 +35,7 @@
#' [*]: Required parameter
#' @export

setMethod("panelClient", "OpencgaR", function(OpencgaR, panels, members, endpointName, params=NULL, ...) {
setMethod("panelClient", "OpencgaR", function(OpencgaR, members, panels, endpointName, params=NULL, ...) {
switch(endpointName,

#' @section Endpoint /{apiVersion}/panels/acl/{members}/update:
Expand Down
Loading

0 comments on commit 52fa900

Please sign in to comment.