예제 #1
0
  public void setEntrezGeneInfo(Element node) {
    // check to make sure ids match
    NodeList idList = node.getElementsByTagName("Id");
    if (!idList.item(0).getTextContent().equals(this.getAttribute("Xref", "ID"))) return;

    gene = new Gene(Gene.geneType.ENTREZ, this.getAttribute("Xref", "ID"));

    NodeList items = node.getElementsByTagName("Item");
    for (int i = 0; i < items.getLength(); i++) {
      Node n = items.item(i);
      String name = ((Element) n).getAttribute("Name");
      if (name.equals("GenomicInfo")) {
        NodeList subItems = ((Element) n).getElementsByTagName("Item");
        for (int j = 0; j < subItems.getLength(); j++) {
          Node m = subItems.item(j);
          String subName = ((Element) m).getAttribute("Name");
          if (subName.equals("ChrStart")) {
            gene.setStart(m.getTextContent());
          } else if (subName.equals("ChrStop")) {
            gene.setEnd(m.getTextContent());
          }
        }
      } else if (name.equals("Chromosome")) {
        gene.setChromosome(n.getTextContent());
      } else if (name.equals("Name")) {
        gene.setName(n.getTextContent());
      } else if (name.equals("Description")) {
        gene.setDescription(n.getTextContent());
      }
    }

    geneInfoSet = true;
  }
예제 #2
0
  public void setEnsemblGeneInfo(String id, String chrom, String start, String end) {
    gene = new Gene(Gene.geneType.ENSEMBL, id);
    gene.setChromosome(chrom);
    gene.setStart(start);
    gene.setEnd(end);

    geneInfoSet = true;
  }