|
56 | 56 | import org.opencb.opencga.core.models.sample.SamplePermissions;
|
57 | 57 | import org.opencb.opencga.core.models.study.Study;
|
58 | 58 | import org.opencb.opencga.core.models.user.UserFilter;
|
| 59 | +import org.opencb.opencga.core.models.variant.VariantQueryParams; |
59 | 60 | import org.opencb.opencga.core.response.OpenCGAResult;
|
60 | 61 | import org.opencb.opencga.storage.core.exceptions.StorageEngineException;
|
61 | 62 | import org.opencb.opencga.storage.core.metadata.VariantStorageMetadataManager;
|
|
89 | 90 | */
|
90 | 91 | public class VariantCatalogQueryUtils extends CatalogUtils {
|
91 | 92 |
|
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"; |
94 | 93 | 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); |
98 | 96 |
|
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)"; |
101 | 97 | 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); |
104 | 99 | 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); |
107 | 101 | 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); |
110 | 103 | 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); |
115 | 105 | 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); |
117 | 107 |
|
118 |
| - public static final String SAVED_FILTER_DESCR = "Use a saved filter at User level"; |
119 | 108 | 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); |
121 | 110 |
|
122 | 111 | @Deprecated
|
123 | 112 | public static final QueryParam FAMILY_PHENOTYPE = FAMILY_DISORDER;
|
124 | 113 | @Deprecated
|
125 | 114 | public static final QueryParam MODE_OF_INHERITANCE = FAMILY_SEGREGATION;
|
126 | 115 |
|
127 |
| - public static final String PANEL_DESC = "Filter by genes from the given disease panel"; |
128 | 116 | 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); |
134 | 118 | public static final QueryParam PANEL_MODE_OF_INHERITANCE =
|
135 |
| - QueryParam.create("panelModeOfInheritance", PANEL_MOI_DESC |
| 119 | + QueryParam.create("panelModeOfInheritance", VariantQueryParams.PANEL_MOI_DESC |
136 | 120 | , 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 ]"; |
139 | 121 | 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); |
141 | 123 |
|
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."; |
144 | 124 | 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); |
146 | 126 |
|
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 ]"; |
149 | 127 | 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); |
151 | 129 |
|
152 |
| - public static final String PANEL_FEATURE_TYPE_DESC = "Filter elements from specific panels by type. " + |
153 |
| - "Accepted values : [ gene, region, str, variant ]"; |
154 | 130 | 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); |
156 | 132 |
|
157 | 133 | public static final List<QueryParam> VARIANT_CATALOG_QUERY_PARAMS = Arrays.asList(
|
158 | 134 | SAMPLE_ANNOTATION,
|
|
0 commit comments