git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3725 patch EMBL flat file to exclude stop codon from the mapping (for 2.11.1...
[jalview.git]
/
src
/
jalview
/
io
/
EmblFlatFile.java
diff --git
a/src/jalview/io/EmblFlatFile.java
b/src/jalview/io/EmblFlatFile.java
index
900aef8
..
21e66d2
100644
(file)
--- a/
src/jalview/io/EmblFlatFile.java
+++ b/
src/jalview/io/EmblFlatFile.java
@@
-118,6
+118,7
@@
public class EmblFlatFile extends AlignFile // FileParse
*
* @throws IOException
*/
*
* @throws IOException
*/
+ @Override
public void parse() throws IOException
{
String line = nextLine();
public void parse() throws IOException
{
String line = nextLine();
@@
-322,11
+323,14
@@
public class EmblFlatFile extends AlignFile // FileParse
return nextLine();
}
return nextLine();
}
+ /*
+ * parse location - which may be over more than one line e.g. EAW51554
+ */
CdsData data = new CdsData();
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
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);
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();
line = parseFeatureQualifier(sb, qualifier);
String featureValue = sb.toString();
@@
-427,7
+431,7
@@
public class EmblFlatFile extends AlignFile // FileParse
*/
static String removeQuotes(String value)
{
*/
static String removeQuotes(String value)
{
- if (value == null)
+ if (value == null)
{
return 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
*/
* 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(" ");
}
{
sb.append(" ");
}
@@
-836,11
+841,9
@@
public class EmblFlatFile extends AlignFile // FileParse
int exonLength = MappingUtils.getLength(Arrays.asList(exon));
/*
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;
}
{
return exon;
}