Static method to load and parse a JSON string from an InputStream.
@param diseasePanelInputStream InputStream with the JSON string representing this panel.
@return A DiseasePanel object.
@throws IOException Propagate Jackson IOException.
189309
public static DiseasePanel load(InputStream diseasePanelInputStream) throws IOException {
        ObjectMapper objectMapper = new ObjectMapper();
        return objectMapper.readValue(diseasePanelInputStream, DiseasePanel.class);
    }
76226
public <T> T fromJson(@Nullable String jsonString, Class<T> clazz) {
		if (StringUtils.isEmpty(jsonString)) {
			return null;
		}

		try {
			return mapper.readValue(jsonString, clazz);
		} catch (IOException e) {
			logger.warn("parse json string error:" + jsonString, e);
			return null;
		}
	}
807260
public T get(String json) throws IOException, JsonFormatException {
		JsonPullParser parser = JsonPullParser.newParser(json);
		return get(parser, null);
	}
549319
public static Document fromJson(String jsonString) {
      try {
         return read(Resources.fromString(jsonString));
      } catch (IOException e) {
         throw Throwables.propagate(e);
      }
   }
481118
public static JsonHash fromString(String json) throws IOException, JsonFormatException {
		JsonPullParser parser = JsonPullParser.newParser(json);
		return fromParser(parser);
	}
734848
public static Map toMap(String json) {
        try {
            return mapper.readValue(json, Map.class);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
1003468
@SuppressWarnings({"unchecked"})
    public <T> T read(InputStream jsonInputStream) throws IOException {
        return read(jsonInputStream, Configuration.defaultConfiguration());
    }
1017282
public static JsonNode toJsonNode(String jsonString) throws IOException {
        return (JacksonJsonSingletonHelper.JACKSON_JSON.objectMapper.readTree(jsonString));
    }
826194
public T parse(InputStream inputStream) {
        Reader inputStreamReader = new InputStreamReader(inputStream);
        Reader streamReader = new BufferedReader(inputStreamReader);

        // Parse result type from the returned JSON
        return gson.fromJson(streamReader, type.getType());
    }
1368817
public static EsriFeatureClass FeatureClassFromJson(InputStream jsonInputStream) throws JsonParseException, IOException{
		JsonParser parser = jsonFactory.createJsonParser(jsonInputStream);
		return FeatureClassFromJson(parser);
	}
878652
public static Map<String, Object> read(InputStream stream)
		throws IOException
	{
		ConfigJsonInput input = new ConfigJsonInput(new InputStreamReader(stream, StandardCharsets.UTF_8));
		return read(input);
	}
1163030
public static <E> Map<String, E> parseMap(InputStream is, Class<E> jsonObjectClass) throws IOException {
        return mapperFor(jsonObjectClass).parseMap(is);
    }
1035524
@Override
    public void parse() throws IOException, InterruptedException, SQLException, ClassNotFoundException {
        Map<String, String> seqRegionMap = VariationUtils.parseSeqRegionToMap(ensemblVariationDir);
        Map<String, String> phenotypeMap = VariationUtils.parsePhenotypeToMap(ensemblVariationDir);
        Map<String, String> sourceMap = VariationUtils.parseSourceToMap(ensemblVariationDir);
        Map<String, String> studyMap = VariationUtils.parseStudyToMap(ensemblVariationDir);
        Map<String, String> attribTypeMap = VariationUtils.parseAttribTypeToMap(ensemblVariationDir);

        Map<String, Set<String>> phenotypeToGeneList = new HashMap<>(20000);

        prepare(ensemblVariationDir);
        createPhenFeatAttribTable(ensemblVariationDir);
        raf = new RandomAccessFile(ensemblVariationDir.resolve("phenotype_feature_attrib.txt").toFile(), "r");

        VariationPhenotypeAnnotation mutation;
        String seqRegion = null;
        String phenotype = null;
        String source = null;
        String study = null;
        String externalId = null;

        String clinSignificance = null;
        List<String> associatedGenes = new ArrayList<>();
        String riskAllele = null;
        float pValue = 0.0f;
        float oddsRatio = 0.0f;

        String chunkIdSuffix = CHUNK_SIZE / 1000 + "k";

        BufferedReader br = FileUtils.newBufferedReader(ensemblVariationDir.resolve("phenotype_feature.txt.gz"), Charset.defaultCharset());
        String[] fields = null;
        String[] rafFields = null;
        String line = null;
        int count = 0;
        while ((line = br.readLine()) != null) {
            fields = line.split("\t");

            if (fields[4].equals("Variation")) {
                seqRegion = seqRegionMap.get(fields[7]);
                phenotype = phenotypeMap.get(fields[1]);
                source = sourceMap.get(fields[2]).split(",")[0];
                study = studyMap.get(fields[3]);
// anyadir type: variation, SV, ...

                clinSignificance = "";
                externalId = "";
                associatedGenes = new ArrayList<>();
                riskAllele = "";
                pValue = -1f;
                oddsRatio = -1f;
                List<String> resultPhenAnnot = queryByVariationId(Integer.parseInt(fields[0]), ensemblVariationDir);
                if (++count % 10000 == 0) {
                    System.out.println(resultPhenAnnot);
//                    if(count > 200000) break;
                }
                for (String result : resultPhenAnnot) {
                    rafFields = result.split("\t", -1);
                    switch (rafFields[1]) {
                        case "10":
                            clinSignificance = rafFields[2];
                            break;
                        case "13":
                            associatedGenes = Splitter.on(",").trimResults().splitToList(rafFields[2]);
                            break;
                        case "14":  // riskAllele
                            riskAllele = rafFields[2];
                            break;
                        case "15":  // pValue
                            pValue = (rafFields[2] != null && !rafFields[2].equalsIgnoreCase("null"))
                                    ? Float.parseFloat(rafFields[2])
                                    : -1f;
                            break;
                        case "22":  // pValue
                            externalId = rafFields[2];
                            break;
                        case "23":  // pValue
                            oddsRatio = Float.parseFloat(rafFields[2]);
                            break;
                        default:
                            break;
                    }

                }

                if (!phenotypeToGeneList.containsKey(phenotype)) {
                    phenotypeToGeneList.put(phenotype, new HashSet<String>());
                }
                phenotypeToGeneList.get(phenotype).addAll(associatedGenes);

                mutation = new VariationPhenotypeAnnotation(fields[5], seqRegion, Integer.parseInt(fields[8]),
                        Integer.parseInt(fields[9]), fields[10], phenotype, source, study, clinSignificance, associatedGenes,
                        riskAllele, pValue, oddsRatio, "", externalId);
                int chunkStart = (mutation.getStart()) / CHUNK_SIZE;
                int chunkEnd = (mutation.getEnd()) / CHUNK_SIZE;

                if (mutation.getChunkIds() == null) {
                    mutation.setChunkIds(new ArrayList<String>());
                }
                for (int i = chunkStart; i <= chunkEnd; i++) {
                    mutation.getChunkIds().add(mutation.getChromosome() + "_" + i + "_" + chunkIdSuffix);
                }
                serializer.serialize(mutation);
            }
        }
        raf.close();
        br.close();

        BufferedWriter bw = Files.newBufferedWriter(Paths.get("/tmp/phenotype.json"), Charset.defaultCharset());
//        Iterator<String> iter = phenotypeToGeneList.keySet().iterator();
//        for (Object o : iter) {
//            jsonObjectWriter.writeValueAsString(phenotypeToGeneList);
//        }
        for (Map.Entry<String, Set<String>> elem : phenotypeToGeneList.entrySet()) {
            bw.write(jsonObjectWriter.writeValueAsString(elem)
                    .replace("\"key\"", "\"phenotype\"")
                    .replace("\"value\"", "\"associatedGenes\""));
            bw.newLine();
        }
        bw.close();

        clean(ensemblVariationDir);
    }
90341
public static <T extends JsonRtn> T parseJsonRtn(String jsonRtn, Class<T> jsonRtnClazz) {
        T rtn = JSONObject.parseObject(jsonRtn, jsonRtnClazz);
        appendErrorHumanMsg(rtn);
        return rtn;
    }
1182783
public JsonNode parse(String src) {
        synchronized (lock) {
            try {
                return mapper.readValue(src, JsonNode.class);
            } catch (Exception t) {
                throw new RuntimeException(t);
            }
        }
    }
221437
public static <E> E parse(InputStream is, Class<E> jsonObjectClass) throws IOException {
        return mapperFor(jsonObjectClass).parse(is);
    }
852376
@SuppressWarnings("UnusedDeclaration")
  public static Bindings fromJson( String json )
  {
    try
    {
      return PARSER.get().parseJson( json );
    }
    catch( ScriptException e )
    {
      throw new RuntimeException( e );
    }
  }