X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FMegaFile.java;h=c7caa3b6bb066265239e6695223a7a874d26c1ad;hb=e6ee9bdb5c3a632b0b9de544f64380b0714e5169;hp=58961f824c301ced6846577485b97f618e509d38;hpb=e710810610e029b1519d31c6d8a9de26833f59b9;p=jalview.git diff --git a/src/jalview/io/MegaFile.java b/src/jalview/io/MegaFile.java index 58961f8..c7caa3b 100644 --- a/src/jalview/io/MegaFile.java +++ b/src/jalview/io/MegaFile.java @@ -362,22 +362,26 @@ public class MegaFile extends AlignFile 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 @@ -393,7 +397,7 @@ public class MegaFile extends AlignFile } currentGene = gene; - currentDomain = domain; + currentDomain = domainEnd ? null : domain; } /**