git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
384e43c
)
JAL-1912 Double.NaN breaks JSON serialization - added check to prevent this
author
tcofoegbu
<tcnofoegbu@dundee.ac.uk>
Thu, 1 Oct 2015 14:53:10 +0000
(15:53 +0100)
committer
tcofoegbu
<tcnofoegbu@dundee.ac.uk>
Thu, 1 Oct 2015 14:53:10 +0000
(15:53 +0100)
src/jalview/datamodel/AlignmentAnnotation.java
patch
|
blob
|
history
src/jalview/io/JSONFile.java
patch
|
blob
|
history
src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java
patch
|
blob
|
history
diff --git
a/src/jalview/datamodel/AlignmentAnnotation.java
b/src/jalview/datamodel/AlignmentAnnotation.java
index
bb45b67
..
9c3af27
100755
(executable)
--- a/
src/jalview/datamodel/AlignmentAnnotation.java
+++ b/
src/jalview/datamodel/AlignmentAnnotation.java
@@
-959,12
+959,8
@@
public class AlignmentAnnotation
public void adjustForAlignment()
{
public void adjustForAlignment()
{
- if (sequenceRef == null)
- {
- return;
- }
-
- if (annotations == null)
+ if (sequenceRef == null || sequenceMapping == null
+ || annotations == null)
{
return;
}
{
return;
}
diff --git
a/src/jalview/io/JSONFile.java
b/src/jalview/io/JSONFile.java
index
4e293db
..
7e7052f
100644
(file)
--- a/
src/jalview/io/JSONFile.java
+++ b/
src/jalview/io/JSONFile.java
@@
-374,7
+374,10
@@
public class JSONFile extends AlignFile implements ComplexAlignFile
AlignmentAnnotationPojo alignAnnotPojo = new AlignmentAnnotationPojo();
alignAnnotPojo.setDescription(annot.description);
alignAnnotPojo.setLabel(annot.label);
AlignmentAnnotationPojo alignAnnotPojo = new AlignmentAnnotationPojo();
alignAnnotPojo.setDescription(annot.description);
alignAnnotPojo.setLabel(annot.label);
- alignAnnotPojo.setScore(annot.score);
+ if (!Double.isNaN(annot.score))
+ {
+ alignAnnotPojo.setScore(annot.score);
+ }
alignAnnotPojo.setCalcId(annot.getCalcId());
alignAnnotPojo.setGraphType(annot.graph);
alignAnnotPojo.setCalcId(annot.getCalcId());
alignAnnotPojo.setGraphType(annot.graph);
@@
-528,11
+531,6
@@
public class JSONFile extends AlignFile implements ComplexAlignFile
.hasNext();)
{
JSONObject alAnnot = alAnnotIter.next();
.hasNext();)
{
JSONObject alAnnot = alAnnotIter.next();
- if (alAnnot == null)
- {
- continue;
- }
-
JSONArray annotJsonArray = (JSONArray) alAnnot.get("annotations");
Annotation[] annotations = new Annotation[annotJsonArray.size()];
int count = 0;
JSONArray annotJsonArray = (JSONArray) alAnnot.get("annotations");
Annotation[] annotations = new Annotation[annotJsonArray.size()];
int count = 0;
diff --git
a/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java
b/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java
index
9ac3957
..
7e729f9
100644
(file)
--- a/
src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java
+++ b/
src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java
@@
-60,6
+60,7
@@
public class AlignmentAnnotationPojo
@Attributes(required = false, description = "Score of the annotation")
private double score;
@Attributes(required = false, description = "Score of the annotation")
private double score;
+ @Attributes(required = false, description = "Annotation generation source")
private String calcId;
public String getLabel()
private String calcId;
public String getLabel()