Пример #1
0
    @Override
    public String process(File page, Map<String, String> query) {
      JSONObject jo = new JSONObject();
      jo.put("tip", "");

      if (graphs.containsKey(query.get("graphName")) && query.containsKey("sk")) {
        CortexGraph cg = graphs.get(query.get("graphName"));

        CortexKmer ck = new CortexKmer(query.get("sk"));

        CortexRecord cr = cg.findRecord(ck);
        if (cr != null) {
          String sampleName = cg.getColor(0).getSampleName();
          for (CortexLinksMap link : LINKS) {
            if (sampleName.equals(link.getCortexLinks().getColor(0).getSampleName())) {
              if (link.containsKey(ck)) {
                CortexLinksRecord clr = link.get(ck);

                clr = CortexUtils.orientLinksRecord(query.get("sk"), clr);

                jo.put("tip", clr.toString().replaceAll("\n", ", "));

                break;
              }
            }
          }
        }
      }

      return jo.toString();
    }