test_class.declarator: variantParseQuery
test_class.modifier: private
test_class.original_string: private VariantParseQuery variantParseQuery;
test_class.type: VariantParseQuery
test_class.var_name: variantParseQuery
test_class.declarator: thrown = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException thrown = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: thrown
test_class.file: hpg-bigdata-core/src/test/java/org/opencb/hpg/bigdata/core/lib/VariantParseQueryTest.java
test_class.identifier: VariantParseQueryTest
test_case.body: @Test
      public void parsePopulationFrequenciesOR() throws Exception {
          String result = "SELECT * FROM test LATERAL VIEW explode(annotation.populationFrequencies) apf as popfreq " +
                  "WHERE ((popfreq.study = '1000G' AND popfreq.population = 'CEU' AND popfreq.altAlleleFreq<1.2) " +
                  "OR (popfreq.study = '1000G' AND popfreq.population = 'ASW' AND popfreq.altAlleleFreq<1.25)) " +
                  "ORDER BY chromosome, start ASC";
  
          Query query = new Query();
          query.put("annotation.populationFrequencies.altAlleleFreq", "1000G::CEU<1.2,1000G::ASW<1.25");
  
          String test = variantParseQuery.parse(query, null, "test");
          assertEquals("SQL query does not match", result, test);
      }
test_case.class_method_signature: VariantParseQueryTest.parsePopulationFrequenciesOR()
test_case.full_signature: @Test public void parsePopulationFrequenciesOR()
test_case.identifier: parsePopulationFrequenciesOR
test_case.invocations: put parse assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void parsePopulationFrequenciesOR()
focal_class.declarator: POPULATION_PATTERN =
              Pattern.compile("^([^=<>]+)::([^=<>]+)(<=?|>=?|!=|!?=?~|==?)([^=<>]+)$")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern POPULATION_PATTERN =
              Pattern.compile("^([^=<>]+)::([^=<>]+)(<=?|>=?|!=|!?=?~|==?)([^=<>]+)$");
focal_class.type: Pattern
focal_class.var_name: POPULATION_PATTERN
focal_class.declarator: CONSERVATION_PATTERN =
              Pattern.compile("^([^=<>]+.*)(<=?|>=?|!=|!?=?~|==?)([^=<>]+.*)$")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern CONSERVATION_PATTERN =
              Pattern.compile("^([^=<>]+.*)(<=?|>=?|!=|!?=?~|==?)([^=<>]+.*)$");
focal_class.type: Pattern
focal_class.var_name: CONSERVATION_PATTERN
focal_class.declarator: CONSERVATION_VIEW = "cons"
focal_class.modifier: private static final
focal_class.original_string: private static final String CONSERVATION_VIEW = "cons";
focal_class.type: String
focal_class.var_name: CONSERVATION_VIEW
focal_class.declarator: SUBSTITUTION_VIEW = "subst"
focal_class.modifier: private static final
focal_class.original_string: private static final String SUBSTITUTION_VIEW = "subst";
focal_class.type: String
focal_class.var_name: SUBSTITUTION_VIEW
focal_class.declarator: STUDY_VIEW = "study"
focal_class.modifier: private static final
focal_class.original_string: private static final String STUDY_VIEW = "study";
focal_class.type: String
focal_class.var_name: STUDY_VIEW
focal_class.file: hpg-bigdata-core/src/main/java/org/opencb/hpg/bigdata/core/lib/VariantParseQuery.java
focal_class.identifier: VariantParseQuery
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: VariantParseQuery.VariantParseQuery()
focal_class.full_signature: public  VariantParseQuery()
focal_class.identifier: VariantParseQuery
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  VariantParseQuery()
focal_class.class_method_signature: VariantParseQuery.parse(Query query, QueryOptions queryOptions, String viewName)
focal_class.full_signature: public String parse(Query query, QueryOptions queryOptions, String viewName)
focal_class.identifier: parse
focal_class.modifiers: public
focal_class.parameters: (Query query, QueryOptions queryOptions, String viewName)
focal_class.return: String
focal_class.signature: String parse(Query query, QueryOptions queryOptions, String viewName)
focal_class.class_method_signature: VariantParseQuery.buildQueryString(String viewName, QueryOptions queryOptions)
focal_class.full_signature: protected void buildQueryString(String viewName, QueryOptions queryOptions)
focal_class.identifier: buildQueryString
focal_class.modifiers: protected
focal_class.parameters: (String viewName, QueryOptions queryOptions)
focal_class.return: void
focal_class.signature: void buildQueryString(String viewName, QueryOptions queryOptions)
focal_class.class_method_signature: VariantParseQuery.processStudyQuery(String[] fields, Object value)
focal_class.full_signature: private void processStudyQuery(String[] fields, Object value)
focal_class.identifier: processStudyQuery
focal_class.modifiers: private
focal_class.parameters: (String[] fields, Object value)
focal_class.return: void
focal_class.signature: void processStudyQuery(String[] fields, Object value)
focal_class.class_method_signature: VariantParseQuery.processAnnotationQuery(String[] fields, String value)
focal_class.full_signature: private void processAnnotationQuery(String[] fields, String value)
focal_class.identifier: processAnnotationQuery
focal_class.modifiers: private
focal_class.parameters: (String[] fields, String value)
focal_class.return: void
focal_class.signature: void processAnnotationQuery(String[] fields, String value)
focal_class.class_method_signature: VariantParseQuery.auxAddFilters(String value, String view, String label)
focal_class.full_signature: private void auxAddFilters(String value, String view, String label)
focal_class.identifier: auxAddFilters
focal_class.modifiers: private
focal_class.parameters: (String value, String view, String label)
focal_class.return: void
focal_class.signature: void auxAddFilters(String value, String view, String label)
focal_class.class_method_signature: VariantParseQuery.auxAddGenotypeFilters(String value)
focal_class.full_signature: private void auxAddGenotypeFilters(String value)
focal_class.identifier: auxAddGenotypeFilters
focal_class.modifiers: private
focal_class.parameters: (String value)
focal_class.return: void
focal_class.signature: void auxAddGenotypeFilters(String value)
focal_class.class_method_signature: VariantParseQuery.getGenotypeWhere(String value)
focal_class.full_signature: private String getGenotypeWhere(String value)
focal_class.identifier: getGenotypeWhere
focal_class.modifiers: private
focal_class.parameters: (String value)
focal_class.return: String
focal_class.signature: String getGenotypeWhere(String value)
focal_class.class_method_signature: VariantParseQuery.auxAddPopulationFilters(String fieldName1, String fieldName2, String fieldName3,
                                           String value, String label)
focal_class.full_signature: private void auxAddPopulationFilters(String fieldName1, String fieldName2, String fieldName3,
                                           String value, String label)
focal_class.identifier: auxAddPopulationFilters
focal_class.modifiers: private
focal_class.parameters: (String fieldName1, String fieldName2, String fieldName3,
                                           String value, String label)
focal_class.return: void
focal_class.signature: void auxAddPopulationFilters(String fieldName1, String fieldName2, String fieldName3,
                                           String value, String label)
focal_class.class_method_signature: VariantParseQuery.updatePopWhereString(String fieldName1, String fieldName2, String fieldName3,
                                        Matcher matcher, StringBuilder where)
focal_class.full_signature: private void updatePopWhereString(String fieldName1, String fieldName2, String fieldName3,
                                        Matcher matcher, StringBuilder where)
focal_class.identifier: updatePopWhereString
focal_class.modifiers: private
focal_class.parameters: (String fieldName1, String fieldName2, String fieldName3,
                                        Matcher matcher, StringBuilder where)
focal_class.return: void
focal_class.signature: void updatePopWhereString(String fieldName1, String fieldName2, String fieldName3,
                                        Matcher matcher, StringBuilder where)
focal_class.class_method_signature: VariantParseQuery.updateWhereString(String view, Matcher matcher, StringBuilder where)
focal_class.full_signature: private void updateWhereString(String view, Matcher matcher, StringBuilder where)
focal_class.identifier: updateWhereString
focal_class.modifiers: private
focal_class.parameters: (String view, Matcher matcher, StringBuilder where)
focal_class.return: void
focal_class.signature: void updateWhereString(String view, Matcher matcher, StringBuilder where)
focal_class.superclass: extends ParseQuery
focal_method.body: public String parse(Query query, QueryOptions queryOptions, String viewName) {
  
          Set<String> keySet = query.keySet();
  
          for (String key : keySet) {
              String value = (String) query.get(key);
  
              // sanity check
              if (StringUtils.isEmpty(key) || StringUtils.isEmpty(value)) {
                  throw new IllegalArgumentException("key or value are null or empty (key = "
                          + key + ", value = " + value + ")");
              }
  
              String[] fields = key.split("\\.");
  
              // First we check if there is any ...
              if (fields.length == 0) {
                  System.out.println("length is 0, nothing to do");
                  return null;
              }
  
              switch (fields[0]) {
                  case "id":
                  case "chromosome":
                  case "type":
                      filters.add(processFilter(fields[0], value, true, false));
                      break;
                  case "start":
                  case "end":
                  case "length":
                      filters.add(processFilter(fields[0], value, false, false));
                      break;
                  case "region":
                      processRegionQuery(value, "chromosome", "start", "end");
                      break;
                  case "names":
                      filters.add(processFilter("hgvs", value, true, true));
                      break;
                  case "studies":
                      processStudyQuery(fields, value);
                      break;
                  case "annotation":
                      processAnnotationQuery(fields, value);
                      break;
                  default:
                      break;
              }
          }
  
          // Build the SQL string from the processed query using explodes and filters
          buildQueryString(viewName, queryOptions);
          return sqlQueryString.toString();
      }
focal_method.class_method_signature: VariantParseQuery.parse(Query query, QueryOptions queryOptions, String viewName)
focal_method.full_signature: public String parse(Query query, QueryOptions queryOptions, String viewName)
focal_method.identifier: parse
focal_method.invocations: keySet get isEmpty isEmpty split println add processFilter add processFilter processRegionQuery add processFilter processStudyQuery processAnnotationQuery buildQueryString toString
focal_method.modifiers: public
focal_method.parameters: (Query query, QueryOptions queryOptions, String viewName)
focal_method.return: String
focal_method.signature: String parse(Query query, QueryOptions queryOptions, String viewName)