From e5d63a044dc0802a279c512d75fc5389c71675d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Tue, 21 Nov 2023 10:27:41 +0100 Subject: [PATCH 1/6] analysis: add the parameter haploid-call-mode to run the command PLINK/IBD in the analyses family-qc and relatedness, #TASK-5282, #TASK-5278 --- .../analysis/family/qc/FamilyQcAnalysis.java | 28 ++++++++++++++++++- .../qc/FamilyQcLocalAnalysisExecutor.java | 2 +- .../analysis/family/qc/IBDComputation.java | 18 ++++++------ .../IBDRelatednessLocalAnalysisExecutor.java | 5 ++-- .../relatedness/RelatednessAnalysis.java | 28 +++++++++++++++++++ .../VariantInternalCommandExecutor.java | 2 ++ .../options/VariantCommandOptions.java | 9 ++++++ .../variant/FamilyQcAnalysisParams.java | 14 +++++++++- .../variant/RelatednessAnalysisParams.java | 27 +++++++++++++++++- .../variant/FamilyQcAnalysisExecutor.java | 10 +++++++ .../IBDRelatednessAnalysisExecutor.java | 11 +++++++- 11 files changed, 137 insertions(+), 17 deletions(-) diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcAnalysis.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcAnalysis.java index 3c624aec0c2..29b9ddc1407 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcAnalysis.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcAnalysis.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import org.apache.commons.lang3.StringUtils; +import org.opencb.biodata.models.clinical.qc.RelatednessReport; import org.opencb.commons.datastore.core.QueryOptions; import org.opencb.opencga.analysis.AnalysisUtils; import org.opencb.opencga.analysis.individual.qc.IndividualQcAnalysis; @@ -48,7 +49,7 @@ public class FamilyQcAnalysis extends OpenCgaTool { public static final String ID = "family-qc"; public static final String DESCRIPTION = "Run quality control (QC) for a given family. It computes the relatedness scores among the" - + " family members"; + + " family members"; public static final String RELATEDNESS_STEP = "relatedness"; @@ -56,6 +57,7 @@ public class FamilyQcAnalysis extends OpenCgaTool { private String familyId; private String relatednessMethod; private String relatednessMaf; + private String haploidCallMode; private Map> relatednessThresholds; private Family family; @@ -95,6 +97,20 @@ protected void check() throws Exception { if (StringUtils.isEmpty(relatednessMaf)) { relatednessMaf = RelatednessAnalysis.MAF_DEFAULT_VALUE; } + if (StringUtils.isEmpty(haploidCallMode)) { + haploidCallMode = RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE; + } else { + switch (haploidCallMode) { + case RelatednessReport.HAPLOID_CALL_MODE_HAPLOID_VALUE: + case RelatednessReport.HAPLOID_CALL_MODE_MISSING_VALUE: + case RelatednessReport.HAPLOID_CALL_MODE_REF_VALUE: + break; + default: + throw new ToolException("Invalid haploid call value '" + haploidCallMode + "', accepted values are: " + + RelatednessReport.HAPLOID_CALL_MODE_HAPLOID_VALUE + ", " + RelatednessReport.HAPLOID_CALL_MODE_MISSING_VALUE + + " and " + RelatednessReport.HAPLOID_CALL_MODE_REF_VALUE); + } + } Path thresholdsPath = getOpencgaHome().resolve("analysis").resolve(FamilyQcAnalysis.ID).resolve("relatedness_thresholds.csv"); relatednessThresholds = AnalysisUtils.parseRelatednessThresholds(thresholdsPath); @@ -121,6 +137,7 @@ protected void run() throws ToolException { .setFamily(family) .setRelatednessMethod(relatednessMethod) .setRelatednessMaf(relatednessMaf) + .setHaploidCallMode(haploidCallMode) .setRelatednessThresholds(relatednessThresholds) .setRelatednesResourcePath(getOpencgaHome().resolve("analysis/resources").resolve(RelatednessAnalysis.ID)) .setQualityControl(qualityControl); @@ -176,6 +193,15 @@ public FamilyQcAnalysis setRelatednessMaf(String relatednessMaf) { return this; } + public String getHaploidCallMode() { + return haploidCallMode; + } + + public FamilyQcAnalysis setHaploidCallMode(String haploidCallMode) { + this.haploidCallMode = haploidCallMode; + return this; + } + public Family getFamily() { return family; } diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java index ff0316f42de..1494dab5e2f 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java @@ -113,7 +113,7 @@ private void runRelatedness() throws ToolException { // Run IBD/IBS computation using PLINK in docker RelatednessReport report = IBDComputation.compute(getStudyId(), getFamily(), sampleIds, getRelatednessMaf(), - getRelatednessThresholds(), getRelatednesResourcePath(), getOutDir(), getVariantStorageManager(), getToken()); + getHaploidCallMode(), getRelatednessThresholds(), getRelatednesResourcePath(), getOutDir(), getVariantStorageManager(), getToken()); // Sanity check if (report == null) { diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java index 4ae4a565214..5cedd0ac4fb 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java @@ -16,12 +16,10 @@ package org.opencb.opencga.analysis.family.qc; -import com.fasterxml.jackson.core.JsonProcessingException; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; -import org.apache.commons.math3.ode.nonstiff.RungeKuttaFieldIntegrator; import org.opencb.biodata.models.clinical.qc.RelatednessReport; import org.opencb.biodata.models.clinical.qc.RelatednessScore; import org.opencb.biodata.models.variant.avro.VariantType; @@ -34,19 +32,16 @@ import org.opencb.opencga.analysis.variant.relatedness.RelatednessAnalysis; import org.opencb.opencga.analysis.wrappers.plink.PlinkWrapperAnalysisExecutor; import org.opencb.opencga.catalog.exceptions.CatalogException; -import org.opencb.opencga.core.common.JacksonUtils; import org.opencb.opencga.core.exceptions.ToolException; import org.opencb.opencga.core.models.family.Family; import org.opencb.opencga.core.models.individual.Individual; import org.opencb.opencga.core.models.sample.Sample; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; import org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam; -import org.opencb.opencga.storage.core.variant.query.VariantQueryUtils; import java.io.*; import java.net.URL; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.*; import java.util.stream.Collectors; @@ -59,7 +54,7 @@ public class IBDComputation { private static final String FREQ_FILENAME = BASENAME + ".frq"; private static final String PRUNE_IN_FILENAME = BASENAME + ".prune.in"; - public static RelatednessReport compute(String study, Family family, List samples, String maf, + public static RelatednessReport compute(String study, Family family, List samples, String maf, String haploidCallMode, Map> thresholds, Path resourcesPath, Path outDir, VariantStorageManager storageManager, String token) throws ToolException { // Check resource (variants.frq and variants.prune.in) and download if necessary @@ -122,7 +117,7 @@ public static RelatednessReport compute(String study, Family family, List> inputBindings = new ArrayList<>(); inputBindings.add(new AbstractMap.SimpleEntry<>(freqPath.getParent().toString(), "/input")); @@ -313,7 +309,11 @@ private static File runIBD(String basename, Path freqPath, Path outDir) throws T "/output"); // Run IBD using PLINK in docker - String plinkParams = "plink1.9 --tfile /output/" + basename + " --genome rel-check --read-freq /input/" + FREQ_FILENAME + String plinkParams = "plink1.9" + + " --tfile /output/" + basename + + " --genome rel-check" + + " --vcf-half-call " + haploidCallMode + + " --read-freq /input/" + FREQ_FILENAME + " --out /output/" + basename; try { PlinkWrapperAnalysisExecutor plinkExecutor = new PlinkWrapperAnalysisExecutor(); diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/IBDRelatednessLocalAnalysisExecutor.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/IBDRelatednessLocalAnalysisExecutor.java index 59ebe1467c2..3ec4cbbb17a 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/IBDRelatednessLocalAnalysisExecutor.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/IBDRelatednessLocalAnalysisExecutor.java @@ -20,7 +20,6 @@ import org.opencb.opencga.analysis.StorageToolExecutor; import org.opencb.opencga.analysis.family.qc.IBDComputation; import org.opencb.opencga.analysis.variant.manager.VariantStorageManager; -import org.opencb.opencga.catalog.managers.CatalogManager; import org.opencb.opencga.core.common.JacksonUtils; import org.opencb.opencga.core.exceptions.ToolException; import org.opencb.opencga.core.tools.annotations.ToolExecutor; @@ -45,8 +44,8 @@ public void run() throws ToolException { } // Run IBD/IBS computation using PLINK in docker - RelatednessReport report = IBDComputation.compute(getStudyId(), getFamily(), getSampleIds(), getMinorAlleleFreq(), getThresholds(), - getResourcePath(), getOutDir(), variantStorageManager, getToken()); + RelatednessReport report = IBDComputation.compute(getStudyId(), getFamily(), getSampleIds(), getMinorAlleleFreq(), + getHaploidCallMode(), getThresholds(), getResourcePath(), getOutDir(), variantStorageManager, getToken()); // Sanity check if (report == null) { diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/RelatednessAnalysis.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/RelatednessAnalysis.java index ee410da895c..9823bfa4717 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/RelatednessAnalysis.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/RelatednessAnalysis.java @@ -18,6 +18,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.opencb.biodata.models.clinical.qc.RelatednessReport; import org.opencb.commons.utils.FileUtils; import org.opencb.opencga.analysis.AnalysisUtils; import org.opencb.opencga.analysis.family.qc.FamilyQcAnalysis; @@ -55,6 +56,7 @@ public class RelatednessAnalysis extends OpenCgaTool { private List sampleIds; private String method; private String minorAlleleFreq; + private String haploidCallMode; private Map> thresholds; private Family family; @@ -117,6 +119,15 @@ public RelatednessAnalysis setMinorAlleleFreq(String maf) { return this; } + public String getHaploidCallMode() { + return haploidCallMode; + } + + public RelatednessAnalysis setHaploidCallMode(String haploidCallMode) { + this.haploidCallMode = haploidCallMode; + return this; + } + @Override protected void check() throws Exception { super.check(); @@ -163,6 +174,22 @@ protected void check() throws Exception { minorAlleleFreq = MAF_DEFAULT_VALUE; } + // Check haploid call mode + if (StringUtils.isEmpty(haploidCallMode)) { + haploidCallMode = RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE; + } else { + switch (haploidCallMode) { + case RelatednessReport.HAPLOID_CALL_MODE_HAPLOID_VALUE: + case RelatednessReport.HAPLOID_CALL_MODE_MISSING_VALUE: + case RelatednessReport.HAPLOID_CALL_MODE_REF_VALUE: + break; + default: + throw new ToolException("Invalid haploid call value '" + haploidCallMode + "', accepted values are: " + + RelatednessReport.HAPLOID_CALL_MODE_HAPLOID_VALUE + ", " + RelatednessReport.HAPLOID_CALL_MODE_MISSING_VALUE + + " and " + RelatednessReport.HAPLOID_CALL_MODE_REF_VALUE); + } + } + Path thresholdsPath = getOpencgaHome().resolve("analysis").resolve(FamilyQcAnalysis.ID).resolve("relatedness_thresholds.csv"); thresholds = AnalysisUtils.parseRelatednessThresholds(thresholdsPath); } @@ -177,6 +204,7 @@ protected void run() throws ToolException { .setFamily(family) .setSampleIds(sampleIds) .setMinorAlleleFreq(minorAlleleFreq) + .setHaploidCallMode(haploidCallMode) .setThresholds(thresholds) .setResourcePath(getOpencgaHome().resolve("analysis/resources").resolve(ID)) .execute(); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java index 7d3f514a745..284fdb4a538 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java @@ -902,6 +902,7 @@ private void relatedness() throws Exception { .setIndividualIds(cliOptions.individuals) .setSampleIds(cliOptions.samples) .setMinorAlleleFreq(cliOptions.minorAlleleFreq) + .setHaploidCallMode(cliOptions.haploidCallMode) .setMethod(cliOptions.method) .start(); } @@ -918,6 +919,7 @@ private void familyQc() throws Exception { .setFamilyId(cliOptions.family) .setRelatednessMethod(cliOptions.relatednessMethod) .setRelatednessMaf(cliOptions.relatednessMaf) + .setHaploidCallMode(cliOptions.haploidCallMode) .start(); } diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java index bad1beff087..9a5d0ecced0 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java @@ -17,6 +17,7 @@ package org.opencb.opencga.app.cli.internal.options; import com.beust.jcommander.*; +import org.opencb.biodata.models.clinical.qc.RelatednessReport; import org.opencb.biodata.models.variant.metadata.Aggregation; import org.opencb.opencga.analysis.family.qc.FamilyQcAnalysis; import org.opencb.opencga.analysis.individual.qc.IndividualQcAnalysis; @@ -1559,6 +1560,10 @@ public class RelatednessCommandOptions { + " 1kg_phase3:CEU<0.35, cohort:ALL<0.4") public String minorAlleleFreq; + @Parameter(names = {"--haploid-call-mode"}, description = org.opencb.biodata.models.constants.FieldConstants + .RELATEDNESS_REPORT_HAPLOID_CALL_MODE_DESCRIPTION) + public String haploidCallMode = RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE; + @Parameter(names = {"--method"}, description = "Method to compute relatedness.") public String method = "IBD"; @@ -1589,6 +1594,10 @@ public class FamilyQcCommandOptions { + " cohort:ALL>0.05") public String relatednessMaf = "cohort:ALL>0.05"; + @Parameter(names = {"--haploid-call-mode"}, description = org.opencb.biodata.models.constants.FieldConstants + .RELATEDNESS_REPORT_HAPLOID_CALL_MODE_DESCRIPTION) + public String haploidCallMode = RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE; + @Parameter(names = {"-o", "--outdir"}, description = "Output directory.") public String outdir; } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/FamilyQcAnalysisParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/FamilyQcAnalysisParams.java index 4dcbb52fbea..fe92ff6fa58 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/FamilyQcAnalysisParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/FamilyQcAnalysisParams.java @@ -26,16 +26,18 @@ public class FamilyQcAnalysisParams extends ToolParams { private String family; private String relatednessMethod; private String relatednessMaf; + private String haploidCallMode; private String outdir; public FamilyQcAnalysisParams() { } - public FamilyQcAnalysisParams(String family, String relatednessMethod, String relatednessMaf, String outdir) { + public FamilyQcAnalysisParams(String family, String relatednessMethod, String relatednessMaf, String haploidCallMode, String outdir) { this.family = family; this.relatednessMethod = relatednessMethod; this.relatednessMaf = relatednessMaf; + this.haploidCallMode = haploidCallMode; this.outdir = outdir; } @@ -45,6 +47,7 @@ public String toString() { sb.append("family='").append(family).append('\''); sb.append(", relatednessMethod='").append(relatednessMethod).append('\''); sb.append(", relatednessMaf='").append(relatednessMaf).append('\''); + sb.append(", haploidCallMode='").append(haploidCallMode).append('\''); sb.append(", outdir='").append(outdir).append('\''); sb.append('}'); return sb.toString(); @@ -77,6 +80,15 @@ public FamilyQcAnalysisParams setRelatednessMaf(String relatednessMaf) { return this; } + public String getHaploidCallMode() { + return haploidCallMode; + } + + public FamilyQcAnalysisParams setHaploidCallMode(String haploidCallMode) { + this.haploidCallMode = haploidCallMode; + return this; + } + public String getOutdir() { return outdir; } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java index 7bb1f0ca0e7..90ae04384b1 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java @@ -25,20 +25,36 @@ public class RelatednessAnalysisParams extends ToolParams { private List individuals; private List samples; private String minorAlleleFreq; + private String haploidCallMode; private String method; private String outdir; public RelatednessAnalysisParams() { } - public RelatednessAnalysisParams(List individuals, List samples, String minorAlleleFreq, String method, String outdir) { + public RelatednessAnalysisParams(List individuals, List samples, String minorAlleleFreq, String haploidCallMode, + String method, String outdir) { this.individuals = individuals; this.samples = samples; this.minorAlleleFreq = minorAlleleFreq; + this.haploidCallMode = haploidCallMode; this.method = method; this.outdir = outdir; } + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("RelatednessAnalysisParams{"); + sb.append("individuals=").append(individuals); + sb.append(", samples=").append(samples); + sb.append(", minorAlleleFreq='").append(minorAlleleFreq).append('\''); + sb.append(", haploidCallMode='").append(haploidCallMode).append('\''); + sb.append(", method='").append(method).append('\''); + sb.append(", outdir='").append(outdir).append('\''); + sb.append('}'); + return sb.toString(); + } + public List getIndividuals() { return individuals; } @@ -66,6 +82,15 @@ public RelatednessAnalysisParams setMinorAlleleFreq(String minorAlleleFreq) { return this; } + public String getHaploidCallMode() { + return haploidCallMode; + } + + public RelatednessAnalysisParams setHaploidCallMode(String haploidCallMode) { + this.haploidCallMode = haploidCallMode; + return this; + } + public String getMethod() { return method; } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java b/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java index e8e634317fa..0383de0156c 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java @@ -33,6 +33,7 @@ public enum QcType { protected Family family; protected String relatednessMethod; protected String relatednessMaf; + protected String haploidCallMode; protected Map> relatednessThresholds; protected Path relatednessResourcePath; @@ -79,6 +80,15 @@ public FamilyQcAnalysisExecutor setRelatednessMaf(String relatednessMaf) { return this; } + public String getHaploidCallMode() { + return haploidCallMode; + } + + public FamilyQcAnalysisExecutor setHaploidCallMode(String haploidCallMode) { + this.haploidCallMode = haploidCallMode; + return this; + } + public Map> getRelatednessThresholds() { return relatednessThresholds; } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/IBDRelatednessAnalysisExecutor.java b/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/IBDRelatednessAnalysisExecutor.java index 407f2cc704a..6d8cf481423 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/IBDRelatednessAnalysisExecutor.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/IBDRelatednessAnalysisExecutor.java @@ -17,7 +17,6 @@ package org.opencb.opencga.core.tools.variant; import org.opencb.opencga.core.models.family.Family; -import org.opencb.opencga.core.models.individual.Individual; import org.opencb.opencga.core.tools.OpenCgaToolExecutor; import java.nio.file.Path; @@ -30,6 +29,7 @@ public abstract class IBDRelatednessAnalysisExecutor extends OpenCgaToolExecutor private Family family; private List sampleIds; private String minorAlleleFreq; + private String haploidCallMode; private Map> thresholds; private Path resourcePath; @@ -72,6 +72,15 @@ public IBDRelatednessAnalysisExecutor setMinorAlleleFreq(String minorAlleleFreq) return this; } + public String getHaploidCallMode() { + return haploidCallMode; + } + + public IBDRelatednessAnalysisExecutor setHaploidCallMode(String haploidCallMode) { + this.haploidCallMode = haploidCallMode; + return this; + } + public Map> getThresholds() { return thresholds; } From 6784f73d17dbd7e10546236ce9eafe6af0cc42f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Tue, 21 Nov 2023 10:58:53 +0100 Subject: [PATCH 2/6] analysis: remove the parameter relatedness-method and generate clients, #TASK-5282, #TASK-5278 --- .../app/cli/main/OpenCgaCompleter.java | 2 +- .../app/cli/main/OpencgaCliOptionsParser.java | 2 +- .../AnalysisVariantCommandExecutor.java | 4 +-- .../AnalysisVariantCommandOptions.java | 24 +++++++------- opencga-client/src/main/R/R/Admin-methods.R | 2 +- .../src/main/R/R/Alignment-methods.R | 2 +- opencga-client/src/main/R/R/AllGenerics.R | 22 ++++++------- .../src/main/R/R/Clinical-methods.R | 4 +-- opencga-client/src/main/R/R/Cohort-methods.R | 4 +-- opencga-client/src/main/R/R/Family-methods.R | 4 +-- opencga-client/src/main/R/R/File-methods.R | 4 +-- opencga-client/src/main/R/R/GA4GH-methods.R | 2 +- .../src/main/R/R/Individual-methods.R | 4 +-- opencga-client/src/main/R/R/Job-methods.R | 4 +-- opencga-client/src/main/R/R/Meta-methods.R | 2 +- .../src/main/R/R/Operation-methods.R | 2 +- opencga-client/src/main/R/R/Panel-methods.R | 4 +-- opencga-client/src/main/R/R/Project-methods.R | 4 +-- opencga-client/src/main/R/R/Sample-methods.R | 4 +-- opencga-client/src/main/R/R/Study-methods.R | 4 +-- opencga-client/src/main/R/R/User-methods.R | 4 +-- opencga-client/src/main/R/R/Variant-methods.R | 6 ++-- .../client/rest/clients/AdminClient.java | 4 +-- .../client/rest/clients/AlignmentClient.java | 4 +-- .../rest/clients/ClinicalAnalysisClient.java | 4 +-- .../client/rest/clients/CohortClient.java | 4 +-- .../rest/clients/DiseasePanelClient.java | 4 +-- .../client/rest/clients/FamilyClient.java | 4 +-- .../client/rest/clients/FileClient.java | 4 +-- .../client/rest/clients/GA4GHClient.java | 4 +-- .../client/rest/clients/IndividualClient.java | 4 +-- .../client/rest/clients/JobClient.java | 4 +-- .../client/rest/clients/MetaClient.java | 4 +-- .../client/rest/clients/ProjectClient.java | 4 +-- .../client/rest/clients/SampleClient.java | 4 +-- .../client/rest/clients/StudyClient.java | 4 +-- .../client/rest/clients/UserClient.java | 4 +-- .../client/rest/clients/VariantClient.java | 10 +++--- .../rest/clients/VariantOperationClient.java | 4 +-- opencga-client/src/main/javascript/Admin.js | 2 +- .../src/main/javascript/Alignment.js | 2 +- .../src/main/javascript/ClinicalAnalysis.js | 2 +- opencga-client/src/main/javascript/Cohort.js | 2 +- .../src/main/javascript/DiseasePanel.js | 2 +- opencga-client/src/main/javascript/Family.js | 2 +- opencga-client/src/main/javascript/File.js | 2 +- opencga-client/src/main/javascript/GA4GH.js | 2 +- .../src/main/javascript/Individual.js | 2 +- opencga-client/src/main/javascript/Job.js | 2 +- opencga-client/src/main/javascript/Meta.js | 2 +- opencga-client/src/main/javascript/Project.js | 2 +- opencga-client/src/main/javascript/Sample.js | 2 +- opencga-client/src/main/javascript/Study.js | 2 +- opencga-client/src/main/javascript/User.js | 2 +- opencga-client/src/main/javascript/Variant.js | 8 ++--- .../src/main/javascript/VariantOperation.js | 2 +- .../pyopencga/rest_clients/admin_client.py | 4 +-- .../rest_clients/alignment_client.py | 4 +-- .../rest_clients/clinical_analysis_client.py | 4 +-- .../pyopencga/rest_clients/cohort_client.py | 4 +-- .../rest_clients/disease_panel_client.py | 4 +-- .../pyopencga/rest_clients/family_client.py | 4 +-- .../pyopencga/rest_clients/file_client.py | 4 +-- .../pyopencga/rest_clients/ga4gh_client.py | 4 +-- .../rest_clients/individual_client.py | 4 +-- .../pyopencga/rest_clients/job_client.py | 4 +-- .../pyopencga/rest_clients/meta_client.py | 4 +-- .../pyopencga/rest_clients/project_client.py | 4 +-- .../pyopencga/rest_clients/sample_client.py | 4 +-- .../pyopencga/rest_clients/study_client.py | 4 +-- .../pyopencga/rest_clients/user_client.py | 4 +-- .../pyopencga/rest_clients/variant_client.py | 11 ++++--- .../rest_clients/variant_operation_client.py | 4 +-- .../variant/FamilyQcAnalysisParams.java | 31 +++++++++--------- .../variant/RelatednessAnalysisParams.java | 32 ++++++++++--------- 75 files changed, 185 insertions(+), 181 deletions(-) diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java index 2a2d4a8adf0..b80af90ba5e 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java @@ -1,5 +1,5 @@ /* -* Copyright 2015-2023-11-13 OpenCB +* Copyright 2015-2023-11-21 OpenCB * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java index 8746d0cc58e..a02dfa83516 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java @@ -1,5 +1,5 @@ /* -* Copyright 2015-2023-11-13 OpenCB +* Copyright 2015-2023-11-21 OpenCB * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java index 2f670f539e8..7826ad3b724 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java @@ -611,8 +611,8 @@ private RestResponse runFamilyQc() throws Exception { } else { ObjectMap beanParams = new ObjectMap(); putNestedIfNotEmpty(beanParams, "family",commandOptions.family, true); - putNestedIfNotEmpty(beanParams, "relatednessMethod",commandOptions.relatednessMethod, true); putNestedIfNotEmpty(beanParams, "relatednessMaf",commandOptions.relatednessMaf, true); + putNestedIfNotEmpty(beanParams, "haploidCallMode",commandOptions.haploidCallMode, true); putNestedIfNotEmpty(beanParams, "outdir",commandOptions.outdir, true); familyQcAnalysisParams = JacksonUtils.getDefaultObjectMapper().copy() @@ -1348,7 +1348,7 @@ private RestResponse runRelatedness() throws Exception { putNestedIfNotNull(beanParams, "individuals",commandOptions.individuals, true); putNestedIfNotNull(beanParams, "samples",commandOptions.samples, true); putNestedIfNotEmpty(beanParams, "minorAlleleFreq",commandOptions.minorAlleleFreq, true); - putNestedIfNotEmpty(beanParams, "method",commandOptions.method, true); + putNestedIfNotEmpty(beanParams, "haploidCallMode",commandOptions.haploidCallMode, true); putNestedIfNotEmpty(beanParams, "outdir",commandOptions.outdir, true); relatednessAnalysisParams = JacksonUtils.getDefaultObjectMapper().copy() diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java index c69a1700845..b1e0915380c 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java @@ -770,16 +770,16 @@ public class RunFamilyQcCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; - @Parameter(names = {"--family"}, description = "The body web service family parameter", required = false, arity = 1) + @Parameter(names = {"--family"}, description = "Family is a mandatory parameter when creating a new sample, this ID cannot be changed at the moment.", required = false, arity = 1) public String family; - @Parameter(names = {"--relatedness-method"}, description = "The body web service relatednessMethod parameter", required = false, arity = 1) - public String relatednessMethod; - - @Parameter(names = {"--relatedness-maf"}, description = "The body web service relatednessMaf parameter", required = false, arity = 1) + @Parameter(names = {"--relatedness-maf"}, description = "Minor allele frequency to filter variants, e.g.: 1kg_phase3:CEU>0.35, cohort:ALL>0.05", required = false, arity = 1) public String relatednessMaf; - @Parameter(names = {"--outdir"}, description = "The body web service outdir parameter", required = false, arity = 1) + @Parameter(names = {"--haploid-call-mode"}, description = "Haploid call mode, equivalent to the PLINK/IBD parameter vcf-half-call, accepts the following values: haploid, missing and reference", required = false, arity = 1) + public String haploidCallMode; + + @Parameter(names = {"--outdir"}, description = "Output dir for the job.", required = false, arity = 1) public String outdir; } @@ -1841,19 +1841,19 @@ public class RunRelatednessCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; - @Parameter(names = {"--individuals"}, description = "The body web service individuals parameter", required = false, arity = 1) + @Parameter(names = {"--individuals"}, description = "List of individuals (separated by commas)", required = false, arity = 1) public String individuals; - @Parameter(names = {"--samples"}, description = "The body web service samples parameter", required = false, arity = 1) + @Parameter(names = {"--samples"}, description = "List of samples (separated by commas) to identify the individuals", required = false, arity = 1) public String samples; - @Parameter(names = {"--minor-allele-freq"}, description = "The body web service minorAlleleFreq parameter", required = false, arity = 1) + @Parameter(names = {"--minor-allele-freq"}, description = "Minor allele frequency to filter variants, e.g.: 1kg_phase3:CEU>0.35, cohort:ALL>0.05", required = false, arity = 1) public String minorAlleleFreq; - @Parameter(names = {"--method"}, description = "The body web service method parameter", required = false, arity = 1) - public String method; + @Parameter(names = {"--haploid-call-mode"}, description = "Haploid call mode, equivalent to the PLINK/IBD parameter vcf-half-call, accepts the following values: haploid, missing and reference", required = false, arity = 1) + public String haploidCallMode; - @Parameter(names = {"--outdir"}, description = "The body web service outdir parameter", required = false, arity = 1) + @Parameter(names = {"--outdir"}, description = "Output dir for the job.", required = false, arity = 1) public String outdir; } diff --git a/opencga-client/src/main/R/R/Admin-methods.R b/opencga-client/src/main/R/R/Admin-methods.R index 459563289aa..ae477210b1e 100644 --- a/opencga-client/src/main/R/R/Admin-methods.R +++ b/opencga-client/src/main/R/R/Admin-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. diff --git a/opencga-client/src/main/R/R/Alignment-methods.R b/opencga-client/src/main/R/R/Alignment-methods.R index 71e1dad3bb6..8560a244847 100644 --- a/opencga-client/src/main/R/R/Alignment-methods.R +++ b/opencga-client/src/main/R/R/Alignment-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. diff --git a/opencga-client/src/main/R/R/AllGenerics.R b/opencga-client/src/main/R/R/AllGenerics.R index 913594e3fb5..d0030b036c7 100644 --- a/opencga-client/src/main/R/R/AllGenerics.R +++ b/opencga-client/src/main/R/R/AllGenerics.R @@ -1,51 +1,51 @@ # ############################################################################## ## UserClient -setGeneric("userClient", function(OpencgaR, user, filterId, users, endpointName, params=NULL, ...) +setGeneric("userClient", function(OpencgaR, users, filterId, user, endpointName, params=NULL, ...) standardGeneric("userClient")) # ############################################################################## ## ProjectClient -setGeneric("projectClient", function(OpencgaR, project, projects, endpointName, params=NULL, ...) +setGeneric("projectClient", function(OpencgaR, projects, project, endpointName, params=NULL, ...) standardGeneric("projectClient")) # ############################################################################## ## StudyClient -setGeneric("studyClient", function(OpencgaR, templateId, group, members, variableSet, studies, study, endpointName, params=NULL, ...) +setGeneric("studyClient", function(OpencgaR, study, studies, variableSet, group, members, templateId, endpointName, params=NULL, ...) standardGeneric("studyClient")) # ############################################################################## ## FileClient -setGeneric("fileClient", function(OpencgaR, file, members, folder, files, annotationSet, endpointName, params=NULL, ...) +setGeneric("fileClient", function(OpencgaR, annotationSet, file, files, members, folder, endpointName, params=NULL, ...) standardGeneric("fileClient")) # ############################################################################## ## JobClient -setGeneric("jobClient", function(OpencgaR, job, jobs, members, endpointName, params=NULL, ...) +setGeneric("jobClient", function(OpencgaR, members, job, jobs, endpointName, params=NULL, ...) standardGeneric("jobClient")) # ############################################################################## ## SampleClient -setGeneric("sampleClient", function(OpencgaR, sample, annotationSet, members, samples, endpointName, params=NULL, ...) +setGeneric("sampleClient", function(OpencgaR, members, annotationSet, sample, samples, endpointName, params=NULL, ...) standardGeneric("sampleClient")) # ############################################################################## ## IndividualClient -setGeneric("individualClient", function(OpencgaR, individual, annotationSet, individuals, members, endpointName, params=NULL, ...) +setGeneric("individualClient", function(OpencgaR, members, annotationSet, individuals, individual, endpointName, params=NULL, ...) standardGeneric("individualClient")) # ############################################################################## ## FamilyClient -setGeneric("familyClient", function(OpencgaR, families, annotationSet, members, family, endpointName, params=NULL, ...) +setGeneric("familyClient", function(OpencgaR, members, annotationSet, families, family, endpointName, params=NULL, ...) standardGeneric("familyClient")) # ############################################################################## ## CohortClient -setGeneric("cohortClient", function(OpencgaR, cohort, annotationSet, members, cohorts, endpointName, params=NULL, ...) +setGeneric("cohortClient", function(OpencgaR, members, annotationSet, cohort, cohorts, 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")) # ############################################################################## @@ -60,7 +60,7 @@ setGeneric("variantClient", function(OpencgaR, endpointName, params=NULL, ...) # ############################################################################## ## ClinicalClient -setGeneric("clinicalClient", function(OpencgaR, clinicalAnalyses, interpretations, clinicalAnalysis, members, interpretation, endpointName, params=NULL, ...) +setGeneric("clinicalClient", function(OpencgaR, interpretations, clinicalAnalyses, clinicalAnalysis, members, interpretation, endpointName, params=NULL, ...) standardGeneric("clinicalClient")) # ############################################################################## diff --git a/opencga-client/src/main/R/R/Clinical-methods.R b/opencga-client/src/main/R/R/Clinical-methods.R index ce4e7757d75..2b609443440 100644 --- a/opencga-client/src/main/R/R/Clinical-methods.R +++ b/opencga-client/src/main/R/R/Clinical-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -58,7 +58,7 @@ #' [*]: Required parameter #' @export -setMethod("clinicalClient", "OpencgaR", function(OpencgaR, clinicalAnalyses, interpretations, clinicalAnalysis, members, interpretation, endpointName, params=NULL, ...) { +setMethod("clinicalClient", "OpencgaR", function(OpencgaR, interpretations, clinicalAnalyses, clinicalAnalysis, members, interpretation, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/analysis/clinical/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Cohort-methods.R b/opencga-client/src/main/R/R/Cohort-methods.R index 01447cf29b2..1a56f242520 100644 --- a/opencga-client/src/main/R/R/Cohort-methods.R +++ b/opencga-client/src/main/R/R/Cohort-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -39,7 +39,7 @@ #' [*]: Required parameter #' @export -setMethod("cohortClient", "OpencgaR", function(OpencgaR, cohort, annotationSet, members, cohorts, endpointName, params=NULL, ...) { +setMethod("cohortClient", "OpencgaR", function(OpencgaR, members, annotationSet, cohort, cohorts, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/cohorts/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Family-methods.R b/opencga-client/src/main/R/R/Family-methods.R index 76ae48fbf8d..cb59d2bc395 100644 --- a/opencga-client/src/main/R/R/Family-methods.R +++ b/opencga-client/src/main/R/R/Family-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -38,7 +38,7 @@ #' [*]: Required parameter #' @export -setMethod("familyClient", "OpencgaR", function(OpencgaR, families, annotationSet, members, family, endpointName, params=NULL, ...) { +setMethod("familyClient", "OpencgaR", function(OpencgaR, members, annotationSet, families, family, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/families/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/File-methods.R b/opencga-client/src/main/R/R/File-methods.R index 1fe1285ddfe..e33e818d701 100644 --- a/opencga-client/src/main/R/R/File-methods.R +++ b/opencga-client/src/main/R/R/File-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -54,7 +54,7 @@ #' [*]: Required parameter #' @export -setMethod("fileClient", "OpencgaR", function(OpencgaR, file, members, folder, files, annotationSet, endpointName, params=NULL, ...) { +setMethod("fileClient", "OpencgaR", function(OpencgaR, annotationSet, file, files, members, folder, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/files/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/GA4GH-methods.R b/opencga-client/src/main/R/R/GA4GH-methods.R index 69eb3b2807b..26788aad18d 100644 --- a/opencga-client/src/main/R/R/GA4GH-methods.R +++ b/opencga-client/src/main/R/R/GA4GH-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. diff --git a/opencga-client/src/main/R/R/Individual-methods.R b/opencga-client/src/main/R/R/Individual-methods.R index 99d286bd4b2..a5e551ecb0e 100644 --- a/opencga-client/src/main/R/R/Individual-methods.R +++ b/opencga-client/src/main/R/R/Individual-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -39,7 +39,7 @@ #' [*]: Required parameter #' @export -setMethod("individualClient", "OpencgaR", function(OpencgaR, individual, annotationSet, individuals, members, endpointName, params=NULL, ...) { +setMethod("individualClient", "OpencgaR", function(OpencgaR, members, annotationSet, individuals, individual, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/individuals/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Job-methods.R b/opencga-client/src/main/R/R/Job-methods.R index 142152e1837..15eb737609f 100644 --- a/opencga-client/src/main/R/R/Job-methods.R +++ b/opencga-client/src/main/R/R/Job-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -40,7 +40,7 @@ #' [*]: Required parameter #' @export -setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpointName, params=NULL, ...) { +setMethod("jobClient", "OpencgaR", function(OpencgaR, members, job, jobs, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/jobs/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Meta-methods.R b/opencga-client/src/main/R/R/Meta-methods.R index f2f6fd2d9c1..dd5036d5550 100644 --- a/opencga-client/src/main/R/R/Meta-methods.R +++ b/opencga-client/src/main/R/R/Meta-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. diff --git a/opencga-client/src/main/R/R/Operation-methods.R b/opencga-client/src/main/R/R/Operation-methods.R index fc7bd100801..dd9eb327ea9 100644 --- a/opencga-client/src/main/R/R/Operation-methods.R +++ b/opencga-client/src/main/R/R/Operation-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. diff --git a/opencga-client/src/main/R/R/Panel-methods.R b/opencga-client/src/main/R/R/Panel-methods.R index 22a3e83fef4..145a14caa17 100644 --- a/opencga-client/src/main/R/R/Panel-methods.R +++ b/opencga-client/src/main/R/R/Panel-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -36,7 +36,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: diff --git a/opencga-client/src/main/R/R/Project-methods.R b/opencga-client/src/main/R/R/Project-methods.R index b493b10f4fa..14d48a37e54 100644 --- a/opencga-client/src/main/R/R/Project-methods.R +++ b/opencga-client/src/main/R/R/Project-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -34,7 +34,7 @@ #' [*]: Required parameter #' @export -setMethod("projectClient", "OpencgaR", function(OpencgaR, project, projects, endpointName, params=NULL, ...) { +setMethod("projectClient", "OpencgaR", function(OpencgaR, projects, project, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/projects/create: diff --git a/opencga-client/src/main/R/R/Sample-methods.R b/opencga-client/src/main/R/R/Sample-methods.R index b311baf89a1..f18085b6bd5 100644 --- a/opencga-client/src/main/R/R/Sample-methods.R +++ b/opencga-client/src/main/R/R/Sample-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -39,7 +39,7 @@ #' [*]: Required parameter #' @export -setMethod("sampleClient", "OpencgaR", function(OpencgaR, sample, annotationSet, members, samples, endpointName, params=NULL, ...) { +setMethod("sampleClient", "OpencgaR", function(OpencgaR, members, annotationSet, sample, samples, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/samples/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Study-methods.R b/opencga-client/src/main/R/R/Study-methods.R index cd7b088f00b..fcd1d85ae6d 100644 --- a/opencga-client/src/main/R/R/Study-methods.R +++ b/opencga-client/src/main/R/R/Study-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -46,7 +46,7 @@ #' [*]: Required parameter #' @export -setMethod("studyClient", "OpencgaR", function(OpencgaR, templateId, group, members, variableSet, studies, study, endpointName, params=NULL, ...) { +setMethod("studyClient", "OpencgaR", function(OpencgaR, study, studies, variableSet, group, members, templateId, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/studies/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/User-methods.R b/opencga-client/src/main/R/R/User-methods.R index 9aeaa258b88..3fca39f9fd0 100644 --- a/opencga-client/src/main/R/R/User-methods.R +++ b/opencga-client/src/main/R/R/User-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -38,7 +38,7 @@ #' [*]: Required parameter #' @export -setMethod("userClient", "OpencgaR", function(OpencgaR, user, filterId, users, endpointName, params=NULL, ...) { +setMethod("userClient", "OpencgaR", function(OpencgaR, users, filterId, user, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/users/login: diff --git a/opencga-client/src/main/R/R/Variant-methods.R b/opencga-client/src/main/R/R/Variant-methods.R index adddc7f944c..e63fdade3e4 100644 --- a/opencga-client/src/main/R/R/Variant-methods.R +++ b/opencga-client/src/main/R/R/Variant-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2023-11-13 +# Autogenerated on: 2023-11-21 # # 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. @@ -212,7 +212,7 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. - #' @param data Family QC analysis params. Family ID. Relatedness method, by default 'PLINK/IBD'. Minor allele frequence (MAF) is used to filter variants before computing relatedness, e.g.: 1000G:CEU>0.35 or cohort:ALL>0.05. + #' @param data Family QC analysis params. Family ID. Relatedness method based on the PLINK/IBD method. Minor allele frequency (MAF) is used to filter variants before computing relatedness, e.g.: 1000G:CEU>0.35 or cohort:ALL>0.05. runFamilyQc=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/family/qc", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -502,7 +502,7 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. - #' @param data Relatedness analysis params. + #' @param data Relatedness analysis params based on PLINK/IBD method. runRelatedness=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/relatedness", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java index 8435b397046..f90d191eac3 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java @@ -36,7 +36,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -45,7 +45,7 @@ /** * This class contains methods for the Admin webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: admin */ public class AdminClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java index 05dfcde8cc2..7ee76572852 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java @@ -40,7 +40,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -49,7 +49,7 @@ /** * This class contains methods for the Alignment webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: analysis/alignment */ public class AlignmentClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java index d347523ad1a..a7bae42989a 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java @@ -51,7 +51,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -60,7 +60,7 @@ /** * This class contains methods for the ClinicalAnalysis webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: analysis/clinical */ public class ClinicalAnalysisClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java index 3a63e02ad17..27a6aa81663 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java @@ -37,7 +37,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -46,7 +46,7 @@ /** * This class contains methods for the Cohort webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: cohorts */ public class CohortClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java index 8653ba08de1..288c783ef96 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java @@ -35,7 +35,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -44,7 +44,7 @@ /** * This class contains methods for the DiseasePanel webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: panels */ public class DiseasePanelClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java index 57bf1c4274f..4ccf9e87662 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java @@ -36,7 +36,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -45,7 +45,7 @@ /** * This class contains methods for the Family webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: families */ public class FamilyClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java index 857524ce7c6..3becd779d1b 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java @@ -43,7 +43,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -52,7 +52,7 @@ /** * This class contains methods for the File webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: files */ public class FileClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java index f0037da17a5..c90505df17f 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java @@ -27,7 +27,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -36,7 +36,7 @@ /** * This class contains methods for the GA4GH webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: ga4gh */ public class GA4GHClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java index 698a001dd12..8010ecd3402 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java @@ -36,7 +36,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -45,7 +45,7 @@ /** * This class contains methods for the Individual webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: individuals */ public class IndividualClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java index c30324489c5..a9af2f62bc4 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java @@ -37,7 +37,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -46,7 +46,7 @@ /** * This class contains methods for the Job webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: jobs */ public class JobClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java index 87bba3d77c7..97861b8624f 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java @@ -28,7 +28,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -37,7 +37,7 @@ /** * This class contains methods for the Meta webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: meta */ public class MetaClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java index fbdd5eb5726..407249ee432 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java @@ -32,7 +32,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -41,7 +41,7 @@ /** * This class contains methods for the Project webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: projects */ public class ProjectClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java index c39c80c600d..d543546db32 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java @@ -36,7 +36,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -45,7 +45,7 @@ /** * This class contains methods for the Sample webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: samples */ public class SampleClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java index a3624af0628..3fa4bfb9f2d 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java @@ -45,7 +45,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -54,7 +54,7 @@ /** * This class contains methods for the Study webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: studies */ public class StudyClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java index d7e7aba13b7..e961f036bf3 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java @@ -36,7 +36,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -45,7 +45,7 @@ /** * This class contains methods for the User webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: users */ public class UserClient extends AbstractParentClient { diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java index b352bbbea93..5605021ea34 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java @@ -62,7 +62,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -71,7 +71,7 @@ /** * This class contains methods for the Variant webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: analysis/variant */ public class VariantClient extends AbstractParentClient { @@ -288,8 +288,8 @@ public RestResponse genotypesFamily(String modeOfInheritance, ObjectM /** * Run quality control (QC) for a given family. It computes the relatedness scores among the family members. - * @param data Family QC analysis params. Family ID. Relatedness method, by default 'PLINK/IBD'. Minor allele frequence (MAF) is used - * to filter variants before computing relatedness, e.g.: 1000G:CEU>0.35 or cohort:ALL>0.05. + * @param data Family QC analysis params. Family ID. Relatedness method based on the PLINK/IBD method. Minor allele frequency (MAF) is + * used to filter variants before computing relatedness, e.g.: 1000G:CEU>0.35 or cohort:ALL>0.05. * @param params Map containing any of the following optional parameters. * study: Study [[user@]project:]study where study and project can be either the ID or UUID. * jobId: Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not provided. @@ -754,7 +754,7 @@ public RestResponse query(ObjectMap params) throws ClientException { /** * Compute a score to quantify relatedness between samples. - * @param data Relatedness analysis params. + * @param data Relatedness analysis params based on PLINK/IBD method. * @param params Map containing any of the following optional parameters. * study: Study [[user@]project:]study where study and project can be either the ID or UUID. * jobId: Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not provided. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java index 9d0805fb31d..0bc411a4be8 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java @@ -50,7 +50,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2023-11-13 +* Autogenerated on: 2023-11-21 * * 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. @@ -59,7 +59,7 @@ /** * This class contains methods for the VariantOperation webservices. - * Client version: 2.12.0-SNAPSHOT + * Client version: 2.13.0-SNAPSHOT * PATH: operation */ public class VariantOperationClient extends AbstractParentClient { diff --git a/opencga-client/src/main/javascript/Admin.js b/opencga-client/src/main/javascript/Admin.js index 10d1651c0ef..ae4ecad6de0 100644 --- a/opencga-client/src/main/javascript/Admin.js +++ b/opencga-client/src/main/javascript/Admin.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Alignment.js b/opencga-client/src/main/javascript/Alignment.js index 3a70cebf815..74e50dd5dfc 100644 --- a/opencga-client/src/main/javascript/Alignment.js +++ b/opencga-client/src/main/javascript/Alignment.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/ClinicalAnalysis.js b/opencga-client/src/main/javascript/ClinicalAnalysis.js index 3eb5e309355..ed55809ab52 100644 --- a/opencga-client/src/main/javascript/ClinicalAnalysis.js +++ b/opencga-client/src/main/javascript/ClinicalAnalysis.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Cohort.js b/opencga-client/src/main/javascript/Cohort.js index 2c3f06ac6b7..60b4352621f 100644 --- a/opencga-client/src/main/javascript/Cohort.js +++ b/opencga-client/src/main/javascript/Cohort.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/DiseasePanel.js b/opencga-client/src/main/javascript/DiseasePanel.js index ffffef0f04d..f6bbac654c9 100644 --- a/opencga-client/src/main/javascript/DiseasePanel.js +++ b/opencga-client/src/main/javascript/DiseasePanel.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Family.js b/opencga-client/src/main/javascript/Family.js index 0f8a88dea2e..0269e3aade4 100644 --- a/opencga-client/src/main/javascript/Family.js +++ b/opencga-client/src/main/javascript/Family.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/File.js b/opencga-client/src/main/javascript/File.js index 96274cd68f9..c1bc508be19 100644 --- a/opencga-client/src/main/javascript/File.js +++ b/opencga-client/src/main/javascript/File.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/GA4GH.js b/opencga-client/src/main/javascript/GA4GH.js index c2b83325104..24a2b3549b7 100644 --- a/opencga-client/src/main/javascript/GA4GH.js +++ b/opencga-client/src/main/javascript/GA4GH.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Individual.js b/opencga-client/src/main/javascript/Individual.js index 0195ce72da8..e2379cf23c1 100644 --- a/opencga-client/src/main/javascript/Individual.js +++ b/opencga-client/src/main/javascript/Individual.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Job.js b/opencga-client/src/main/javascript/Job.js index 08de7c4b994..6ad0b13df0a 100644 --- a/opencga-client/src/main/javascript/Job.js +++ b/opencga-client/src/main/javascript/Job.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Meta.js b/opencga-client/src/main/javascript/Meta.js index 8b88961f17b..36ae34309b9 100644 --- a/opencga-client/src/main/javascript/Meta.js +++ b/opencga-client/src/main/javascript/Meta.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Project.js b/opencga-client/src/main/javascript/Project.js index ae5e1375a84..b885aa0f47d 100644 --- a/opencga-client/src/main/javascript/Project.js +++ b/opencga-client/src/main/javascript/Project.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Sample.js b/opencga-client/src/main/javascript/Sample.js index 56aa472e498..df98105cf52 100644 --- a/opencga-client/src/main/javascript/Sample.js +++ b/opencga-client/src/main/javascript/Sample.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Study.js b/opencga-client/src/main/javascript/Study.js index d94ee0162b4..e49505ffb54 100644 --- a/opencga-client/src/main/javascript/Study.js +++ b/opencga-client/src/main/javascript/Study.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/User.js b/opencga-client/src/main/javascript/User.js index ac6baacb6b7..ce5c939d795 100644 --- a/opencga-client/src/main/javascript/User.js +++ b/opencga-client/src/main/javascript/User.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/javascript/Variant.js b/opencga-client/src/main/javascript/Variant.js index cf770869729..33fac41f720 100644 --- a/opencga-client/src/main/javascript/Variant.js +++ b/opencga-client/src/main/javascript/Variant.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. @@ -214,8 +214,8 @@ export default class Variant extends OpenCGAParentClass { } /** Run quality control (QC) for a given family. It computes the relatedness scores among the family members - * @param {Object} data - Family QC analysis params. Family ID. Relatedness method, by default 'PLINK/IBD'. Minor allele frequence (MAF) - * is used to filter variants before computing relatedness, e.g.: 1000G:CEU>0.35 or cohort:ALL>0.05. + * @param {Object} data - Family QC analysis params. Family ID. Relatedness method based on the PLINK/IBD method. Minor allele frequency + * (MAF) is used to filter variants before computing relatedness, e.g.: 1000G:CEU>0.35 or cohort:ALL>0.05. * @param {Object} [params] - The Object containing the following optional parameters: * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. * @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not @@ -640,7 +640,7 @@ export default class Variant extends OpenCGAParentClass { } /** Compute a score to quantify relatedness between samples. - * @param {Object} data - Relatedness analysis params. + * @param {Object} data - Relatedness analysis params based on PLINK/IBD method. * @param {Object} [params] - The Object containing the following optional parameters: * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. * @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not diff --git a/opencga-client/src/main/javascript/VariantOperation.js b/opencga-client/src/main/javascript/VariantOperation.js index 0d477d3ca00..1258093c63a 100644 --- a/opencga-client/src/main/javascript/VariantOperation.js +++ b/opencga-client/src/main/javascript/VariantOperation.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2023-11-13 + * Autogenerated on: 2023-11-21 * * 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. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py index 00faf6b7311..215ed44c651 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Admin(_ParentRestClient): """ This class contains methods for the 'Admin' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/admin """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py index da4e6ed6979..442872dc38c 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Alignment(_ParentRestClient): """ This class contains methods for the 'Analysis - Alignment' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/analysis/alignment """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py index 18cb0444591..02c2cf7ac74 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class ClinicalAnalysis(_ParentRestClient): """ This class contains methods for the 'Analysis - Clinical' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/analysis/clinical """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py index 7d54679aee4..31c79aa6fff 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Cohort(_ParentRestClient): """ This class contains methods for the 'Cohorts' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/cohorts """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py index ef5dc901800..c37d3e41e84 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class DiseasePanel(_ParentRestClient): """ This class contains methods for the 'Disease Panels' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/panels """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py index b84f8978d8d..8ea5c77a4b1 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Family(_ParentRestClient): """ This class contains methods for the 'Families' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/families """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py index 4fab8a41a57..ce99a4443ea 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class File(_ParentRestClient): """ This class contains methods for the 'Files' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/files """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py index 20453644c8c..035d7dd9dd2 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class GA4GH(_ParentRestClient): """ This class contains methods for the 'GA4GH' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/ga4gh """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py index f92f31002b9..5a1079b564f 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Individual(_ParentRestClient): """ This class contains methods for the 'Individuals' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/individuals """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py index e3fd92d265b..cf50f1f5b74 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Job(_ParentRestClient): """ This class contains methods for the 'Jobs' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/jobs """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py index 1179bd290c5..a6b2590c24e 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Meta(_ParentRestClient): """ This class contains methods for the 'Meta' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/meta """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py index 7d647e89b6b..c0c783ef6be 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Project(_ParentRestClient): """ This class contains methods for the 'Projects' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/projects """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py index d6e12e0645b..a554648848a 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Sample(_ParentRestClient): """ This class contains methods for the 'Samples' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/samples """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py index 2299432a49b..fca1bbf472c 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Study(_ParentRestClient): """ This class contains methods for the 'Studies' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/studies """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py index 714b7116678..7362a977f70 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class User(_ParentRestClient): """ This class contains methods for the 'Users' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/users """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py index a407439994f..31d3f2ff7f6 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class Variant(_ParentRestClient): """ This class contains methods for the 'Analysis - Variant' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/analysis/variant """ @@ -270,8 +270,8 @@ def run_family_qc(self, data=None, **options): PATH: /{apiVersion}/analysis/variant/family/qc/run :param dict data: Family QC analysis params. Family ID. Relatedness - method, by default 'PLINK/IBD'. Minor allele frequence (MAF) is - used to filter variants before computing relatedness, e.g.: + method based on the PLINK/IBD method. Minor allele frequency (MAF) + is used to filter variants before computing relatedness, e.g.: 1000G:CEU>0.35 or cohort:ALL>0.05. (REQUIRED) :param str study: Study [[user@]project:]study where study and project can be either the ID or UUID. @@ -850,7 +850,8 @@ def run_relatedness(self, data=None, **options): Compute a score to quantify relatedness between samples. PATH: /{apiVersion}/analysis/variant/relatedness/run - :param dict data: Relatedness analysis params. (REQUIRED) + :param dict data: Relatedness analysis params based on PLINK/IBD + method. (REQUIRED) :param str study: Study [[user@]project:]study where study and project can be either the ID or UUID. :param str job_id: Job ID. It must be a unique string within the diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py index 8b0f6ac08bd..69e08936b35 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2023-11-13 + Autogenerated on: 2023-11-21 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. @@ -14,7 +14,7 @@ class VariantOperation(_ParentRestClient): """ This class contains methods for the 'Operations - Variant Storage' webservices - Client version: 2.12.0-SNAPSHOT + Client version: 2.13.0-SNAPSHOT PATH: /{apiVersion}/operation """ diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/FamilyQcAnalysisParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/FamilyQcAnalysisParams.java index fe92ff6fa58..84a0707f50a 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/FamilyQcAnalysisParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/FamilyQcAnalysisParams.java @@ -16,26 +16,37 @@ package org.opencb.opencga.core.models.variant; +import org.opencb.biodata.models.clinical.qc.RelatednessReport; +import org.opencb.commons.annotations.DataField; +import org.opencb.opencga.core.api.FieldConstants; import org.opencb.opencga.core.api.ParamConstants; import org.opencb.opencga.core.tools.ToolParams; +import static org.opencb.biodata.models.constants.FieldConstants.RELATEDNESS_REPORT_HAPLOID_CALL_MODE_DESCRIPTION; +import static org.opencb.biodata.models.constants.FieldConstants.RELATEDNESS_REPORT_MAF_DESCRIPTION; + public class FamilyQcAnalysisParams extends ToolParams { - public static final String DESCRIPTION = "Family QC analysis params. Family ID. Relatedness method, by default 'PLINK/IBD'. Minor " - + " allele frequence (MAF) is used to filter variants before computing relatedness, e.g.: " + ParamConstants.POP_FREQ_1000G + public static final String DESCRIPTION = "Family QC analysis params. Family ID. Relatedness method based on the PLINK/IBD method." + + " Minor allele frequency (MAF) is used to filter variants before computing relatedness, e.g.: " + ParamConstants.POP_FREQ_1000G + ":CEU>0.35 or cohort:ALL>0.05"; + + @DataField(id = "family", description = FieldConstants.FAMILY_ID_DESCRIPTION) private String family; - private String relatednessMethod; + + @DataField(id = "relatednessMaf", description = RELATEDNESS_REPORT_MAF_DESCRIPTION) private String relatednessMaf; + + @DataField(id = "haploidCallMode", description = RELATEDNESS_REPORT_HAPLOID_CALL_MODE_DESCRIPTION) private String haploidCallMode; + @DataField(id = "outdir", description = FieldConstants.JOB_OUT_DIR_DESCRIPTION) private String outdir; public FamilyQcAnalysisParams() { } - public FamilyQcAnalysisParams(String family, String relatednessMethod, String relatednessMaf, String haploidCallMode, String outdir) { + public FamilyQcAnalysisParams(String family, String relatednessMaf, String haploidCallMode, String outdir) { this.family = family; - this.relatednessMethod = relatednessMethod; this.relatednessMaf = relatednessMaf; this.haploidCallMode = haploidCallMode; this.outdir = outdir; @@ -45,7 +56,6 @@ public FamilyQcAnalysisParams(String family, String relatednessMethod, String re public String toString() { final StringBuilder sb = new StringBuilder("FamilyQcAnalysisParams{"); sb.append("family='").append(family).append('\''); - sb.append(", relatednessMethod='").append(relatednessMethod).append('\''); sb.append(", relatednessMaf='").append(relatednessMaf).append('\''); sb.append(", haploidCallMode='").append(haploidCallMode).append('\''); sb.append(", outdir='").append(outdir).append('\''); @@ -62,15 +72,6 @@ public FamilyQcAnalysisParams setFamily(String family) { return this; } - public String getRelatednessMethod() { - return relatednessMethod; - } - - public FamilyQcAnalysisParams setRelatednessMethod(String relatednessMethod) { - this.relatednessMethod = relatednessMethod; - return this; - } - public String getRelatednessMaf() { return relatednessMaf; } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java index 90ae04384b1..f40e85fb91b 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java @@ -16,29 +16,41 @@ package org.opencb.opencga.core.models.variant; +import org.opencb.commons.annotations.DataField; +import org.opencb.opencga.core.api.FieldConstants; import org.opencb.opencga.core.tools.ToolParams; import java.util.List; +import static org.opencb.biodata.models.constants.FieldConstants.RELATEDNESS_REPORT_HAPLOID_CALL_MODE_DESCRIPTION; +import static org.opencb.biodata.models.constants.FieldConstants.RELATEDNESS_REPORT_MAF_DESCRIPTION; + public class RelatednessAnalysisParams extends ToolParams { - public static final String DESCRIPTION = "Relatedness analysis params"; + public static final String DESCRIPTION = "Relatedness analysis params based on PLINK/IBD method"; + + @DataField(id = "individuals", description = "List of individuals (separated by commas)") private List individuals; + + @DataField(id = "samples", description = "List of samples (separated by commas) to identify the individuals") private List samples; + + @DataField(id = "minorAlleleFreq", description = RELATEDNESS_REPORT_MAF_DESCRIPTION) private String minorAlleleFreq; + + @DataField(id = "haploidCallMode", description = RELATEDNESS_REPORT_HAPLOID_CALL_MODE_DESCRIPTION) private String haploidCallMode; - private String method; + + @DataField(id = "outdir", description = FieldConstants.JOB_OUT_DIR_DESCRIPTION) private String outdir; public RelatednessAnalysisParams() { } - public RelatednessAnalysisParams(List individuals, List samples, String minorAlleleFreq, String haploidCallMode, - String method, String outdir) { + public RelatednessAnalysisParams(List individuals, List samples, String minorAlleleFreq, String haploidCallMode, String outdir) { this.individuals = individuals; this.samples = samples; this.minorAlleleFreq = minorAlleleFreq; this.haploidCallMode = haploidCallMode; - this.method = method; this.outdir = outdir; } @@ -49,7 +61,6 @@ public String toString() { sb.append(", samples=").append(samples); sb.append(", minorAlleleFreq='").append(minorAlleleFreq).append('\''); sb.append(", haploidCallMode='").append(haploidCallMode).append('\''); - sb.append(", method='").append(method).append('\''); sb.append(", outdir='").append(outdir).append('\''); sb.append('}'); return sb.toString(); @@ -91,15 +102,6 @@ public RelatednessAnalysisParams setHaploidCallMode(String haploidCallMode) { return this; } - public String getMethod() { - return method; - } - - public RelatednessAnalysisParams setMethod(String method) { - this.method = method; - return this; - } - public String getOutdir() { return outdir; } From f15267963ace95fdc37d237f581d16b1be3a6101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Wed, 22 Nov 2023 16:52:13 +0100 Subject: [PATCH 3/6] analysis: use VCF file to compute PLINK/IBD and add junit tests, #TASK-5282, #TASK-5278 --- .../analysis/family/qc/FamilyQcAnalysis.java | 70 ++----- .../analysis/family/qc/IBDComputation.java | 197 ++++++++++++++++-- .../relatedness/RelatednessAnalysis.java | 140 +++++-------- .../variant/OpenCGATestExternalResource.java | 5 + .../analysis/variant/VariantAnalysisTest.java | 52 ++++- .../VariantInternalCommandExecutor.java | 40 ++-- .../variant/RelatednessAnalysisParams.java | 2 +- 7 files changed, 322 insertions(+), 184 deletions(-) diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcAnalysis.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcAnalysis.java index 29b9ddc1407..ce2465ad5fd 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcAnalysis.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcAnalysis.java @@ -16,28 +16,27 @@ package org.opencb.opencga.analysis.family.qc; -import com.fasterxml.jackson.core.JsonProcessingException; import org.apache.commons.lang3.StringUtils; import org.opencb.biodata.models.clinical.qc.RelatednessReport; import org.opencb.commons.datastore.core.QueryOptions; import org.opencb.opencga.analysis.AnalysisUtils; -import org.opencb.opencga.analysis.individual.qc.IndividualQcAnalysis; import org.opencb.opencga.analysis.individual.qc.IndividualQcUtils; -import org.opencb.opencga.analysis.tools.OpenCgaTool; +import org.opencb.opencga.analysis.tools.OpenCgaToolScopeStudy; import org.opencb.opencga.analysis.variant.relatedness.RelatednessAnalysis; import org.opencb.opencga.catalog.exceptions.CatalogException; -import org.opencb.opencga.core.common.JacksonUtils; import org.opencb.opencga.core.exceptions.ToolException; import org.opencb.opencga.core.models.common.Enums; import org.opencb.opencga.core.models.family.Family; import org.opencb.opencga.core.models.family.FamilyQualityControl; import org.opencb.opencga.core.models.family.FamilyUpdateParams; import org.opencb.opencga.core.models.study.Study; +import org.opencb.opencga.core.models.variant.FamilyQcAnalysisParams; +import org.opencb.opencga.core.models.variant.MutationalSignatureAnalysisParams; import org.opencb.opencga.core.tools.annotations.Tool; +import org.opencb.opencga.core.tools.annotations.ToolParams; import org.opencb.opencga.core.tools.variant.FamilyQcAnalysisExecutor; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -45,7 +44,7 @@ import static org.opencb.opencga.core.models.study.StudyPermissions.Permissions.WRITE_FAMILIES; @Tool(id = FamilyQcAnalysis.ID, resource = Enums.Resource.FAMILY, description = FamilyQcAnalysis.DESCRIPTION) -public class FamilyQcAnalysis extends OpenCgaTool { +public class FamilyQcAnalysis extends OpenCgaToolScopeStudy { public static final String ID = "family-qc"; public static final String DESCRIPTION = "Run quality control (QC) for a given family. It computes the relatedness scores among the" @@ -53,9 +52,9 @@ public class FamilyQcAnalysis extends OpenCgaTool { public static final String RELATEDNESS_STEP = "relatedness"; - private String studyId; - private String familyId; - private String relatednessMethod; + @ToolParams + private FamilyQcAnalysisParams familyQcParams = new FamilyQcAnalysisParams(); + private String relatednessMaf; private String haploidCallMode; private Map> relatednessThresholds; @@ -65,15 +64,15 @@ public class FamilyQcAnalysis extends OpenCgaTool { @Override protected void check() throws Exception { super.check(); - setUpStorageEngineExecutor(studyId); + setUpStorageEngineExecutor(study); - if (StringUtils.isEmpty(studyId)) { + if (StringUtils.isEmpty(study)) { throw new ToolException("Missing study ID."); } // Check permissions try { - Study study = catalogManager.getStudyManager().get(studyId, QueryOptions.empty(), token).first(); + Study study = catalogManager.getStudyManager().get(this.study, QueryOptions.empty(), token).first(); String userId = catalogManager.getUserManager().getUserId(token); catalogManager.getAuthorizationManager().checkStudyPermission(study.getUid(), userId, WRITE_FAMILIES); } catch (CatalogException e) { @@ -81,22 +80,23 @@ protected void check() throws Exception { } // Sanity check - if (StringUtils.isEmpty(familyId)) { + if (StringUtils.isEmpty(familyQcParams.getFamily())) { throw new ToolException("Missing family ID."); } - family = IndividualQcUtils.getFamilyById(studyId, familyId, catalogManager, token); + family = IndividualQcUtils.getFamilyById(study, familyQcParams.getFamily(), catalogManager, token); if (family == null) { - throw new ToolException("Family '" + familyId + "' not found."); + throw new ToolException("Family '" + familyQcParams.getFamily() + "' not found."); } - // As relatedness is the only QC to compute, it is mandatory - if (StringUtils.isEmpty(relatednessMethod)) { - relatednessMethod = "PLINK/IBD"; - } + // Check MAF + relatednessMaf = familyQcParams.getRelatednessMaf(); if (StringUtils.isEmpty(relatednessMaf)) { relatednessMaf = RelatednessAnalysis.MAF_DEFAULT_VALUE; } + + // Check haploid call mode + haploidCallMode = familyQcParams.getHaploidCallMode(); if (StringUtils.isEmpty(haploidCallMode)) { haploidCallMode = RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE; } else { @@ -133,9 +133,8 @@ protected void run() throws ToolException { FamilyQcAnalysisExecutor executor = getToolExecutor(FamilyQcAnalysisExecutor.class); // Set up executor - executor.setStudyId(studyId) + executor.setStudyId(study) .setFamily(family) - .setRelatednessMethod(relatednessMethod) .setRelatednessMaf(relatednessMaf) .setHaploidCallMode(haploidCallMode) .setRelatednessThresholds(relatednessThresholds) @@ -149,7 +148,7 @@ protected void run() throws ToolException { try { qualityControl = executor.getQualityControl(); if (qualityControl != null) { - catalogManager.getFamilyManager().update(getStudyId(), familyId, new FamilyUpdateParams().setQualityControl(qualityControl), + catalogManager.getFamilyManager().update(study, familyQcParams.getFamily(), new FamilyUpdateParams().setQualityControl(qualityControl), QueryOptions.empty(), token); } } catch (CatalogException e) { @@ -157,33 +156,6 @@ protected void run() throws ToolException { } } - public String getStudyId() { - return studyId; - } - - public FamilyQcAnalysis setStudyId(String studyId) { - this.studyId = studyId; - return this; - } - - public String getFamilyId() { - return familyId; - } - - public FamilyQcAnalysis setFamilyId(String familyId) { - this.familyId = familyId; - return this; - } - - public String getRelatednessMethod() { - return relatednessMethod; - } - - public FamilyQcAnalysis setRelatednessMethod(String relatednessMethod) { - this.relatednessMethod = relatednessMethod; - return this; - } - public String getRelatednessMaf() { return relatednessMaf; } diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java index 5cedd0ac4fb..2ddb77b5da1 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java @@ -16,16 +16,18 @@ package org.opencb.opencga.analysis.family.qc; +import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; -import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.opencb.biodata.models.clinical.qc.RelatednessReport; import org.opencb.biodata.models.clinical.qc.RelatednessScore; import org.opencb.biodata.models.variant.avro.VariantType; +import org.opencb.biodata.models.variant.metadata.VariantMetadata; import org.opencb.commons.datastore.core.Query; import org.opencb.commons.datastore.core.QueryOptions; import org.opencb.commons.utils.DockerUtils; +import org.opencb.commons.utils.FileUtils; import org.opencb.opencga.analysis.ResourceUtils; import org.opencb.opencga.analysis.individual.qc.IndividualQcUtils; import org.opencb.opencga.analysis.variant.manager.VariantStorageManager; @@ -40,12 +42,16 @@ import org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam; import java.io.*; +import java.net.URI; import java.net.URL; +import java.nio.charset.Charset; +import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; import static org.opencb.opencga.storage.core.variant.io.VariantWriterFactory.VariantOutputFormat.TPED; +import static org.opencb.opencga.storage.core.variant.io.VariantWriterFactory.VariantOutputFormat.VCF; public class IBDComputation { @@ -106,17 +112,32 @@ public static RelatednessReport compute(String study, Family family, List0.3 @@ -200,6 +222,7 @@ private static void exportFamily(String basename, String study, List sam //.append(VariantQueryParam.FILTER.key(), "PASS") query.put(VariantQueryParam.REGION.key(), Arrays.asList("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22".split(","))); + query.put(VariantQueryParam.INCLUDE_GENOTYPE.key(), true); // MAF parameter: // - For annotated population studies, e.g.: 1000G:ALL>0.3 @@ -222,23 +245,23 @@ private static void exportData(Query query, QueryOptions queryOptions, String ba System.out.println(">>>> export, query = " + query.toJson()); System.out.println(">>>> export, query options = " + queryOptions.toJson()); - File tpedFile = outDir.resolve(basename + ".tped").toFile(); - File tfamFile = outDir.resolve(basename + ".tfam").toFile(); + File vcfFile = outDir.resolve(basename + ".vcf").toFile(); +// File tfamFile = outDir.resolve(basename + ".tfam").toFile(); // Export data try { - storageManager.exportData(tpedFile.getAbsolutePath(), TPED, null, query, queryOptions, token); + storageManager.exportData(vcfFile.getAbsolutePath(), VCF, null, query, queryOptions, token); } catch (CatalogException | StorageEngineException e) { throw new ToolException(e); } // Sanity check - if (!tpedFile.exists() || tpedFile.length() == 0) { - throw new ToolException("No variants found when exporting data to TPED/TFAM format"); - } - if (!tfamFile.exists()) { - throw new ToolException("Something wrong exporting data to TPED/TFAM format"); + if (!vcfFile.exists() || vcfFile.length() == 0) { + throw new ToolException("No variants found when exporting data to VCF format"); } +// if (!tfamFile.exists()) { +// throw new ToolException("Something wrong exporting data to TPED/TFAM format"); +// } } public static void filterFamilyTpedFile(Path tPedPath, Path tPedFilteredPath, Path pruneInPath) throws IOException { @@ -299,6 +322,86 @@ public static void filterFamilyTpedFile(Path tPedPath, Path tPedFilteredPath, Pa bw.close(); } + public static void filterFamilyVcfFile(Path vcfPath, Path vcfFilteredPath, Path pruneInPath) throws IOException, ToolException { + // Init map with prune-in variants + Map pruneInMap = new HashMap<>(); + BufferedReader br = org.opencb.commons.utils.FileUtils.newBufferedReader(pruneInPath); + String line = br.readLine(); + if (line != null) { + pruneInMap.put(line, 0); + } + while (line != null) { + pruneInMap.put(line, 0); + line = br.readLine(); + } + br.close(); + + BufferedWriter bw = org.opencb.commons.utils.FileUtils.newBufferedWriter(vcfFilteredPath); + + // Get number of GT + int numGT; + String[] split; + br = org.opencb.commons.utils.FileUtils.newBufferedReader(vcfPath); + do { + line = br.readLine(); + + // Write header lines + split = line.split("\t"); + for (int i = 0; i < split.length; i++) { + if (i > 0) { + bw.write("\t"); + } + if (i == 2 && split[2].equals(".")) { + bw.write(split[0] + ":" + split[1] + ":" + split[3] + ":" + split[4]); + } else { + bw.write(split[i]); + } + } + bw.write("\n"); + } while (line.startsWith("##")); + + // Sanity check + if (line.startsWith("#CHROM")) { + split = line.split("\t"); + numGT = split.length - 9; + } else { + throw new ToolException("Error filtering VCF file"); + } + + // Filter TPED file using prune-in map + String key; + line = br.readLine(); + while (line != null) { + split = line.split("\t"); + key = split[0] + ":" + split[1] + ":" + split[3] + ":" + split[4]; + if (pruneInMap.containsKey(key)) { + bw.write(line); + bw.write("\n"); + + // Mark in map as written !! + pruneInMap.put(split[1], 1); + } + + line = br.readLine(); + } + br.close(); + + // Write remaining prune-in variants + String strGT = ""; + for (int i = 0; i < numGT; i++) { + strGT += ("\t0|0"); + } + for (Map.Entry entry : pruneInMap.entrySet()) { + if (entry.getValue() == 0) { + split = entry.getKey().split(":"); + line = split[0] + "\t" + split[1] + "\t" + entry.getKey() + "\t" + split[2] + "\t" + split[3] + "\t.\t.\t.\tGT" + strGT; + bw.write(line); + bw.write("\n"); + } + } + bw.close(); + } + private static File runIBD(String basename, Path freqPath, String haploidCallMode, Path outDir) throws ToolException { // Input bindings List> inputBindings = new ArrayList<>(); @@ -308,11 +411,31 @@ private static File runIBD(String basename, Path freqPath, String haploidCallMod AbstractMap.SimpleEntry outputBinding = new AbstractMap.SimpleEntry<>(outDir.toAbsolutePath().toString(), "/output"); - // Run IBD using PLINK in docker + // Convert VCF to PLINK binary format (BED/BIM/FAM) String plinkParams = "plink1.9" - + " --tfile /output/" + basename - + " --genome rel-check" + + " --vcf /output/" + basename + ".vcf" + + " --make-bed" + " --vcf-half-call " + haploidCallMode + + " --out /output/" + basename; + + try { + PlinkWrapperAnalysisExecutor plinkExecutor = new PlinkWrapperAnalysisExecutor(); + DockerUtils.run(plinkExecutor.getDockerImageName(), inputBindings, outputBinding, plinkParams, null); + } catch (IOException e) { + throw new ToolException(e); + } + + try { + org.apache.commons.io.FileUtils.copyFile(outDir.resolve(BASENAME + ".fam").toFile(), + outDir.resolve(FILTERED_BASENAME + ".fam").toFile()); + } catch (IOException e) { + throw new ToolException("Something wrong happened when copying files during the relatedness analysis execution"); + } + + // Run IBD using PLINK in docker + plinkParams = "plink1.9" + + " --bfile /output/" + basename + + " --genome rel-check" + " --read-freq /input/" + FREQ_FILENAME + " --out /output/" + basename; try { @@ -490,4 +613,40 @@ public static List inferredRelationship(String z0, return CollectionUtils.isEmpty(result) ? Collections.singletonList(Family.FamiliarRelationship.UNKNOWN) : result; } + + private static void writeFamFile(VariantMetadata metadata, Path famPath) throws IOException { + BufferedWriter bw = Files.newBufferedWriter(famPath); + for (org.opencb.biodata.models.metadata.Individual individual : metadata.getStudies().get(0).getIndividuals()) { + // Sex code: '1' = male, '2' = female, '0' = unknown + int sex = 0; + if (individual.getSex() != null) { + switch (individual.getSex()) { + case "MALE": { + sex = 1; + break; + } + case "FEMALE": { + sex = 2; + break; + } + default: { + sex = 0; + break; + } + } + } + // Phenotype value: '1' = control, '2' = case, '-9'/'0'/non-numeric = missing data if case/control + int phenotype = 0; + + bw.write((individual.getFamily() == null ? "0" : individual.getFamily()) + + "\t" + individual.getId() + + "\t" + (individual.getFather() == null ? "0" : individual.getFather()) + + "\t" + (individual.getMother() == null ? "0" : individual.getMother()) + + "\t" + sex + + "\t" + phenotype + + "\n"); + + } + bw.close(); + } } diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/RelatednessAnalysis.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/RelatednessAnalysis.java index 9823bfa4717..efced889122 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/RelatednessAnalysis.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/relatedness/RelatednessAnalysis.java @@ -24,12 +24,16 @@ import org.opencb.opencga.analysis.family.qc.FamilyQcAnalysis; import org.opencb.opencga.analysis.individual.qc.IndividualQcUtils; import org.opencb.opencga.analysis.tools.OpenCgaTool; +import org.opencb.opencga.analysis.tools.OpenCgaToolScopeStudy; import org.opencb.opencga.catalog.exceptions.CatalogException; import org.opencb.opencga.core.exceptions.ToolException; import org.opencb.opencga.core.models.common.Enums; import org.opencb.opencga.core.models.family.Family; import org.opencb.opencga.core.models.sample.Sample; +import org.opencb.opencga.core.models.variant.FamilyQcAnalysisParams; +import org.opencb.opencga.core.models.variant.RelatednessAnalysisParams; import org.opencb.opencga.core.tools.annotations.Tool; +import org.opencb.opencga.core.tools.annotations.ToolParams; import org.opencb.opencga.core.tools.variant.IBDRelatednessAnalysisExecutor; import java.io.BufferedReader; @@ -37,129 +41,72 @@ import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; @Tool(id = RelatednessAnalysis.ID, resource = Enums.Resource.VARIANT, description = RelatednessAnalysis.DESCRIPTION) -public class RelatednessAnalysis extends OpenCgaTool { +public class RelatednessAnalysis extends OpenCgaToolScopeStudy { public static final String ID = "relatedness"; public static final String DESCRIPTION = "Compute a score to quantify relatedness between samples."; public static final String MAF_DEFAULT_VALUE = "1000G:ALL>0.3"; +// private String familyId; +// private List individualIds; +// private String method; +// private String minorAlleleFreq; +// private String haploidCallMode; +// private Map> thresholds; +// +// private Family family; + + @ToolParams + private RelatednessAnalysisParams relatednessParams = new RelatednessAnalysisParams(); + private String studyId; - private String familyId; - private List individualIds; private List sampleIds; - private String method; private String minorAlleleFreq; private String haploidCallMode; - private Map> thresholds; + private Map> relatednessThresholds; private Family family; public RelatednessAnalysis() { } - /** - * Study of the samples. - * @param studyId Study id - * @return this - */ - public RelatednessAnalysis setStudyId(String studyId) { - this.studyId = studyId; - return this; - } - - public String getFamilyId() { - return familyId; - } - - public RelatednessAnalysis setFamilyId(String familyId) { - this.familyId = familyId; - return this; - } - - public List getIndividualIds() { - return individualIds; - } - - public RelatednessAnalysis setIndividualIds(List individualIds) { - this.individualIds = individualIds; - return this; - } - - public List getSampleIds() { - return sampleIds; - } - - public RelatednessAnalysis setSampleIds(List sampleIds) { - this.sampleIds = sampleIds; - return this; - } - - public String getMethod() { - return method; - } - - public RelatednessAnalysis setMethod(String method) { - this.method = method; - return this; - } - - public String getMinorAlleleFreq() { - return minorAlleleFreq; - } - - public RelatednessAnalysis setMinorAlleleFreq(String maf) { - this.minorAlleleFreq = maf; - return this; - } - - public String getHaploidCallMode() { - return haploidCallMode; - } - - public RelatednessAnalysis setHaploidCallMode(String haploidCallMode) { - this.haploidCallMode = haploidCallMode; - return this; - } - @Override protected void check() throws Exception { super.check(); - setUpStorageEngineExecutor(studyId); + setUpStorageEngineExecutor(study); - if (StringUtils.isEmpty(studyId)) { + if (StringUtils.isEmpty(study)) { throw new ToolException("Missing study."); } try { - studyId = catalogManager.getStudyManager().get(studyId, null, token).first().getFqn(); + studyId = catalogManager.getStudyManager().get(study, null, token).first().getFqn(); } catch (CatalogException e) { throw new ToolException(e); } - // Check family - if (StringUtils.isNotEmpty(familyId)) { - family = IndividualQcUtils.getFamilyById(studyId, familyId, catalogManager, token); - if (family == null) { - throw new ToolException("Family '" + familyId + "' not found."); - } - } +// // Check family +// if (StringUtils.isNotEmpty(relatednessParams.get)) { +// family = IndividualQcUtils.getFamilyById(studyId, familyId, catalogManager, token); +// if (family == null) { +// throw new ToolException("Family '" + familyId + "' not found."); +// } +// } // Check individuals and samples - if (CollectionUtils.isNotEmpty(individualIds) && CollectionUtils.isNotEmpty(sampleIds)) { + if (CollectionUtils.isNotEmpty(relatednessParams.getIndividuals()) && CollectionUtils.isNotEmpty(relatednessParams.getSamples())) { throw new ToolException("Incorrect parameters: only a list of individuals or samples is allowed."); } - if (CollectionUtils.isNotEmpty(individualIds)) { + if (CollectionUtils.isNotEmpty(relatednessParams.getIndividuals())) { // Check and get individual for each ID sampleIds = new ArrayList<>(); - for (String individualId : individualIds) { + for (String individualId : relatednessParams.getIndividuals()) { Sample sample = IndividualQcUtils.getValidSampleByIndividualId(studyId, individualId, catalogManager, token); sampleIds.add(sample.getId()); } @@ -169,12 +116,29 @@ protected void check() throws Exception { throw new ToolException("Member samples not found to execute relatedness analysis."); } + // Checking samples in family + Set familySet = new HashSet<>(); + for (String sampleId : sampleIds) { + Family family = IndividualQcUtils.getFamilyBySampleId(studyId, sampleId, catalogManager, token); + familySet.add(family.getId()); + } + if (familySet.size() > 1) { + throw new ToolException("More than one family found (" + StringUtils.join(familySet, ", ") + ") for the input samples (" + + StringUtils.join(sampleIds, ", ") + ")"); + } + if (familySet.size() == 0) { + throw new ToolException("No family found for the input samples (" + StringUtils.join(sampleIds, ", ") + ")"); + } + family = IndividualQcUtils.getFamilyById(studyId, familySet.stream().collect(Collectors.toList()).get(0), catalogManager, token); + // If the minor allele frequency is missing then set the default value + minorAlleleFreq = relatednessParams.getMinorAlleleFreq(); if (StringUtils.isEmpty(minorAlleleFreq)) { minorAlleleFreq = MAF_DEFAULT_VALUE; } // Check haploid call mode + haploidCallMode = relatednessParams.getHaploidCallMode(); if (StringUtils.isEmpty(haploidCallMode)) { haploidCallMode = RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE; } else { @@ -191,7 +155,7 @@ protected void check() throws Exception { } Path thresholdsPath = getOpencgaHome().resolve("analysis").resolve(FamilyQcAnalysis.ID).resolve("relatedness_thresholds.csv"); - thresholds = AnalysisUtils.parseRelatednessThresholds(thresholdsPath); + relatednessThresholds = AnalysisUtils.parseRelatednessThresholds(thresholdsPath); } @Override @@ -205,7 +169,7 @@ protected void run() throws ToolException { .setSampleIds(sampleIds) .setMinorAlleleFreq(minorAlleleFreq) .setHaploidCallMode(haploidCallMode) - .setThresholds(thresholds) + .setThresholds(relatednessThresholds) .setResourcePath(getOpencgaHome().resolve("analysis/resources").resolve(ID)) .execute(); }); diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/OpenCGATestExternalResource.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/OpenCGATestExternalResource.java index 95f0ef297d5..cec2191aef4 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/OpenCGATestExternalResource.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/OpenCGATestExternalResource.java @@ -260,6 +260,11 @@ public Path isolateOpenCGA() throws IOException { inputStream = new FileInputStream("../opencga-app/app/analysis/pedigree-graph/ped.R"); Files.copy(inputStream, analysisPath.resolve("ped.R"), StandardCopyOption.REPLACE_EXISTING); + // Relatedness analysis + analysisPath = Files.createDirectories(opencgaHome.resolve("analysis/family-qc")).toAbsolutePath(); + inputStream = new FileInputStream("../opencga-app/app/analysis/family-qc/relatedness_thresholds.csv"); + Files.copy(inputStream, analysisPath.resolve("relatedness_thresholds.csv"), StandardCopyOption.REPLACE_EXISTING); + return opencgaHome; } diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java index fafdb74d983..ba94a992d7c 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java @@ -18,6 +18,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.mutable.MutableInt; import org.hamcrest.CoreMatchers; import org.junit.*; @@ -27,10 +28,7 @@ import org.junit.runners.Parameterized; import org.opencb.biodata.models.clinical.Disorder; import org.opencb.biodata.models.clinical.Phenotype; -import org.opencb.biodata.models.clinical.qc.HRDetect; -import org.opencb.biodata.models.clinical.qc.SampleQcVariantStats; -import org.opencb.biodata.models.clinical.qc.Signature; -import org.opencb.biodata.models.clinical.qc.SignatureFitting; +import org.opencb.biodata.models.clinical.qc.*; import org.opencb.biodata.models.core.SexOntologyTermAnnotation; import org.opencb.biodata.models.variant.StudyEntry; import org.opencb.biodata.models.variant.avro.VariantType; @@ -39,6 +37,7 @@ import org.opencb.commons.datastore.core.Query; import org.opencb.commons.datastore.core.QueryOptions; import org.opencb.opencga.TestParamConstants; +import org.opencb.opencga.analysis.family.qc.FamilyQcAnalysis; import org.opencb.opencga.analysis.tools.ToolRunner; import org.opencb.opencga.analysis.variant.gwas.GwasAnalysis; import org.opencb.opencga.analysis.variant.hrdetect.HRDetectAnalysis; @@ -46,10 +45,12 @@ import org.opencb.opencga.analysis.variant.manager.VariantStorageManager; import org.opencb.opencga.analysis.variant.mutationalSignature.MutationalSignatureAnalysis; import org.opencb.opencga.analysis.variant.operations.VariantIndexOperationTool; +import org.opencb.opencga.analysis.variant.relatedness.RelatednessAnalysis; import org.opencb.opencga.analysis.variant.samples.SampleEligibilityAnalysis; import org.opencb.opencga.analysis.variant.stats.CohortVariantStatsAnalysis; import org.opencb.opencga.analysis.variant.stats.SampleVariantStatsAnalysis; import org.opencb.opencga.analysis.variant.stats.VariantStatsAnalysis; +import org.opencb.opencga.catalog.db.api.IndividualDBAdaptor; import org.opencb.opencga.catalog.db.api.SampleDBAdaptor; import org.opencb.opencga.catalog.exceptions.CatalogException; import org.opencb.opencga.catalog.managers.AnnotationSetManager; @@ -1063,6 +1064,49 @@ public void testPedigreeGraph() throws CatalogException { assertEquals(base64, family.getPedigreeGraph().getBase64()); } + @Test + public void testFamilyQc() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_familyqc")); + + FamilyQcAnalysisParams params = new FamilyQcAnalysisParams(); + params.setFamily("f1"); + params.setRelatednessMaf("1000G:ALL>0.1"); + + System.out.println("Family QC out dir = " + outDir.toAbsolutePath()); + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + System.out.println("Family QC out dir = " + outDir.toAbsolutePath()); + + + OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); + Family family = results.first(); + RelatednessReport relatednessReport = family.getQualityControl().getRelatedness().get(0); + assertEquals(params.getRelatednessMaf(), relatednessReport.getMaf()); + assertEquals(RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE, relatednessReport.getHaploidCallMode()); + } + + @Test + public void testRelatedness() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_relatedness")); + + Query query = new Query(IndividualDBAdaptor.QueryParams.FAMILY_IDS.key(), Collections.singletonList("f1")); + QueryOptions queryOptions = new QueryOptions(QueryOptions.INCLUDE, "id"); + OpenCGAResult results = catalogManager.getIndividualManager().search(STUDY, query, queryOptions, token); + List individualIds = results.getResults().stream().map(Individual::getId).collect(Collectors.toList()); + + RelatednessAnalysisParams params = new RelatednessAnalysisParams(); + params.setIndividuals(individualIds); + params.setMinorAlleleFreq("1000G:ALL>0.2"); + params.setHaploidCallMode(RelatednessReport.HAPLOID_CALL_MODE_MISSING_VALUE); + + System.out.println("Relatedness out dir = " + outDir.toAbsolutePath()); + toolRunner.execute(RelatednessAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + System.out.println("Relatedness out dir = " + outDir.toAbsolutePath()); + + RelatednessReport relatednessReport = JacksonUtils.getDefaultObjectMapper().readValue(outDir.resolve("relatedness.report.json").toFile(), RelatednessReport.class); + assertEquals(params.getMinorAlleleFreq(), relatednessReport.getMaf()); + assertEquals(params.getHaploidCallMode(), relatednessReport.getHaploidCallMode()); + } + @Test public void testCellbaseConfigure() throws Exception { String project = "Project_test_cellbase_configure"; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java index 284fdb4a538..9a35fca5bac 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java @@ -892,35 +892,29 @@ private void inferredSex() throws Exception { private void relatedness() throws Exception { VariantCommandOptions.RelatednessCommandOptions cliOptions = variantCommandOptions.relatednessCommandOptions; - ObjectMap params = new ObjectMap(); - params.putAll(cliOptions.commonOptions.params); - RelatednessAnalysis relatednessAnalysis = new RelatednessAnalysis(); - relatednessAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); - relatednessAnalysis.setStudyId(cliOptions.study) - .setIndividualIds(cliOptions.individuals) - .setSampleIds(cliOptions.samples) - .setMinorAlleleFreq(cliOptions.minorAlleleFreq) - .setHaploidCallMode(cliOptions.haploidCallMode) - .setMethod(cliOptions.method) - .start(); + ObjectMap params = new RelatednessAnalysisParams( + cliOptions.individuals, + cliOptions.samples, + cliOptions.minorAlleleFreq, + cliOptions.haploidCallMode, + cliOptions.outdir) + .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); + + toolRunner.execute(RelatednessAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); } private void familyQc() throws Exception { VariantCommandOptions.FamilyQcCommandOptions cliOptions = variantCommandOptions.familyQcCommandOptions; - ObjectMap params = new ObjectMap(); - params.putAll(cliOptions.commonOptions.params); - FamilyQcAnalysis familyQcAnalysis = new FamilyQcAnalysis(); - familyQcAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); - familyQcAnalysis.setStudyId(cliOptions.study) - .setFamilyId(cliOptions.family) - .setRelatednessMethod(cliOptions.relatednessMethod) - .setRelatednessMaf(cliOptions.relatednessMaf) - .setHaploidCallMode(cliOptions.haploidCallMode) - .start(); + ObjectMap params = new FamilyQcAnalysisParams( + cliOptions.family, + cliOptions.relatednessMaf, + cliOptions.haploidCallMode, + cliOptions.outdir) + .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); + + toolRunner.execute(FamilyQcAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); } private void individualQc() throws Exception { diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java index f40e85fb91b..4ca35883ca6 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/variant/RelatednessAnalysisParams.java @@ -26,7 +26,7 @@ import static org.opencb.biodata.models.constants.FieldConstants.RELATEDNESS_REPORT_MAF_DESCRIPTION; public class RelatednessAnalysisParams extends ToolParams { - public static final String DESCRIPTION = "Relatedness analysis params based on PLINK/IBD method"; + public static final String DESCRIPTION = "Relatedness analysis params."; @DataField(id = "individuals", description = "List of individuals (separated by commas)") private List individuals; From 5644023ee6595e900824199610731fa3d753115c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Thu, 13 Jun 2024 16:28:06 +0200 Subject: [PATCH 4/6] test: add JUnit tests for the family-qc and relatedness analysis, #TASK-5282, #TASK-5278 On branch TASK-5278 Changes to be committed: modified: opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java --- .../analysis/variant/VariantAnalysisTest.java | 132 +++++++++++++++++- 1 file changed, 126 insertions(+), 6 deletions(-) diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java index b61839bd90b..980a30011c7 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java @@ -108,6 +108,7 @@ import static org.hamcrest.CoreMatchers.hasItem; import static org.junit.Assert.*; +import static org.opencb.biodata.models.clinical.qc.RelatednessReport.*; import static org.opencb.opencga.storage.core.variant.VariantStorageBaseTest.getResourceUri; @RunWith(Parameterized.class) @@ -1073,28 +1074,83 @@ public void testPedigreeGraph() throws CatalogException { } @Test - public void testFamilyQc() throws Exception { - Path outDir = Paths.get(opencga.createTmpOutdir("_familyqc")); + public void testFamilyQcDefaultHaploidCall() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_familyqc_default_haploid_call")); FamilyQcAnalysisParams params = new FamilyQcAnalysisParams(); params.setFamily("f1"); params.setRelatednessMaf("1000G:ALL>0.1"); + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + + OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); + Family family = results.first(); + RelatednessReport relatednessReport = family.getQualityControl().getRelatedness().get(0); + assertEquals(params.getRelatednessMaf(), relatednessReport.getMaf()); + assertEquals(RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE, relatednessReport.getHaploidCallMode()); System.out.println("Family QC out dir = " + outDir.toAbsolutePath()); + } + + @Test + public void testFamilyQcHaploidCall() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_familyqc_haploid_call")); + + FamilyQcAnalysisParams params = new FamilyQcAnalysisParams(); + params.setFamily("f1"); + params.setRelatednessMaf("1000G:ALL>0.1"); + params.setHaploidCallMode(HAPLOID_CALL_MODE_HAPLOID_VALUE); + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + + OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); + Family family = results.first(); + RelatednessReport relatednessReport = family.getQualityControl().getRelatedness().get(0); + assertEquals(params.getRelatednessMaf(), relatednessReport.getMaf()); + assertEquals(params.getHaploidCallMode(), relatednessReport.getHaploidCallMode()); System.out.println("Family QC out dir = " + outDir.toAbsolutePath()); + } + + @Test + public void testFamilyQcMissingHaploidCall() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_familyqc_missing_call")); + FamilyQcAnalysisParams params = new FamilyQcAnalysisParams(); + params.setFamily("f1"); + params.setRelatednessMaf("1000G:ALL>0.1"); + params.setHaploidCallMode(HAPLOID_CALL_MODE_MISSING_VALUE); + + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); Family family = results.first(); RelatednessReport relatednessReport = family.getQualityControl().getRelatedness().get(0); assertEquals(params.getRelatednessMaf(), relatednessReport.getMaf()); - assertEquals(RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE, relatednessReport.getHaploidCallMode()); + assertEquals(params.getHaploidCallMode(), relatednessReport.getHaploidCallMode()); + System.out.println("Family QC out dir = " + outDir.toAbsolutePath()); + } + + @Test + public void testFamilyQcReferenceHaploidCall() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_familyqc_ref_haploid_call")); + + FamilyQcAnalysisParams params = new FamilyQcAnalysisParams(); + params.setFamily("f1"); + params.setRelatednessMaf("1000G:ALL>0.1"); + params.setHaploidCallMode(HAPLOID_CALL_MODE_REF_VALUE); + + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + + OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); + Family family = results.first(); + RelatednessReport relatednessReport = family.getQualityControl().getRelatedness().get(0); + assertEquals(params.getRelatednessMaf(), relatednessReport.getMaf()); + assertEquals(params.getHaploidCallMode(), relatednessReport.getHaploidCallMode()); + System.out.println("Family QC out dir = " + outDir.toAbsolutePath()); } @Test - public void testRelatedness() throws Exception { - Path outDir = Paths.get(opencga.createTmpOutdir("_relatedness")); + public void testRelatednessDefaultHaploidCall() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_relatedness_default_haploid_call")); Query query = new Query(IndividualDBAdaptor.QueryParams.FAMILY_IDS.key(), Collections.singletonList("f1")); QueryOptions queryOptions = new QueryOptions(QueryOptions.INCLUDE, "id"); @@ -1104,15 +1160,79 @@ public void testRelatedness() throws Exception { RelatednessAnalysisParams params = new RelatednessAnalysisParams(); params.setIndividuals(individualIds); params.setMinorAlleleFreq("1000G:ALL>0.2"); - params.setHaploidCallMode(RelatednessReport.HAPLOID_CALL_MODE_MISSING_VALUE); + toolRunner.execute(RelatednessAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + + RelatednessReport relatednessReport = JacksonUtils.getDefaultObjectMapper().readValue(outDir.resolve("relatedness.report.json").toFile(), RelatednessReport.class); + assertEquals(params.getMinorAlleleFreq(), relatednessReport.getMaf()); + assertEquals(HAPLOID_CALL_MODE_DEFAUT_VALUE, relatednessReport.getHaploidCallMode()); System.out.println("Relatedness out dir = " + outDir.toAbsolutePath()); + } + + @Test + public void testRelatednessHaploidCall() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_relatedness_haploid_call")); + + Query query = new Query(IndividualDBAdaptor.QueryParams.FAMILY_IDS.key(), Collections.singletonList("f1")); + QueryOptions queryOptions = new QueryOptions(QueryOptions.INCLUDE, "id"); + OpenCGAResult results = catalogManager.getIndividualManager().search(STUDY, query, queryOptions, token); + List individualIds = results.getResults().stream().map(Individual::getId).collect(Collectors.toList()); + + RelatednessAnalysisParams params = new RelatednessAnalysisParams(); + params.setIndividuals(individualIds); + params.setMinorAlleleFreq("1000G:ALL>0.2"); + params.setHaploidCallMode(RelatednessReport.HAPLOID_CALL_MODE_HAPLOID_VALUE); + + toolRunner.execute(RelatednessAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + + RelatednessReport relatednessReport = JacksonUtils.getDefaultObjectMapper().readValue(outDir.resolve("relatedness.report.json").toFile(), RelatednessReport.class); + assertEquals(params.getMinorAlleleFreq(), relatednessReport.getMaf()); + assertEquals(params.getHaploidCallMode(), relatednessReport.getHaploidCallMode()); + System.out.println("Relatedness out dir = " + outDir.toAbsolutePath()); + } + + @Test + public void testRelatednessReferenceHaploidCall() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_relatedness_ref_haploid_call")); + + Query query = new Query(IndividualDBAdaptor.QueryParams.FAMILY_IDS.key(), Collections.singletonList("f1")); + QueryOptions queryOptions = new QueryOptions(QueryOptions.INCLUDE, "id"); + OpenCGAResult results = catalogManager.getIndividualManager().search(STUDY, query, queryOptions, token); + List individualIds = results.getResults().stream().map(Individual::getId).collect(Collectors.toList()); + + RelatednessAnalysisParams params = new RelatednessAnalysisParams(); + params.setIndividuals(individualIds); + params.setMinorAlleleFreq("1000G:ALL>0.2"); + params.setHaploidCallMode(HAPLOID_CALL_MODE_REF_VALUE); + toolRunner.execute(RelatednessAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + + RelatednessReport relatednessReport = JacksonUtils.getDefaultObjectMapper().readValue(outDir.resolve("relatedness.report.json").toFile(), RelatednessReport.class); + assertEquals(params.getMinorAlleleFreq(), relatednessReport.getMaf()); + assertEquals(params.getHaploidCallMode(), relatednessReport.getHaploidCallMode()); System.out.println("Relatedness out dir = " + outDir.toAbsolutePath()); + } + + @Test + public void testRelatednessMissingHaploidCall() throws Exception { + Path outDir = Paths.get(opencga.createTmpOutdir("_relatedness_missing_haploid_call")); + + Query query = new Query(IndividualDBAdaptor.QueryParams.FAMILY_IDS.key(), Collections.singletonList("f1")); + QueryOptions queryOptions = new QueryOptions(QueryOptions.INCLUDE, "id"); + OpenCGAResult results = catalogManager.getIndividualManager().search(STUDY, query, queryOptions, token); + List individualIds = results.getResults().stream().map(Individual::getId).collect(Collectors.toList()); + + RelatednessAnalysisParams params = new RelatednessAnalysisParams(); + params.setIndividuals(individualIds); + params.setMinorAlleleFreq("1000G:ALL>0.2"); + params.setHaploidCallMode(RelatednessReport.HAPLOID_CALL_MODE_MISSING_VALUE); + + toolRunner.execute(RelatednessAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); RelatednessReport relatednessReport = JacksonUtils.getDefaultObjectMapper().readValue(outDir.resolve("relatedness.report.json").toFile(), RelatednessReport.class); assertEquals(params.getMinorAlleleFreq(), relatednessReport.getMaf()); assertEquals(params.getHaploidCallMode(), relatednessReport.getHaploidCallMode()); + System.out.println("Relatedness out dir = " + outDir.toAbsolutePath()); } public void testClinicalAnalysisLoading() throws IOException, ToolException, CatalogException { From 8da3dea21d74209a3c1f39574bac1e449c591b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Thu, 13 Jun 2024 16:40:07 +0200 Subject: [PATCH 5/6] test: fix JUnit tests, #TASK-5282, #TASK-5278 On branch TASK-5278 Changes to be committed: modified: opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java --- .../analysis/variant/VariantAnalysisTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java index 980a30011c7..45bf0d65871 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java @@ -70,6 +70,8 @@ import org.opencb.opencga.core.models.cohort.CohortUpdateParams; import org.opencb.opencga.core.models.common.AnnotationSet; import org.opencb.opencga.core.models.family.Family; +import org.opencb.opencga.core.models.family.FamilyQualityControl; +import org.opencb.opencga.core.models.family.FamilyUpdateParams; import org.opencb.opencga.core.models.file.File; import org.opencb.opencga.core.models.individual.Individual; import org.opencb.opencga.core.models.individual.IndividualInternal; @@ -1081,6 +1083,10 @@ public void testFamilyQcDefaultHaploidCall() throws Exception { params.setFamily("f1"); params.setRelatednessMaf("1000G:ALL>0.1"); + // Reset family QC + catalogManager.getFamilyManager().update(STUDY, params.getFamily(), new FamilyUpdateParams() + .setQualityControl(new FamilyQualityControl()), new QueryOptions(), token); + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); @@ -1100,6 +1106,10 @@ public void testFamilyQcHaploidCall() throws Exception { params.setRelatednessMaf("1000G:ALL>0.1"); params.setHaploidCallMode(HAPLOID_CALL_MODE_HAPLOID_VALUE); + // Reset family QC + catalogManager.getFamilyManager().update(STUDY, params.getFamily(), new FamilyUpdateParams() + .setQualityControl(new FamilyQualityControl()), new QueryOptions(), token); + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); @@ -1119,6 +1129,10 @@ public void testFamilyQcMissingHaploidCall() throws Exception { params.setRelatednessMaf("1000G:ALL>0.1"); params.setHaploidCallMode(HAPLOID_CALL_MODE_MISSING_VALUE); + // Reset family QC + catalogManager.getFamilyManager().update(STUDY, params.getFamily(), new FamilyUpdateParams() + .setQualityControl(new FamilyQualityControl()), new QueryOptions(), token); + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); @@ -1138,6 +1152,10 @@ public void testFamilyQcReferenceHaploidCall() throws Exception { params.setRelatednessMaf("1000G:ALL>0.1"); params.setHaploidCallMode(HAPLOID_CALL_MODE_REF_VALUE); + // Reset family QC + catalogManager.getFamilyManager().update(STUDY, params.getFamily(), new FamilyUpdateParams() + .setQualityControl(new FamilyQualityControl()), new QueryOptions(), token); + toolRunner.execute(FamilyQcAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); OpenCGAResult results = catalogManager.getFamilyManager().search(STUDY, new Query("id", "f1"), QueryOptions.empty(), token); From a222469d37c8d34a8a85fad4c4eeb5dd2e050e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Thu, 13 Jun 2024 16:40:55 +0200 Subject: [PATCH 6/6] analysis: remove unused parameter 'relatedness method', #TASK-5282, #TASK-5282 On branch TASK-5278 Changes to be committed: modified: opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java modified: opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java modified: opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/VariantCommandOptions.java modified: opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java modified: opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java --- .../family/qc/FamilyQcLocalAnalysisExecutor.java | 6 +++--- .../opencga/analysis/family/qc/IBDComputation.java | 4 +++- .../cli/internal/options/VariantCommandOptions.java | 3 --- .../org/opencb/opencga/core/api/ParamConstants.java | 1 - .../core/tools/variant/FamilyQcAnalysisExecutor.java | 10 ---------- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java index 1494dab5e2f..e19608bb184 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/FamilyQcLocalAnalysisExecutor.java @@ -66,10 +66,10 @@ private void runRelatedness() throws ToolException { if (CollectionUtils.isNotEmpty(qualityControl.getRelatedness())) { for (RelatednessReport relatedness : qualityControl.getRelatedness()) { - if (relatednessMethod.equals(relatedness.getMethod()) && relatednessMaf.equals(relatedness.getMaf())) { + if (IBDComputation.PLINK_IBD_METHOD.equals(relatedness.getMethod()) && relatednessMaf.equals(relatedness.getMaf())) { // Nothing to update - addWarning("Skipping relatedness analysis: it was already computed for method '" + relatednessMethod + "' and MAF '" - + relatednessMaf + "'"); + addWarning("Skipping relatedness analysis: it was already computed for method '" + IBDComputation.PLINK_IBD_METHOD + + "' and MAF '" + relatednessMaf + "'"); qualityControl = null; return; } diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java index 18e4b925e03..2d677a0812b 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/qc/IBDComputation.java @@ -57,6 +57,8 @@ public class IBDComputation { private static final String FREQ_FILENAME = BASENAME + ".frq"; private static final String PRUNE_IN_FILENAME = BASENAME + ".prune.in"; + public static final String PLINK_IBD_METHOD = "PLINK/IBD"; + public static RelatednessReport compute(String study, Family family, List samples, String maf, String haploidCallMode, Map> thresholds, Path resourcesPath, Path outDir, VariantStorageManager storageManager, String token) throws ToolException { @@ -142,7 +144,7 @@ public static RelatednessReport compute(String study, Family family, List0.05") public String relatednessMaf = "cohort:ALL>0.05"; diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java b/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java index 6bf964e760f..3cfa253afa0 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java @@ -1197,7 +1197,6 @@ public class ParamConstants { public static final String ANALYSIS_VARIANT_RELATEDNESS_RUN_METHOD = "The body web service method parameter"; public static final String ANALYSIS_VARIANT_RELATEDNESS_RUN_OUTDIR = "The body web service outdir parameter"; public static final String ANALYSIS_VARIANT_FAMILY_QC_RUN_FAMILY = "The body web service family parameter"; - public static final String ANALYSIS_VARIANT_FAMILY_QC_RUN_RELATEDNESSMETHOD = "The body web service relatednessMethod parameter"; public static final String ANALYSIS_VARIANT_FAMILY_QC_RUN_RELATEDNESSMAF = "The body web service relatednessMaf parameter"; public static final String ANALYSIS_VARIANT_FAMILY_QC_RUN_OUTDIR = "The body web service outdir parameter"; public static final String ANALYSIS_VARIANT_INDIVIDUAL_QC_RUN_INDIVIDUAL = "The body web service individual parameter"; diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java b/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java index 0383de0156c..dad8f5bfecc 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/tools/variant/FamilyQcAnalysisExecutor.java @@ -31,7 +31,6 @@ public enum QcType { protected String studyId; protected Family family; - protected String relatednessMethod; protected String relatednessMaf; protected String haploidCallMode; protected Map> relatednessThresholds; @@ -62,15 +61,6 @@ public FamilyQcAnalysisExecutor setFamily(Family family) { return this; } - public String getRelatednessMethod() { - return relatednessMethod; - } - - public FamilyQcAnalysisExecutor setRelatednessMethod(String relatednessMethod) { - this.relatednessMethod = relatednessMethod; - return this; - } - public String getRelatednessMaf() { return relatednessMaf; }