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
Merge branch 'features/JAL-2110_crossRefDuplications' into merge_JAL-2110
[jalview.git]
/
src
/
jalview
/
datamodel
/
xdb
/
embl
/
EmblEntry.java
diff --git
a/src/jalview/datamodel/xdb/embl/EmblEntry.java
b/src/jalview/datamodel/xdb/embl/EmblEntry.java
index
ac0d339
..
5409d5b
100644
(file)
--- a/
src/jalview/datamodel/xdb/embl/EmblEntry.java
+++ b/
src/jalview/datamodel/xdb/embl/EmblEntry.java
@@
-198,6
+198,7
@@
public class EmblEntry
retrievedref.setMap(new Mapping(null, new int[] { 1, dna.getLength() },
new int[] { 1, dna.getLength() }, 1, 1));
retrievedref.setMap(new Mapping(null, new int[] { 1, dna.getLength() },
new int[] { 1, dna.getLength() }, 1, 1));
+
/*
* transform EMBL Database refs to canonical form
*/
/*
* transform EMBL Database refs to canonical form
*/
@@
-210,13
+211,14
@@
public class EmblEntry
}
}
}
}
+ SequenceIdMatcher matcher = new SequenceIdMatcher(peptides);
try
{
for (EmblFeature feature : features)
{
if (FeatureProperties.isCodingFeature(sourceDb, feature.getName()))
{
try
{
for (EmblFeature feature : features)
{
if (FeatureProperties.isCodingFeature(sourceDb, feature.getName()))
{
- parseCodingFeature(feature, sourceDb, dna, peptides);
+ parseCodingFeature(feature, sourceDb, dna, peptides, matcher);
}
}
} catch (Exception e)
}
}
} catch (Exception e)
@@
-244,9
+246,11
@@
public class EmblEntry
* parent dna sequence for this record
* @param peptides
* list of protein product sequences for Embl entry
* parent dna sequence for this record
* @param peptides
* list of protein product sequences for Embl entry
+ * @param matcher
+ * helper to match xrefs in already retrieved sequences
*/
void parseCodingFeature(EmblFeature feature, String sourceDb,
*/
void parseCodingFeature(EmblFeature feature, String sourceDb,
- SequenceI dna, List<SequenceI> peptides)
+ SequenceI dna, List<SequenceI> peptides, SequenceIdMatcher matcher)
{
boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS);
{
boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS);
@@
-256,7
+260,6
@@
public class EmblEntry
String prname = "";
String prid = null;
Map<String, String> vals = new Hashtable<String, String>();
String prname = "";
String prid = null;
Map<String, String> vals = new Hashtable<String, String>();
- SequenceIdMatcher matcher = new SequenceIdMatcher(peptides);
/*
* codon_start 1/2/3 in EMBL corresponds to phase 0/1/2 in CDS
/*
* codon_start 1/2/3 in EMBL corresponds to phase 0/1/2 in CDS
@@
-280,13
+283,13
@@
public class EmblEntry
}
else if (qname.equals("protein_id"))
{
}
else if (qname.equals("protein_id"))
{
- prid = q.getValues()[0];
+ prid = q.getValues()[0].trim();
}
else if (qname.equals("codon_start"))
{
try
{
}
else if (qname.equals("codon_start"))
{
try
{
- codonStart = Integer.parseInt(q.getValues()[0]);
+ codonStart = Integer.parseInt(q.getValues()[0].trim());
} catch (NumberFormatException e)
{
System.err.println("Invalid codon_start in XML for "
} catch (NumberFormatException e)
{
System.err.println("Invalid codon_start in XML for "
@@
-296,7
+299,7
@@
public class EmblEntry
else if (qname.equals("product"))
{
// sometimes name is returned e.g. for V00488
else if (qname.equals("product"))
{
// sometimes name is returned e.g. for V00488
- prname = q.getValues()[0];
+ prname = q.getValues()[0].trim();
}
else
{
}
else
{