protected void processGeneOrDomain(String gene, String domain,
String property, String codonStart)
{
+ boolean domainEnd = "domainend".equalsIgnoreCase(property);
+
/*
- * If we have been processing a Gene or Domain, and this does not continue
- * it, then close it off (generate sequence features for it)
+ * If we have been processing a Domain or Gene, and this does not continue
+ * it, then close it off (generate sequence features for it). Do Domain
+ * first as it is in the context of the enclosing gene if any.
*/
- if (this.currentGene != null && !this.currentGene.equals(gene))
- {
- createFeature(GENE, currentGene, geneStart);
- }
if (this.currentDomain != null)
{
- if (!this.currentDomain.equals(domain)
- || "domainend".equalsIgnoreCase(property))
+ if (!this.currentDomain.equals(domain) || domainEnd)
{
- createFeature(DOMAIN, currentDomain, domainStart);
+ String description = currentDomain
+ + (currentGene == null ? "" : " (" + currentGene + ")");
+ createFeature(DOMAIN, description, domainStart);
}
}
+ if (this.currentGene != null && !this.currentGene.equals(gene))
+ {
+ createFeature(GENE, currentGene, geneStart);
+ }
/*
* and if we have declared a Gene or Domain which does not continue the
}
currentGene = gene;
- currentDomain = domain;
+ currentDomain = domainEnd ? null : domain;
}
/**