Skip to content

Commit b1b8939

Browse files
Merge branch 'develop' into TASK-6757
2 parents dc61a00 + ad003fb commit b1b8939

File tree

140 files changed

+4231
-1869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+4231
-1869
lines changed

.github/workflows/pull-request-approved.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
echo "github.event.pull_request.head.ref: ${{ github.event.pull_request.head.ref }}"
2727
xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh ${{ github.event.pull_request.base.ref }})
2828
echo "__Xetabase ref:__ \"${xetabase_branch}\"" | tee -a ${GITHUB_STEP_SUMMARY}
29+
echo "xetabase_branch: ${xetabase_branch}"
2930
echo "xetabase_branch=${xetabase_branch}" >> $GITHUB_OUTPUT
3031
env:
3132
ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}

.github/workflows/scripts/get-xetabase-branch.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ get_xetabase_branch() {
88
# If the branch begins with 'TASK' and exists in the opencga-enterprise repository, I return it
99
if [[ $input_branch == TASK* ]]; then
1010
if [ "$(git ls-remote "https://$ZETTA_REPO_ACCESS_TOKEN@github.com/zetta-genomics/opencga-enterprise.git" "$input_branch" )" ] ; then
11-
echo $input_branch;
11+
echo "$input_branch";
1212
return 0;
1313
fi
1414
fi

opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/manager/VariantCatalogQueryUtils.java

+15-39
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import org.opencb.opencga.core.models.sample.SamplePermissions;
5757
import org.opencb.opencga.core.models.study.Study;
5858
import org.opencb.opencga.core.models.user.UserFilter;
59+
import org.opencb.opencga.core.models.variant.VariantQueryParams;
5960
import org.opencb.opencga.core.response.OpenCGAResult;
6061
import org.opencb.opencga.storage.core.exceptions.StorageEngineException;
6162
import org.opencb.opencga.storage.core.metadata.VariantStorageMetadataManager;
@@ -89,70 +90,45 @@
8990
*/
9091
public class VariantCatalogQueryUtils extends CatalogUtils {
9192

92-
public static final String SAMPLE_ANNOTATION_DESC =
93-
"Selects some samples using metadata information from Catalog. e.g. age>20;phenotype=hpo:123,hpo:456;name=smith";
9493
public static final QueryParam SAMPLE_ANNOTATION
95-
= QueryParam.create("sampleAnnotation", SAMPLE_ANNOTATION_DESC, QueryParam.Type.TEXT_ARRAY);
96-
public static final String PROJECT_DESC = ParamConstants.PROJECT_DESCRIPTION;
97-
public static final QueryParam PROJECT = QueryParam.create(ParamConstants.PROJECT_PARAM, PROJECT_DESC, QueryParam.Type.TEXT_ARRAY);
94+
= QueryParam.create("sampleAnnotation", VariantQueryParams.SAMPLE_ANNOTATION_DESC, QueryParam.Type.TEXT_ARRAY);
95+
public static final QueryParam PROJECT = QueryParam.create(ParamConstants.PROJECT_PARAM, VariantQueryParams.PROJECT_DESC, QueryParam.Type.TEXT_ARRAY);
9896

99-
public static final String FAMILY_DESC = "Filter variants where any of the samples from the given family contains the variant "
100-
+ "(HET or HOM_ALT)";
10197
public static final QueryParam FAMILY =
102-
QueryParam.create("family", FAMILY_DESC, QueryParam.Type.TEXT);
103-
public static final String FAMILY_MEMBERS_DESC = "Sub set of the members of a given family";
98+
QueryParam.create("family", VariantQueryParams.FAMILY_DESC, QueryParam.Type.TEXT);
10499
public static final QueryParam FAMILY_MEMBERS =
105-
QueryParam.create("familyMembers", FAMILY_MEMBERS_DESC, QueryParam.Type.TEXT);
106-
public static final String FAMILY_DISORDER_DESC = "Specify the disorder to use for the family segregation";
100+
QueryParam.create("familyMembers", VariantQueryParams.FAMILY_MEMBERS_DESC, QueryParam.Type.TEXT);
107101
public static final QueryParam FAMILY_DISORDER =
108-
QueryParam.create("familyDisorder", FAMILY_DISORDER_DESC, QueryParam.Type.TEXT);
109-
public static final String FAMILY_PROBAND_DESC = "Specify the proband child to use for the family segregation";
102+
QueryParam.create("familyDisorder", VariantQueryParams.FAMILY_DISORDER_DESC, QueryParam.Type.TEXT);
110103
public static final QueryParam FAMILY_PROBAND =
111-
QueryParam.create("familyProband", FAMILY_PROBAND_DESC, QueryParam.Type.TEXT);
112-
public static final String FAMILY_SEGREGATION_DESCR = "Filter by segregation mode from a given family. Accepted values: "
113-
+ "[ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, "
114-
+ "deNovo, deNovoStrict, mendelianError, compoundHeterozygous ]";
104+
QueryParam.create("familyProband", VariantQueryParams.FAMILY_PROBAND_DESC, QueryParam.Type.TEXT);
115105
public static final QueryParam FAMILY_SEGREGATION =
116-
QueryParam.create("familySegregation", FAMILY_SEGREGATION_DESCR, QueryParam.Type.TEXT);
106+
QueryParam.create("familySegregation", VariantQueryParams.FAMILY_SEGREGATION_DESCR, QueryParam.Type.TEXT);
117107

118-
public static final String SAVED_FILTER_DESCR = "Use a saved filter at User level";
119108
public static final QueryParam SAVED_FILTER =
120-
QueryParam.create("savedFilter", SAVED_FILTER_DESCR, QueryParam.Type.TEXT);
109+
QueryParam.create("savedFilter", VariantQueryParams.SAVED_FILTER_DESCR, QueryParam.Type.TEXT);
121110

122111
@Deprecated
123112
public static final QueryParam FAMILY_PHENOTYPE = FAMILY_DISORDER;
124113
@Deprecated
125114
public static final QueryParam MODE_OF_INHERITANCE = FAMILY_SEGREGATION;
126115

127-
public static final String PANEL_DESC = "Filter by genes from the given disease panel";
128116
public static final QueryParam PANEL =
129-
QueryParam.create("panel", PANEL_DESC, QueryParam.Type.TEXT);
130-
public static final String PANEL_MOI_DESC = "Filter genes from specific panels that match certain mode of inheritance. " +
131-
"Accepted values : "
132-
+ "[ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, "
133-
+ "deNovo, mendelianError, compoundHeterozygous ]";
117+
QueryParam.create("panel", VariantQueryParams.PANEL_DESC, QueryParam.Type.TEXT);
134118
public static final QueryParam PANEL_MODE_OF_INHERITANCE =
135-
QueryParam.create("panelModeOfInheritance", PANEL_MOI_DESC
119+
QueryParam.create("panelModeOfInheritance", VariantQueryParams.PANEL_MOI_DESC
136120
, QueryParam.Type.TEXT);
137-
public static final String PANEL_CONFIDENCE_DESC = "Filter genes from specific panels that match certain confidence. " +
138-
"Accepted values : [ high, medium, low, rejected ]";
139121
public static final QueryParam PANEL_CONFIDENCE =
140-
QueryParam.create("panelConfidence", PANEL_CONFIDENCE_DESC, QueryParam.Type.TEXT);
122+
QueryParam.create("panelConfidence", VariantQueryParams.PANEL_CONFIDENCE_DESC, QueryParam.Type.TEXT);
141123

142-
public static final String PANEL_INTERSECTION_DESC = "Intersect panel genes and regions with given "
143-
+ "genes and regions from que input query. This will prevent returning variants from regions out of the panel.";
144124
public static final QueryParam PANEL_INTERSECTION =
145-
QueryParam.create("panelIntersection", PANEL_INTERSECTION_DESC, Type.BOOLEAN);
125+
QueryParam.create("panelIntersection", VariantQueryParams.PANEL_INTERSECTION_DESC, Type.BOOLEAN);
146126

147-
public static final String PANEL_ROLE_IN_CANCER_DESC = "Filter genes from specific panels that match certain role in cancer. " +
148-
"Accepted values : [ both, oncogene, tumorSuppressorGene, fusion ]";
149127
public static final QueryParam PANEL_ROLE_IN_CANCER =
150-
QueryParam.create("panelRoleInCancer", PANEL_ROLE_IN_CANCER_DESC, QueryParam.Type.TEXT);
128+
QueryParam.create("panelRoleInCancer", VariantQueryParams.PANEL_ROLE_IN_CANCER_DESC, QueryParam.Type.TEXT);
151129

152-
public static final String PANEL_FEATURE_TYPE_DESC = "Filter elements from specific panels by type. " +
153-
"Accepted values : [ gene, region, str, variant ]";
154130
public static final QueryParam PANEL_FEATURE_TYPE =
155-
QueryParam.create("panelFeatureType", PANEL_FEATURE_TYPE_DESC, QueryParam.Type.TEXT);
131+
QueryParam.create("panelFeatureType", VariantQueryParams.PANEL_FEATURE_TYPE_DESC, QueryParam.Type.TEXT);
156132

157133
public static final List<QueryParam> VARIANT_CATALOG_QUERY_PARAMS = Arrays.asList(
158134
SAMPLE_ANNOTATION,

opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/manager/VariantStorageManager.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,16 @@ public OpenCGAResult<Job> configureSampleIndex(String studyStr, SampleIndexConfi
555555
boolean skipRebuild, String token)
556556
throws CatalogException, StorageEngineException {
557557
return secureOperation("configure", studyStr, new ObjectMap(), token, engine -> {
558-
String version = engine.getCellBaseUtils().getCellBaseClient().getClientConfiguration().getVersion();
559-
sampleIndexConfiguration.validate(version);
558+
String cellbaseVersion = engine.getCellBaseUtils().getVersionFromServer();
559+
sampleIndexConfiguration.validate(cellbaseVersion);
560560
String studyFqn = getStudyFqn(studyStr, token);
561-
engine.getMetadataManager().addSampleIndexConfiguration(studyFqn, sampleIndexConfiguration, true);
561+
int studyId;
562+
if (!engine.getMetadataManager().studyExists(studyFqn)) {
563+
studyId = engine.getMetadataManager().createStudy(studyFqn, cellbaseVersion).getId();
564+
} else {
565+
studyId = engine.getMetadataManager().getStudyId(studyFqn);
566+
}
567+
engine.getMetadataManager().addSampleIndexConfiguration(studyId, sampleIndexConfiguration, true);
562568

563569
catalogManager.getStudyManager()
564570
.setVariantEngineConfigurationSampleIndex(studyStr, sampleIndexConfiguration, token);

opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantQueryCommandUtils.java

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils;
2323
import org.opencb.opencga.app.cli.internal.options.VariantCommandOptions;
2424
import org.opencb.opencga.storage.core.variant.adaptors.VariantField;
25+
import org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam;
2526
import org.slf4j.Logger;
2627
import org.slf4j.LoggerFactory;
2728

@@ -55,6 +56,7 @@ public static Query parseQuery(VariantCommandOptions.AbstractVariantQueryCommand
5556
addParam(query, VariantCatalogQueryUtils.PANEL_ROLE_IN_CANCER, queryVariantsOptions.panelRoleInCancer);
5657
addParam(query, VariantCatalogQueryUtils.PANEL_FEATURE_TYPE, queryVariantsOptions.panelFeatureType);
5758
addParam(query, VariantCatalogQueryUtils.SAVED_FILTER, queryVariantsOptions.savedFilter);
59+
addParam(query, VariantQueryParam.SOURCE, queryVariantsOptions.source);
5860

5961
return query;
6062
}

opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/options/ClinicalCommandOptions.java

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import static org.opencb.opencga.core.api.FieldConstants.EXOMISER_CLINICAL_ANALYSIS_DESCRIPTION;
2727
import static org.opencb.opencga.core.api.FieldConstants.EXOMISER_VERSION_DESCRIPTION;
2828
import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.*;
29+
import static org.opencb.opencga.core.models.variant.VariantQueryParams.*;
2930

3031
@Parameters(commandNames = {"clinical"}, commandDescription = "Clinical analysis commands")
3132
public class ClinicalCommandOptions {

0 commit comments

Comments
 (0)