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;
  }
Exemple #2
0
 @Transient
 @Field(index = Index.TOKENIZED, store = Store.NO)
 public String getEcNums() {
   List<String> ecNums = new ArrayList<String>();
   for (FeatureProp fp : getFeatureProps()) {
     CvTerm type = fp.getType();
     if (type.getName().equals("EC_number") && type.getCv().getName().equals("genedb_misc")) {
       ecNums.add(fp.getValue());
     }
   }
   return StringUtils.collectionToDelimitedString(ecNums, " ");
 }
Exemple #3
0
  @Transient
  @Field(index = Index.TOKENIZED, store = Store.YES)
  public String getAllCuration() {
    List<String> curation = new ArrayList<String>();
    for (FeatureProp fp : getFeatureProps()) {
      CvTerm type = fp.getType();
      if (type.getCv().getName().equals("genedb_misc") && type.getName().equals("curation")) {
        curation.add(fp.getValue());
      }
      if (type.getCv().getName().equals("feature_property") && type.getName().equals("comment")) {
        curation.add(fp.getValue());
      }
    }

    // we add terms from the CC_genedb_controlledcuration featurecvterm here
    curation.addAll(populateFromFeatureCvTerms("CC_genedb_controlledcuration"));

    return StringUtils.collectionToDelimitedString(curation, " ");
  }