/*
* Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
* Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Jalview. If not, see
)
// feature score is not included
sar.appendFeature(sb, 1, null, sf);
assertEquals("123456disulfide bond 1:3", sb.toString());
// residuePos == 3 matches end of feature, text appended
//
is prefixed once sb.length() > 6
sar.appendFeature(sb, 3, null, sf);
assertEquals("123456disulfide bond 1:3
disulfide bond 1:3",
sb.toString());
}
@Test(groups = "Functional")
public void testAppendFeature_status()
{
SequenceAnnotationReport sar = new SequenceAnnotationReport(null);
StringBuilder sb = new StringBuilder();
SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3,
Float.NaN, "group");
sf.setStatus("Confirmed");
sar.appendFeature(sb, 1, null, sf);
assertEquals("METAL 1 3; Fe2-S; (Confirmed)", sb.toString());
}
@Test(groups = "Functional")
public void testAppendFeature_withScore()
{
SequenceAnnotationReport sar = new SequenceAnnotationReport(null);
StringBuilder sb = new StringBuilder();
SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3, 1.3f,
"group");
Map
is appended to a buffer > 6 in length
assertEquals("METAL 1 3; Fe2-S
METAL 1 3; Fe2-S Score=1.3",
sb.toString());
/*
* map has min == max for this feature type - score is not shown:
*/
minmax.put("METAL", new float[][] { { 2f, 2f }, null });
sb.setLength(0);
sar.appendFeature(sb, 1, minmax, sf);
assertEquals("METAL 1 3; Fe2-S", sb.toString());
}
@Test(groups = "Functional")
public void testAppendFeature_noScore()
{
SequenceAnnotationReport sar = new SequenceAnnotationReport(null);
StringBuilder sb = new StringBuilder();
SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3,
Float.NaN, "group");
sar.appendFeature(sb, 1, null, sf);
assertEquals("METAL 1 3; Fe2-S", sb.toString());
}
@Test(groups = "Functional")
public void testAppendFeature_clinicalSignificance()
{
SequenceAnnotationReport sar = new SequenceAnnotationReport(null);
StringBuilder sb = new StringBuilder();
SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3,
Float.NaN, "group");
sf.setValue("clinical_significance", "Benign");
sar.appendFeature(sb, 1, null, sf);
assertEquals("METAL 1 3; Fe2-S; Benign", sb.toString());
}
@Test(groups = "Functional")
public void testAppendFeature_withScoreStatusClinicalSignificance()
{
SequenceAnnotationReport sar = new SequenceAnnotationReport(null);
StringBuilder sb = new StringBuilder();
SequenceFeature sf = new SequenceFeature("METAL", "Fe2-S", 1, 3, 1.3f,
"group");
sf.setStatus("Confirmed");
sf.setValue("clinical_significance", "Benign");
Map