Skip to content

Commit

Permalink
Merge branch 'release-2.2.x' into issue-411
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioaltamura committed Mar 29, 2022
2 parents 1468749 + 377f474 commit a7c9495
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/webcomponents/commons/opencga-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,20 @@ export default class OpencgaExport extends LitElement {
"COHORT": "cohorts",
"FAMILY": "families",
"CLINICAL_ANALYSIS": "clinical",
"JOB": "jobs"
"JOB": "jobs",
"DISEASE_PANEL": "panels"
};
this.rClients = {
"VARIANT": "variantClient",
"CLINICAL_VARIANT": "variantClient",
"FILE": "fileClient",
"SAMPLE": "sampleClient",
"INDIVIDUAL": "individualClient",
"COHORT": "cohortClient",
"FAMILY": "familyClient",
"CLINICAL_ANALYSIS": "clinicalAnalysisClient",
"JOB": "jobClient",
"DISEASE_PANEL": "panelClient"
};

this.mode = "sync";
Expand Down Expand Up @@ -221,22 +234,11 @@ export default class OpencgaExport extends LitElement {

generateR() {
const q = {...this.query, study: this.opencgaSession.study.fqn, limit: this.limit};
const clientsName = {
"VARIANT": "variantClient",
"CLINICAL_VARIANT": "variantClient",
"FILE": "fileClient",
"SAMPLE": "sampleClient",
"INDIVIDUAL": "individualClient",
"COHORT": "cohortClient",
"FAMILY": "familyClient",
"CLINICAL_ANALYSIS": "clinicalAnalysisClient",
"JOB": "jobClient"
};
const str = `library(opencgaR)
con <- initOpencgaR(host = "${this.opencgaSession.server.host}", version = "v2")
con <- opencgaLogin(opencga = con, userid = "", passwd = "")
${this.resourceMap[this.config.resource]} = \
${clientsName[this.config.resource]}(OpencgaR = con, endpointName = "${this.toCamelCase(this.method)}", params = list(${Object.entries(q).map(([k, v]) => `${k}='${v}'`).join(", ")}, include="id"))`;
${this.rClients[this.config.resource]}(OpencgaR = con, endpointName = "${this.toCamelCase(this.method)}", params = list(${Object.entries(q).map(([k, v]) => `${k}='${v}'`).join(", ")}, include="id"))`;
return this.lineSplitter(str);
}

Expand Down

0 comments on commit a7c9495

Please sign in to comment.