private static Transcript makeTranscript(Feature feature) {
    Transcript transcript = new Transcript();
    transcript.setFmin(feature.getRankZeroFeatureLoc().getFmin());
    transcript.setFmax(feature.getRankZeroFeatureLoc().getFmax());
    transcript.setUniqueName(feature.getDisplayName());

    Set<TranscriptComponent> exons = new HashSet<TranscriptComponent>();
    for (FeatureRelationship fr : feature.getFeatureRelationshipsForObjectId()) {
      Feature relatedFeature = fr.getSubjectFeature();
      String relatedFeatureName = relatedFeature.getType().getName();
      if (relatedFeatureName.equals("polypeptide")) {
        transcript.setProtein(relatedFeature);
      } else if (relatedFeatureName.equals("exon")) {
        FeatureLoc otherFeatLoc = relatedFeature.getRankZeroFeatureLoc();
        exons.add(new Exon(otherFeatLoc.getFmin(), otherFeatLoc.getFmax()));
      }
    }
    transcript.setComponents(exons);

    Feature protein = transcript.getProtein();
    if (protein != null) {
      List<String> products = new ArrayList<String>();
      for (FeatureCvTerm fcvt : protein.getFeatureCvTerms()) {
        CvTerm featCvTerm = fcvt.getType();
        if (featCvTerm.getCv().getName().equals("genedb_products")) {
          products.add(featCvTerm.getName());
        }
      }
      transcript.setProducts(products);
    }

    return transcript;
  }
  protected BasicGene geneFromFeature(Feature feat) {
    BasicGene ret = new Gene();

    ret.setUniqueName(feat.getUniqueName());
    ret.setFeatureId(feat.getFeatureId());

    List<String> synonyms = new ArrayList<String>();
    for (FeatureSynonym fs : feat.getFeatureSynonyms()) {
      String type = fs.getSynonym().getType().getName();
      if (type.equals("synonym")) {
        synonyms.add(fs.getSynonym().getName());
      }
    }
    ret.setSynonyms(synonyms);

    if (StringUtils.hasText(feat.getName())) {
      ret.setName(feat.getName());
    }

    for (FeatureRelationship fr : feat.getFeatureRelationshipsForObjectId()) {
      Feature otherFeat = fr.getSubjectFeature();
      if (otherFeat instanceof org.gmod.schema.feature.Transcript) {
        ret.addTranscript(makeTranscript(otherFeat));
      }
    }

    ret.setOrganism(feat.getOrganism().getCommonName());

    FeatureLoc loc = feat.getRankZeroFeatureLoc();
    Feature chromosomeFeature = loc.getSourceFeature();
    Chromosome chromosome =
        new Chromosome(
            chromosomeFeature.getDisplayName(),
            chromosomeFeature.getFeatureId(),
            chromosomeFeature.getSeqLen());
    ret.setChromosome(chromosome);
    ret.setStrand(loc.getStrand());
    ret.setFmin(loc.getFmin());
    ret.setFmax(loc.getFmax());

    return ret;
  }
 protected Gap gapFromFeature(Feature feat) {
   FeatureLoc loc = feat.getRankZeroFeatureLoc();
   return new Gap(feat.getUniqueName(), loc.getFmin(), loc.getFmax());
 }