test_class.declarator: vd
test_class.modifier: static
test_class.original_string: static VariantDataset vd;
test_class.type: VariantDataset
test_class.var_name: vd
test_class.declarator: sparkConf
test_class.modifier: static
test_class.original_string: static SparkConf sparkConf;
test_class.type: SparkConf
test_class.var_name: sparkConf
test_class.declarator: sparkSession
test_class.modifier: static
test_class.original_string: static SparkSession sparkSession;
test_class.type: SparkSession
test_class.var_name: sparkSession
test_class.declarator: temporaryFolder = new TemporaryFolder()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder temporaryFolder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: temporaryFolder
test_class.file: hpg-bigdata-core/src/test/java/org/opencb/hpg/bigdata/core/lib/VariantDatasetTest.java
test_class.identifier: VariantDatasetTest
test_case.body: @Test
      public void outputFormats() {
          long count = 0;
          try {
              initDataset();
              System.out.println("--------------------------------------");
  
              //vd.studyFilter("stats.maf", "1000g::all<=0.4").show();
              //vd.studyFilter("stats.maf", "hgva@hsapiens_grch37:1000GENOMES_phase_3::ASW==0.008196721").show();
              vd.studyFilter("stats.refAlleleCount", "hgva@hsapiens_grch37:1000GENOMES_phase_3::ASW==121");
  
              vd.update();
  
              // save the dataset according to the output format
  //            String format = "avro";
  //            String format = "parquet";
              String format = "json";
  
              String filename = "/tmp/query.out." + format;
              String tmpDir = filename + ".tmp";
  
              if ("json".equals(format)) {
                  vd.coalesce(1).write().format("json").save(tmpDir);
              } else if ("parquet".equals(format)) {
                  vd.coalesce(1).write().format("parquet").save(tmpDir);
              } else {
                  vd.coalesce(1).write().format("com.databricks.spark.avro").save(tmpDir);
                  format = "avro";
              }
  
              File dir = new File(tmpDir);
              if (!dir.isDirectory()) {
                  // error management
                  System.err.println("Error: a directory was expected but " + tmpDir);
                  return;
              }
  
              // list out all the file name and filter by the extension
              Boolean found = false;
              String[] list = dir.list();
              for (String name: list) {
                  if (name.startsWith("part-r-") && name.endsWith(format)) {
                      new File(tmpDir + "/" + name).renameTo(new File(filename));
                      found = true;
                      break;
                  }
              }
              if (!found) {
                  // error management
                  System.out.println("Error: pattern 'part-r-*" + format + "' was not found");
              }
  
              // delete temporary directory
              FileUtils.deleteDirectory(dir);
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          vd.sparkSession.sparkContext().stop();
      }
test_case.class_method_signature: VariantDatasetTest.outputFormats()
test_case.full_signature: @Test public void outputFormats()
test_case.identifier: outputFormats
test_case.invocations: initDataset println studyFilter update equals save format write coalesce equals save format write coalesce save format write coalesce isDirectory println list startsWith endsWith renameTo println deleteDirectory printStackTrace stop sparkContext
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void outputFormats()
focal_class.declarator: variantParseQuery
focal_class.modifier: private
focal_class.original_string: private VariantParseQuery variantParseQuery;
focal_class.type: VariantParseQuery
focal_class.var_name: variantParseQuery
focal_class.declarator: sql
focal_class.modifier: private
focal_class.original_string: private String sql;
focal_class.type: String
focal_class.var_name: sql
focal_class.file: hpg-bigdata-core/src/main/java/org/opencb/hpg/bigdata/core/lib/VariantDataset.java
focal_class.identifier: VariantDataset
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: VariantDataset.VariantDataset(SparkSession sparkSession)
focal_class.full_signature: public  VariantDataset(SparkSession sparkSession)
focal_class.identifier: VariantDataset
focal_class.modifiers: public
focal_class.parameters: (SparkSession sparkSession)
focal_class.signature:  VariantDataset(SparkSession sparkSession)
focal_class.class_method_signature: VariantDataset.updateDataset(Query query)
focal_class.full_signature: @Override protected void updateDataset(Query query)
focal_class.identifier: updateDataset
focal_class.modifiers: @Override protected
focal_class.parameters: (Query query)
focal_class.return: void
focal_class.signature: void updateDataset(Query query)
focal_class.class_method_signature: VariantDataset.updateQuery(String key, List<String> values, boolean and)
focal_class.full_signature: private void updateQuery(String key, List<String> values, boolean and)
focal_class.identifier: updateQuery
focal_class.modifiers: private
focal_class.parameters: (String key, List<String> values, boolean and)
focal_class.return: void
focal_class.signature: void updateQuery(String key, List<String> values, boolean and)
focal_class.class_method_signature: VariantDataset.reset()
focal_class.full_signature: public void reset()
focal_class.identifier: reset
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_class.class_method_signature: VariantDataset.executeSql(String sql)
focal_class.full_signature: public Dataset executeSql(String sql)
focal_class.identifier: executeSql
focal_class.modifiers: public
focal_class.parameters: (String sql)
focal_class.return: Dataset
focal_class.signature: Dataset executeSql(String sql)
focal_class.class_method_signature: VariantDataset.getSql()
focal_class.full_signature: @Override public String getSql()
focal_class.identifier: getSql
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getSql()
focal_class.class_method_signature: VariantDataset.idFilter(String value)
focal_class.full_signature: public VariantDataset idFilter(String value)
focal_class.identifier: idFilter
focal_class.modifiers: public
focal_class.parameters: (String value)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset idFilter(String value)
focal_class.class_method_signature: VariantDataset.idFilter(List<String> values)
focal_class.full_signature: public VariantDataset idFilter(List<String> values)
focal_class.identifier: idFilter
focal_class.modifiers: public
focal_class.parameters: (List<String> values)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset idFilter(List<String> values)
focal_class.class_method_signature: VariantDataset.idFilter(List<String> values, boolean and)
focal_class.full_signature: public VariantDataset idFilter(List<String> values, boolean and)
focal_class.identifier: idFilter
focal_class.modifiers: public
focal_class.parameters: (List<String> values, boolean and)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset idFilter(List<String> values, boolean and)
focal_class.class_method_signature: VariantDataset.typeFilter(String value)
focal_class.full_signature: public VariantDataset typeFilter(String value)
focal_class.identifier: typeFilter
focal_class.modifiers: public
focal_class.parameters: (String value)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset typeFilter(String value)
focal_class.class_method_signature: VariantDataset.typeFilter(List<String> values)
focal_class.full_signature: public VariantDataset typeFilter(List<String> values)
focal_class.identifier: typeFilter
focal_class.modifiers: public
focal_class.parameters: (List<String> values)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset typeFilter(List<String> values)
focal_class.class_method_signature: VariantDataset.studyFilter(String key, String value)
focal_class.full_signature: public VariantDataset studyFilter(String key, String value)
focal_class.identifier: studyFilter
focal_class.modifiers: public
focal_class.parameters: (String key, String value)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset studyFilter(String key, String value)
focal_class.class_method_signature: VariantDataset.studyFilter(String key, List<String> values)
focal_class.full_signature: public VariantDataset studyFilter(String key, List<String> values)
focal_class.identifier: studyFilter
focal_class.modifiers: public
focal_class.parameters: (String key, List<String> values)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset studyFilter(String key, List<String> values)
focal_class.class_method_signature: VariantDataset.studyFilter(String key, List<String> values, boolean and)
focal_class.full_signature: public VariantDataset studyFilter(String key, List<String> values, boolean and)
focal_class.identifier: studyFilter
focal_class.modifiers: public
focal_class.parameters: (String key, List<String> values, boolean and)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset studyFilter(String key, List<String> values, boolean and)
focal_class.class_method_signature: VariantDataset.sampleFilter(String key, String value)
focal_class.full_signature: public VariantDataset sampleFilter(String key, String value)
focal_class.identifier: sampleFilter
focal_class.modifiers: public
focal_class.parameters: (String key, String value)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset sampleFilter(String key, String value)
focal_class.class_method_signature: VariantDataset.sampleFilter(String key, List<String> values)
focal_class.full_signature: public VariantDataset sampleFilter(String key, List<String> values)
focal_class.identifier: sampleFilter
focal_class.modifiers: public
focal_class.parameters: (String key, List<String> values)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset sampleFilter(String key, List<String> values)
focal_class.class_method_signature: VariantDataset.annotationFilter(String key, String value)
focal_class.full_signature: public VariantDataset annotationFilter(String key, String value)
focal_class.identifier: annotationFilter
focal_class.modifiers: public
focal_class.parameters: (String key, String value)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset annotationFilter(String key, String value)
focal_class.class_method_signature: VariantDataset.annotationFilter(String key, List<String> values)
focal_class.full_signature: public VariantDataset annotationFilter(String key, List<String> values)
focal_class.identifier: annotationFilter
focal_class.modifiers: public
focal_class.parameters: (String key, List<String> values)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset annotationFilter(String key, List<String> values)
focal_class.class_method_signature: VariantDataset.annotationFilter(String key, List<String> values, boolean and)
focal_class.full_signature: public VariantDataset annotationFilter(String key, List<String> values, boolean and)
focal_class.identifier: annotationFilter
focal_class.modifiers: public
focal_class.parameters: (String key, List<String> values, boolean and)
focal_class.return: VariantDataset
focal_class.signature: VariantDataset annotationFilter(String key, List<String> values, boolean and)
focal_class.class_method_signature: VariantDataset.iterator()
focal_class.full_signature: public Iterator<Variant> iterator()
focal_class.identifier: iterator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Iterator<Variant>
focal_class.signature: Iterator<Variant> iterator()
focal_class.superclass: extends ParentDataset<VariantDataset>
focal_method.body: public VariantDataset studyFilter(String key, String value) {
          query.put("studies." + key, value);
          return this;
      }
focal_method.class_method_signature: VariantDataset.studyFilter(String key, String value)
focal_method.full_signature: public VariantDataset studyFilter(String key, String value)
focal_method.identifier: studyFilter
focal_method.invocations: put
focal_method.modifiers: public
focal_method.parameters: (String key, String value)
focal_method.return: VariantDataset
focal_method.signature: VariantDataset studyFilter(String key, String value)