Skip to content

Commit

Permalink
models: add the haploid call mode into the relatedness report, #TASK-…
Browse files Browse the repository at this point in the history
…5282, #TASK-5278
  • Loading branch information
jtarraga committed Nov 21, 2023
1 parent 6fca9b1 commit 7425629
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

public class RelatednessReport {

public static final String HAPLOID_CALL_MODE_HAPLOID_VALUE = "haploid";
public static final String HAPLOID_CALL_MODE_MISSING_VALUE = "missing";
public static final String HAPLOID_CALL_MODE_REF_VALUE = "reference";
public static final String HAPLOID_CALL_MODE_DEFAUT_VALUE = HAPLOID_CALL_MODE_HAPLOID_VALUE;

// Method., e.g.: Plink/IBD
@DataField(id = "method",
description = FieldConstants.RELATEDNESS_REPORT_METHOD_DESCRIPTION)
Expand All @@ -37,6 +42,11 @@ public class RelatednessReport {
description = FieldConstants.RELATEDNESS_REPORT_MAF_DESCRIPTION)
private String maf;

// Haploid call mode, i.e., the PLINK/IBD parameter: vcf-half-call
@DataField(id = "haploidCallMode",
description = FieldConstants.RELATEDNESS_REPORT_HAPLOID_CALL_MODE_DESCRIPTION)
private String haploidCallMode;

// Relatedness scores for pair of samples
@DataField(id = "scores", uncommentedClasses = {"RelatednessScore"},
description = FieldConstants.RELATEDNESS_REPORT_SCORES_DESCRIPTION)
Expand All @@ -47,12 +57,13 @@ public class RelatednessReport {
private List<String> files;

public RelatednessReport() {
this("PLINK/IBD", "cohort:ALL>0.05", new ArrayList<>(), new ArrayList<>());
this("PLINK/IBD", "cohort:ALL>0.05", HAPLOID_CALL_MODE_DEFAUT_VALUE, new ArrayList<>(), new ArrayList<>());
}

public RelatednessReport(String method, String maf, List<RelatednessScore> scores, List<String> files) {
public RelatednessReport(String method, String maf, String haploidCallMode, List<RelatednessScore> scores, List<String> files) {
this.method = method;
this.maf = maf;
this.haploidCallMode = haploidCallMode;
this.scores = scores;
this.files = files;
}
Expand All @@ -62,6 +73,7 @@ public String toString() {
final StringBuilder sb = new StringBuilder("RelatednessReport{");
sb.append("method='").append(method).append('\'');
sb.append(", maf='").append(maf).append('\'');
sb.append(", haploidCallMode='").append(haploidCallMode).append('\'');
sb.append(", scores=").append(scores);
sb.append(", files=").append(files);
sb.append('}');
Expand All @@ -86,6 +98,15 @@ public RelatednessReport setMaf(String maf) {
return this;
}

public String getHaploidCallMode() {
return haploidCallMode;
}

public RelatednessReport setHaploidCallMode(String haploidCallMode) {
this.haploidCallMode = haploidCallMode;
return this;
}

public List<RelatednessScore> getScores() {
return scores;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.opencb.biodata.models.constants;

import org.opencb.biodata.models.clinical.qc.RelatednessReport;

public class FieldConstants {
public static final String PHENOTYPE_AGE_OF_ON_SET = "Indicates the age of on set of the phenotype";
public static final String PHENOTYPE_STATUS = "Status of phenotype OBSERVED, NOT_OBSERVED, UNKNOWN";
Expand Down Expand Up @@ -55,7 +57,11 @@ public class FieldConstants {
public static final String CLINICAL_CONFIDENCE_DATE_DESCRIPTION = "Date of the clinical confidence";
public static final String CLINICAL_CONFIDENCE_VALUE_DESCRIPTION = "Date of the clinical confidence";

public static final String RELATEDNESS_REPORT_MAF_DESCRIPTION = "Minor allele frequency to filter variants, e.g.: 1kg_phase3:CEU>0.35, cohort:ALL>0.05";
public static final String RELATEDNESS_REPORT_MAF_DESCRIPTION = "Minor allele frequency to filter variants, e.g.: 1kg_phase3:CEU>0.35,"
+ " cohort:ALL>0.05";
public static final String RELATEDNESS_REPORT_HAPLOID_CALL_MODE_DESCRIPTION = "Haploid call mode, equivalent to the PLINK/IBD parameter"
+ " vcf-half-call, accepts the following values: " + RelatednessReport.HAPLOID_CALL_MODE_DEFAUT_VALUE + ", "
+ RelatednessReport.HAPLOID_CALL_MODE_MISSING_VALUE + " and " + RelatednessReport.HAPLOID_CALL_MODE_REF_VALUE;
public static final String RELATEDNESS_REPORT_SCORES_DESCRIPTION = "Relatedness scores for pair of samples";
public static final String RELATEDNESS_REPORT_FILES_DESCRIPTION = "List of files of Relatedness Report";

Expand All @@ -67,7 +73,8 @@ public class FieldConstants {
public static final String AUDIT_MESSAGE_DESCRIPTION = "Audit message";
public static final String AUDIT_ACTION_DESCRIPTION = "Enum action that can have the values "
+ " CREATE_CLINICAL_ANALYSIS, CREATE_INTERPRETATION, UPDATE_CLINICAL_ANALYSIS, DELETE_CLINICAL_ANALYSIS,"
+ " UPDATE_INTERPRETATION, REVERT_INTERPRETATION, CLEAR_INTERPRETATION, MERGE_INTERPRETATION, SWAP_INTERPRETATION and DELETE_INTERPRETATION";
+ " UPDATE_INTERPRETATION, REVERT_INTERPRETATION, CLEAR_INTERPRETATION, MERGE_INTERPRETATION, SWAP_INTERPRETATION and"
+ " DELETE_INTERPRETATION";
public static final String AUDIT_DATE_DESCRIPTION = "Date of the audit";

public static final String SOFTWARE_NAME = "Software name";
Expand All @@ -76,5 +83,5 @@ public class FieldConstants {
public static final String SOFTWARE_COMMIT = "Software commit";
public static final String SOFTWARE_WEBSITE = "Software website";
public static final String SOFTWARE_PARAMS = "Software params";

}

0 comments on commit 7425629

Please sign in to comment.