X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FEmblFlatFile.java;h=21e66d2eb60e847f1aed4da87b8e5f139d4327a4;hb=a4b5b8219c60353fa9c0dbac0ff52c3beaf3c055;hp=900aef82205f867947617c424a3c2c256e56e3a9;hpb=049cfa5fc078e6daac6158f25cea7d9a60b48969;p=jalview.git diff --git a/src/jalview/io/EmblFlatFile.java b/src/jalview/io/EmblFlatFile.java index 900aef8..21e66d2 100644 --- a/src/jalview/io/EmblFlatFile.java +++ b/src/jalview/io/EmblFlatFile.java @@ -118,6 +118,7 @@ public class EmblFlatFile extends AlignFile // FileParse * * @throws IOException */ + @Override public void parse() throws IOException { String line = nextLine(); @@ -322,11 +323,14 @@ public class EmblFlatFile extends AlignFile // FileParse return nextLine(); } + /* + * parse location - which may be over more than one line e.g. EAW51554 + */ CdsData data = new CdsData(); - data.cdsLocation = tokens[2]; - // TODO location can be over >1 line e.g. EAW51554 + StringBuilder sb = new StringBuilder().append(tokens[2]); + line = parseFeatureQualifier(sb, "CDS"); + data.cdsLocation = sb.toString(); - line = nextLine(); while (line != null) { if (!line.startsWith("FT ")) // 4 spaces @@ -359,7 +363,7 @@ public class EmblFlatFile extends AlignFile // FileParse String qualifier = line.substring(slashPos + 1, eqPos); String value = line.substring(eqPos + 1); value = removeQuotes(value); - StringBuilder sb = new StringBuilder().append(value); + sb = new StringBuilder().append(value); line = parseFeatureQualifier(sb, qualifier); String featureValue = sb.toString(); @@ -427,7 +431,7 @@ public class EmblFlatFile extends AlignFile // FileParse */ static String removeQuotes(String value) { - if (value == null) + if (value == null) { return null; } @@ -493,7 +497,8 @@ public class EmblFlatFile extends AlignFile // FileParse * heuristic rule: most multi-line value (e.g. /product) are text, * so add a space for word boundary at a new line; not for translation */ - if (!"translation".equals(qualifierName)) + if (!"translation".equals(qualifierName) + && !"CDS".equals(qualifierName)) { sb.append(" "); } @@ -836,11 +841,9 @@ public class EmblFlatFile extends AlignFile // FileParse int exonLength = MappingUtils.getLength(Arrays.asList(exon)); /* - * if exon length matches protein, or is shorter, or longer by the - * length of a stop codon (3 bases), then leave it unchanged + * if exon length matches protein, or is shorter, then leave it unchanged */ - if (expectedCdsLength >= exonLength - || expectedCdsLength == exonLength - 3) + if (expectedCdsLength >= exonLength) { return exon; }