| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.datamodel; |
| 22 |
|
|
| 23 |
|
import java.awt.Color; |
| 24 |
|
import java.util.ArrayList; |
| 25 |
|
import java.util.Arrays; |
| 26 |
|
import java.util.Collection; |
| 27 |
|
import java.util.Collections; |
| 28 |
|
import java.util.HashMap; |
| 29 |
|
import java.util.Iterator; |
| 30 |
|
import java.util.List; |
| 31 |
|
import java.util.Locale; |
| 32 |
|
import java.util.Map; |
| 33 |
|
import java.util.Map.Entry; |
| 34 |
|
|
| 35 |
|
import jalview.analysis.Rna; |
| 36 |
|
import jalview.analysis.SecStrConsensus.SimpleBP; |
| 37 |
|
import jalview.analysis.WUSSParseException; |
| 38 |
|
import jalview.structure.StructureImportSettings; |
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
@author |
| 44 |
|
@version |
| 45 |
|
|
| |
|
| 78.9% |
Uncovered Elements: 175 (828) |
Complexity: 310 |
Complexity Density: 0.66 |
|
| 46 |
|
public class AlignmentAnnotation |
| 47 |
|
{ |
| 48 |
|
|
| 49 |
|
private static final String ANNOTATION_ID_PREFIX = "ann"; |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
public static final String ANNOTATION_DETAILS = "ANNOTATION_DETAILS"; |
| 54 |
|
|
| 55 |
|
|
| 56 |
|
|
| 57 |
|
|
| 58 |
|
public static final int SEQUENCE_PROFILE = 0; |
| 59 |
|
|
| 60 |
|
public static final int STRUCTURE_PROFILE = 1; |
| 61 |
|
|
| 62 |
|
public static final int CDNA_PROFILE = 2; |
| 63 |
|
|
| 64 |
|
private static long counter = 0; |
| 65 |
|
|
| 66 |
|
private long noOfSequencesIncluded = -1; |
| 67 |
|
|
| 68 |
|
private long noOfTracksIncluded = -1; |
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
public boolean autoCalculated = false; |
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
public String annotationId; |
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 87 |
|
public SequenceI sequenceRef; |
| 88 |
|
|
| 89 |
|
|
| 90 |
|
public String label; |
| 91 |
|
|
| 92 |
|
|
| 93 |
|
public String description; |
| 94 |
|
|
| 95 |
|
|
| 96 |
|
public Annotation[] annotations; |
| 97 |
|
|
| 98 |
|
public List<SimpleBP> bps = null; |
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
public SequenceFeature[] _rnasecstr = null; |
| 104 |
|
|
| 105 |
|
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
|
private long invalidrnastruc = -2; |
| 110 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| 114 |
|
private StructureImportSettings.TFType tfType = StructureImportSettings.TFType.DEFAULT; |
| 115 |
|
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
private Color annotationGroupColour = null; |
| 121 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 122 |
236 |
public void setTFType(StructureImportSettings.TFType t)... |
| 123 |
|
{ |
| 124 |
236 |
tfType = t; |
| 125 |
|
} |
| 126 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 127 |
0 |
public StructureImportSettings.TFType getTFType()... |
| 128 |
|
{ |
| 129 |
0 |
return tfType; |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
|
| 136 |
|
@param |
| 137 |
|
|
| |
|
| 93.3% |
Uncovered Elements: 1 (15) |
Complexity: 5 |
Complexity Density: 0.45 |
|
| 138 |
1362 |
private void _updateRnaSecStr(CharSequence rnaAnnotation)... |
| 139 |
|
{ |
| 140 |
1362 |
try |
| 141 |
|
{ |
| 142 |
1362 |
_rnasecstr = Rna.getHelixMap(rnaAnnotation); |
| 143 |
974 |
invalidrnastruc = -1; |
| 144 |
|
} catch (WUSSParseException px) |
| 145 |
|
{ |
| 146 |
|
|
| 147 |
388 |
invalidrnastruc = px.getProblemPos(); |
| 148 |
|
} |
| 149 |
1362 |
if (invalidrnastruc > -1) |
| 150 |
|
{ |
| 151 |
388 |
return; |
| 152 |
|
} |
| 153 |
|
|
| 154 |
974 |
if (_rnasecstr != null && _rnasecstr.length > 0) |
| 155 |
|
{ |
| 156 |
|
|
| 157 |
974 |
isrna = true; |
| 158 |
974 |
showAllColLabels = true; |
| 159 |
974 |
scaleColLabel = true; |
| 160 |
974 |
_markRnaHelices(); |
| 161 |
|
} |
| 162 |
|
|
| 163 |
|
|
| 164 |
|
|
| 165 |
|
} |
| 166 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 4 |
Complexity Density: 0.36 |
|
| 167 |
974 |
private void _markRnaHelices()... |
| 168 |
|
{ |
| 169 |
974 |
int mxval = 0; |
| 170 |
|
|
| 171 |
|
|
| 172 |
|
|
| 173 |
19791 |
for (int x = 0; x < _rnasecstr.length; x++) |
| 174 |
|
{ |
| 175 |
|
|
| 176 |
|
|
| 177 |
|
|
| 178 |
|
|
| 179 |
|
|
| 180 |
|
|
| 181 |
18817 |
int val = 0; |
| 182 |
18817 |
try |
| 183 |
|
{ |
| 184 |
18817 |
val = Integer.valueOf(_rnasecstr[x].getFeatureGroup()); |
| 185 |
18817 |
if (mxval < val) |
| 186 |
|
{ |
| 187 |
311 |
mxval = val; |
| 188 |
|
} |
| 189 |
|
} catch (NumberFormatException q) |
| 190 |
|
{ |
| 191 |
|
} |
| 192 |
18817 |
; |
| 193 |
|
|
| 194 |
18817 |
annotations[_rnasecstr[x].getBegin()].value = val; |
| 195 |
18817 |
annotations[_rnasecstr[x].getEnd()].value = val; |
| 196 |
|
|
| 197 |
|
|
| 198 |
|
|
| 199 |
|
} |
| 200 |
974 |
setScore(mxval); |
| 201 |
|
} |
| 202 |
|
|
| 203 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 204 |
2543 |
public Color getAnnotationGroupColour()... |
| 205 |
|
{ |
| 206 |
2543 |
return annotationGroupColour; |
| 207 |
|
} |
| 208 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 209 |
442 |
public void setAnnotationGroupColour(Color annotationGroupColour)... |
| 210 |
|
{ |
| 211 |
442 |
this.annotationGroupColour = annotationGroupColour; |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
|
| 215 |
|
|
| 216 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 217 |
12 |
public SequenceFeature[] getRnaSecondaryStructure()... |
| 218 |
|
{ |
| 219 |
12 |
return this._rnasecstr; |
| 220 |
|
} |
| 221 |
|
|
| 222 |
|
|
| 223 |
|
|
| 224 |
|
|
| 225 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 226 |
4 |
public boolean rnaSecondaryStructureEquivalent(AlignmentAnnotation that)... |
| 227 |
|
{ |
| 228 |
4 |
return rnaSecondaryStructureEquivalent(that, true); |
| 229 |
|
} |
| 230 |
|
|
| |
|
| 70.3% |
Uncovered Elements: 11 (37) |
Complexity: 13 |
Complexity Density: 0.62 |
|
| 231 |
4 |
public boolean rnaSecondaryStructureEquivalent(AlignmentAnnotation that,... |
| 232 |
|
boolean compareType) |
| 233 |
|
{ |
| 234 |
4 |
SequenceFeature[] thisSfArray = this.getRnaSecondaryStructure(); |
| 235 |
4 |
SequenceFeature[] thatSfArray = that.getRnaSecondaryStructure(); |
| 236 |
4 |
if (thisSfArray == null || thatSfArray == null) |
| 237 |
|
{ |
| 238 |
0 |
return thisSfArray == null && thatSfArray == null; |
| 239 |
|
} |
| 240 |
4 |
if (thisSfArray.length != thatSfArray.length) |
| 241 |
|
{ |
| 242 |
1 |
return false; |
| 243 |
|
} |
| 244 |
3 |
Arrays.sort(thisSfArray, new SFSortByEnd()); |
| 245 |
|
|
| 246 |
3 |
Arrays.sort(thatSfArray, new SFSortByEnd()); |
| 247 |
|
|
| 248 |
15 |
for (int i = 0; i < thisSfArray.length; i++) |
| 249 |
|
{ |
| 250 |
13 |
SequenceFeature thisSf = thisSfArray[i]; |
| 251 |
13 |
SequenceFeature thatSf = thatSfArray[i]; |
| 252 |
13 |
if (compareType) |
| 253 |
|
{ |
| 254 |
13 |
if (thisSf.getType() == null || thatSf.getType() == null) |
| 255 |
|
{ |
| 256 |
0 |
if (thisSf.getType() == null && thatSf.getType() == null) |
| 257 |
|
{ |
| 258 |
0 |
continue; |
| 259 |
|
} |
| 260 |
|
else |
| 261 |
|
{ |
| 262 |
0 |
return false; |
| 263 |
|
} |
| 264 |
|
} |
| 265 |
13 |
if (!thisSf.getType().equals(thatSf.getType())) |
| 266 |
|
{ |
| 267 |
0 |
return false; |
| 268 |
|
} |
| 269 |
|
} |
| 270 |
13 |
if (!(thisSf.getBegin() == thatSf.getBegin() |
| 271 |
|
&& thisSf.getEnd() == thatSf.getEnd())) |
| 272 |
|
{ |
| 273 |
1 |
return false; |
| 274 |
|
} |
| 275 |
|
} |
| 276 |
2 |
return true; |
| 277 |
|
|
| 278 |
|
} |
| 279 |
|
|
| 280 |
|
|
| 281 |
|
|
| 282 |
|
|
| 283 |
|
private Map<Integer, Annotation> sequenceMapping; |
| 284 |
|
|
| 285 |
|
|
| 286 |
|
|
| 287 |
|
|
| 288 |
|
public float graphMin; |
| 289 |
|
|
| 290 |
|
|
| 291 |
|
|
| 292 |
|
|
| 293 |
|
public float graphMax; |
| 294 |
|
|
| 295 |
|
|
| 296 |
|
|
| 297 |
|
|
| 298 |
|
public double score = Double.NaN; |
| 299 |
|
|
| 300 |
|
|
| 301 |
|
|
| 302 |
|
|
| 303 |
|
public boolean hasScore = false; |
| 304 |
|
|
| 305 |
|
public GraphLine threshold; |
| 306 |
|
|
| 307 |
|
|
| 308 |
|
|
| 309 |
|
|
| 310 |
|
public boolean editable = false; |
| 311 |
|
|
| 312 |
|
|
| 313 |
|
public boolean hasIcons; |
| 314 |
|
|
| 315 |
|
|
| 316 |
|
public boolean hasText; |
| 317 |
|
|
| 318 |
|
|
| 319 |
|
public boolean visible = true; |
| 320 |
|
|
| 321 |
|
|
| 322 |
|
|
| 323 |
|
|
| 324 |
|
|
| 325 |
|
public boolean hasData=true; |
| 326 |
|
|
| 327 |
|
|
| 328 |
|
|
| 329 |
|
public int graphGroup = -1; |
| 330 |
|
|
| 331 |
|
|
| 332 |
|
public int height = 0; |
| 333 |
|
|
| 334 |
|
public int graph = 0; |
| 335 |
|
|
| 336 |
|
public int graphHeight = 40; |
| 337 |
|
|
| 338 |
|
public boolean padGaps = false; |
| 339 |
|
|
| 340 |
|
public static final int NO_GRAPH = 0; |
| 341 |
|
|
| 342 |
|
public static final int BAR_GRAPH = 1; |
| 343 |
|
|
| 344 |
|
public static final int LINE_GRAPH = 2; |
| 345 |
|
|
| 346 |
|
public static final int CONTACT_MAP = 4; |
| 347 |
|
|
| 348 |
|
|
| 349 |
|
|
| 350 |
|
|
| 351 |
|
|
| 352 |
|
public static final String CONTACT_MAP_NOGROUPS = "CMNOGRPS"; |
| 353 |
|
|
| 354 |
|
public boolean belowAlignment = true; |
| 355 |
|
|
| 356 |
|
public SequenceGroup groupRef = null; |
| 357 |
|
|
| 358 |
|
|
| 359 |
|
|
| 360 |
|
|
| 361 |
|
public boolean showAllColLabels = false; |
| 362 |
|
|
| 363 |
|
|
| 364 |
|
|
| 365 |
|
|
| 366 |
|
public boolean scaleColLabel = false; |
| 367 |
|
|
| 368 |
|
|
| 369 |
|
|
| 370 |
|
|
| 371 |
|
public boolean centreColLabels = false; |
| 372 |
|
|
| 373 |
|
private boolean isrna; |
| 374 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 375 |
260 |
public static int getGraphValueFromString(String string)... |
| 376 |
|
{ |
| 377 |
260 |
if (string.equalsIgnoreCase("BAR_GRAPH")) |
| 378 |
|
{ |
| 379 |
32 |
return BAR_GRAPH; |
| 380 |
|
} |
| 381 |
228 |
else if (string.equalsIgnoreCase("LINE_GRAPH")) |
| 382 |
|
{ |
| 383 |
171 |
return LINE_GRAPH; |
| 384 |
|
} |
| 385 |
|
else |
| 386 |
|
{ |
| 387 |
57 |
return NO_GRAPH; |
| 388 |
|
} |
| 389 |
|
} |
| 390 |
|
|
| 391 |
|
|
| 392 |
|
|
| 393 |
|
|
| 394 |
|
@param |
| 395 |
|
|
| 396 |
|
@param |
| 397 |
|
|
| 398 |
|
@param |
| 399 |
|
|
| 400 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
| 401 |
35099 |
public AlignmentAnnotation(String label, String description,... |
| 402 |
|
Annotation[] annotations) |
| 403 |
|
{ |
| 404 |
35099 |
setAnnotationId(); |
| 405 |
|
|
| 406 |
35099 |
editable = true; |
| 407 |
35099 |
this.label = label; |
| 408 |
35099 |
this.description = description; |
| 409 |
35099 |
this.annotations = annotations; |
| 410 |
|
|
| 411 |
35099 |
validateRangeAndDisplay(); |
| 412 |
|
} |
| 413 |
|
|
| 414 |
|
|
| 415 |
|
|
| 416 |
|
|
| 417 |
|
|
| |
|
| 96.5% |
Uncovered Elements: 2 (57) |
Complexity: 73 |
Complexity Density: 2.35 |
|
| 418 |
7218 |
void areLabelsSecondaryStructure()... |
| 419 |
|
{ |
| 420 |
7218 |
boolean nonSSLabel = false; |
| 421 |
7218 |
isrna = false; |
| 422 |
7218 |
StringBuffer rnastring = new StringBuffer(); |
| 423 |
|
|
| 424 |
7218 |
char firstChar = 0; |
| 425 |
787645 |
for (int i = 0; i < annotations.length; i++) |
| 426 |
|
{ |
| 427 |
|
|
| 428 |
780427 |
if (annotations[i] == null) |
| 429 |
|
{ |
| 430 |
170087 |
continue; |
| 431 |
|
} |
| 432 |
610340 |
if (annotations[i].secondaryStructure == 'H' |
| 433 |
|
|| annotations[i].secondaryStructure == 'E') |
| 434 |
|
{ |
| 435 |
|
|
| 436 |
|
|
| 437 |
66349 |
hasIcons |= true; |
| 438 |
|
} |
| 439 |
|
else |
| 440 |
|
|
| 441 |
|
{ |
| 442 |
|
|
| 443 |
|
|
| 444 |
|
|
| 445 |
|
|
| 446 |
|
|
| 447 |
|
|
| 448 |
|
|
| 449 |
543991 |
if (annotations[i].secondaryStructure == '(' |
| 450 |
|
|| annotations[i].secondaryStructure == '[' |
| 451 |
|
|| annotations[i].secondaryStructure == '<' |
| 452 |
|
|| annotations[i].secondaryStructure == '{' |
| 453 |
|
|| annotations[i].secondaryStructure == 'A' |
| 454 |
|
|
| 455 |
|
|
| 456 |
|
|| annotations[i].secondaryStructure == 'D' |
| 457 |
|
|
| 458 |
|
|
| 459 |
|
|| annotations[i].secondaryStructure == 'F' |
| 460 |
|
|
| 461 |
|
|
| 462 |
|
|
| 463 |
|
|
| 464 |
|
|| annotations[i].secondaryStructure == 'J' |
| 465 |
|
|| annotations[i].secondaryStructure == 'K' |
| 466 |
|
|| annotations[i].secondaryStructure == 'L' |
| 467 |
|
|| annotations[i].secondaryStructure == 'M' |
| 468 |
|
|| annotations[i].secondaryStructure == 'N' |
| 469 |
|
|| annotations[i].secondaryStructure == 'O' |
| 470 |
|
|| annotations[i].secondaryStructure == 'P' |
| 471 |
|
|| annotations[i].secondaryStructure == 'Q' |
| 472 |
|
|| annotations[i].secondaryStructure == 'R' |
| 473 |
|
|
| 474 |
|
|
| 475 |
|
|| annotations[i].secondaryStructure == 'U' |
| 476 |
|
|| annotations[i].secondaryStructure == 'V' |
| 477 |
|
|| annotations[i].secondaryStructure == 'W' |
| 478 |
|
|
| 479 |
|
|| annotations[i].secondaryStructure == 'Y' |
| 480 |
|
|| annotations[i].secondaryStructure == 'Z') |
| 481 |
|
{ |
| 482 |
14482 |
hasIcons |= true; |
| 483 |
14482 |
isrna |= true; |
| 484 |
|
} |
| 485 |
|
} |
| 486 |
|
|
| 487 |
|
|
| 488 |
|
|
| 489 |
|
|
| 490 |
610340 |
if (annotations[i].displayCharacter == null |
| 491 |
|
|| annotations[i].displayCharacter.length() == 0) |
| 492 |
|
{ |
| 493 |
242917 |
rnastring.append('.'); |
| 494 |
242917 |
continue; |
| 495 |
|
} |
| 496 |
367423 |
if (annotations[i].displayCharacter.length() == 1) |
| 497 |
|
{ |
| 498 |
313227 |
firstChar = annotations[i].displayCharacter.charAt(0); |
| 499 |
|
|
| 500 |
|
|
| 501 |
313227 |
if (annotations[i].secondaryStructure != ' ' && !hasIcons && |
| 502 |
|
|
| 503 |
|
|
| 504 |
|
|
| 505 |
|
|
| 506 |
|
|
| 507 |
|
|
| 508 |
|
|
| 509 |
|
firstChar != ' ' && firstChar != '$' && firstChar != 0xCE |
| 510 |
|
&& firstChar != '(' && firstChar != '[' && firstChar != '<' |
| 511 |
|
&& firstChar != '{' && firstChar != 'A' && firstChar != 'B' |
| 512 |
|
&& firstChar != 'C' && firstChar != 'D' && firstChar != 'E' |
| 513 |
|
&& firstChar != 'F' && firstChar != 'G' && firstChar != 'H' |
| 514 |
|
&& firstChar != 'I' && firstChar != 'J' && firstChar != 'K' |
| 515 |
|
&& firstChar != 'L' && firstChar != 'M' && firstChar != 'N' |
| 516 |
|
&& firstChar != 'O' && firstChar != 'P' && firstChar != 'Q' |
| 517 |
|
&& firstChar != 'R' && firstChar != 'S' && firstChar != 'T' |
| 518 |
|
&& firstChar != 'U' && firstChar != 'V' && firstChar != 'W' |
| 519 |
|
&& firstChar != 'X' && firstChar != 'Y' && firstChar != 'Z' |
| 520 |
|
&& firstChar != '-' |
| 521 |
|
&& firstChar < jalview.schemes.ResidueProperties.aaIndex.length) |
| 522 |
|
{ |
| 523 |
4406 |
if (jalview.schemes.ResidueProperties.aaIndex[firstChar] < 23) |
| 524 |
|
|
| 525 |
|
|
| 526 |
|
|
| 527 |
|
|
| 528 |
|
|
| 529 |
|
{ |
| 530 |
11 |
nonSSLabel = true; |
| 531 |
|
} |
| 532 |
|
} |
| 533 |
|
} |
| 534 |
|
else |
| 535 |
|
{ |
| 536 |
54196 |
rnastring.append(annotations[i].displayCharacter.charAt(1)); |
| 537 |
|
} |
| 538 |
|
|
| 539 |
367423 |
if (annotations[i].displayCharacter.length() > 0) |
| 540 |
|
{ |
| 541 |
367423 |
hasText = true; |
| 542 |
|
} |
| 543 |
|
} |
| 544 |
|
|
| 545 |
7218 |
if (nonSSLabel) |
| 546 |
|
{ |
| 547 |
1 |
hasIcons = false; |
| 548 |
12 |
for (int j = 0; j < annotations.length; j++) |
| 549 |
|
{ |
| 550 |
11 |
if (annotations[j] != null |
| 551 |
|
&& annotations[j].secondaryStructure != ' ') |
| 552 |
|
{ |
| 553 |
11 |
annotations[j].displayCharacter = String |
| 554 |
|
.valueOf(annotations[j].secondaryStructure); |
| 555 |
11 |
annotations[j].secondaryStructure = ' '; |
| 556 |
|
} |
| 557 |
|
|
| 558 |
|
} |
| 559 |
|
} |
| 560 |
|
else |
| 561 |
|
{ |
| 562 |
7217 |
if (isrna) |
| 563 |
|
{ |
| 564 |
940 |
_updateRnaSecStr(new AnnotCharSequence()); |
| 565 |
|
} |
| 566 |
|
} |
| 567 |
|
} |
| 568 |
|
|
| 569 |
|
|
| 570 |
|
|
| 571 |
|
|
| 572 |
|
|
| 573 |
|
@author |
| 574 |
|
|
| 575 |
|
|
| |
|
| 92.6% |
Uncovered Elements: 2 (27) |
Complexity: 17 |
Complexity Density: 1.55 |
|
| 576 |
|
private class AnnotCharSequence implements CharSequence |
| 577 |
|
{ |
| 578 |
|
int offset = 0; |
| 579 |
|
|
| 580 |
|
int max = 0; |
| 581 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 582 |
1371 |
public AnnotCharSequence()... |
| 583 |
|
{ |
| 584 |
1371 |
this(0, annotations.length); |
| 585 |
|
} |
| 586 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 587 |
1371 |
AnnotCharSequence(int start, int end)... |
| 588 |
|
{ |
| 589 |
1371 |
offset = start; |
| 590 |
1371 |
max = end; |
| 591 |
|
} |
| 592 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 593 |
0 |
@Override... |
| 594 |
|
public CharSequence subSequence(int start, int end) |
| 595 |
|
{ |
| 596 |
0 |
return new AnnotCharSequence(offset + start, offset + end); |
| 597 |
|
} |
| 598 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 599 |
66000 |
@Override... |
| 600 |
|
public int length() |
| 601 |
|
{ |
| 602 |
66000 |
return max - offset; |
| 603 |
|
} |
| 604 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 7 |
Complexity Density: 7 |
|
| 605 |
65060 |
@Override... |
| 606 |
|
public char charAt(int index) |
| 607 |
|
{ |
| 608 |
65060 |
return ((index + offset < 0) || (index + offset) >= max |
| 609 |
|
|| annotations[index + offset] == null |
| 610 |
|
|| (annotations[index + offset].secondaryStructure <= ' ') |
| 611 |
|
? ' ' |
| 612 |
27090 |
: annotations[index + offset].displayCharacter == null |
| 613 |
|
|| annotations[index |
| 614 |
|
+ offset].displayCharacter |
| 615 |
|
.length() == 0 |
| 616 |
|
? annotations[index |
| 617 |
|
+ offset].secondaryStructure |
| 618 |
|
: annotations[index |
| 619 |
|
+ offset].displayCharacter |
| 620 |
|
.charAt(0)); |
| 621 |
|
} |
| 622 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 6 |
Complexity Density: 1.2 |
|
| 623 |
431 |
@Override... |
| 624 |
|
public String toString() |
| 625 |
|
{ |
| 626 |
431 |
char[] string = new char[max - offset]; |
| 627 |
431 |
int mx = annotations.length; |
| 628 |
|
|
| 629 |
31936 |
for (int i = offset; i < mx; i++) |
| 630 |
|
{ |
| 631 |
31505 |
string[i] = (annotations[i] == null |
| 632 |
|
|| (annotations[i].secondaryStructure <= 32)) |
| 633 |
|
? ' ' |
| 634 |
13398 |
: (annotations[i].displayCharacter == null |
| 635 |
|
|| annotations[i].displayCharacter |
| 636 |
|
.length() == 0 |
| 637 |
|
? annotations[i].secondaryStructure |
| 638 |
|
: annotations[i].displayCharacter |
| 639 |
|
.charAt(0)); |
| 640 |
|
} |
| 641 |
431 |
return new String(string); |
| 642 |
|
} |
| 643 |
|
}; |
| 644 |
|
|
| 645 |
|
private long _lastrnaannot = -1; |
| 646 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
| 647 |
4325 |
public String getRNAStruc()... |
| 648 |
|
{ |
| 649 |
4325 |
if (isrna) |
| 650 |
|
{ |
| 651 |
431 |
String rnastruc = new AnnotCharSequence().toString(); |
| 652 |
431 |
if (_lastrnaannot != rnastruc.hashCode()) |
| 653 |
|
{ |
| 654 |
|
|
| 655 |
422 |
_lastrnaannot = rnastruc.hashCode(); |
| 656 |
422 |
_updateRnaSecStr(rnastruc); |
| 657 |
|
} |
| 658 |
431 |
return rnastruc; |
| 659 |
|
} |
| 660 |
3894 |
return null; |
| 661 |
|
} |
| 662 |
|
|
| 663 |
|
|
| 664 |
|
|
| 665 |
|
|
| 666 |
|
@param |
| 667 |
|
|
| 668 |
|
@param |
| 669 |
|
|
| 670 |
|
@param |
| 671 |
|
|
| 672 |
|
@param |
| 673 |
|
|
| 674 |
|
@param |
| 675 |
|
|
| 676 |
|
@param |
| 677 |
|
|
| 678 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
|
| 679 |
3706 |
public AlignmentAnnotation(String label, String description,... |
| 680 |
|
Annotation[] annotations, float min, float max, int graphType) |
| 681 |
|
{ |
| 682 |
3706 |
setAnnotationId(); |
| 683 |
|
|
| 684 |
3706 |
editable = graphType == 0; |
| 685 |
|
|
| 686 |
3706 |
this.label = label; |
| 687 |
3706 |
this.description = description; |
| 688 |
3706 |
this.annotations = annotations; |
| 689 |
3706 |
graph = graphType; |
| 690 |
3706 |
graphMin = min; |
| 691 |
3706 |
graphMax = max; |
| 692 |
3706 |
validateRangeAndDisplay(); |
| 693 |
|
} |
| 694 |
|
|
| 695 |
|
|
| 696 |
|
|
| 697 |
|
|
| 698 |
|
|
| |
|
| 96.6% |
Uncovered Elements: 2 (59) |
Complexity: 18 |
Complexity Density: 0.55 |
|
| 699 |
40710 |
public void validateRangeAndDisplay()... |
| 700 |
|
{ |
| 701 |
|
|
| 702 |
40710 |
if (annotations == null) |
| 703 |
|
{ |
| 704 |
33492 |
visible = false; |
| 705 |
33492 |
invalidrnastruc = -1; |
| 706 |
33492 |
return; |
| 707 |
|
} |
| 708 |
|
|
| 709 |
7218 |
int graphType = graph; |
| 710 |
7218 |
float min = graphMin; |
| 711 |
7218 |
float max = graphMax; |
| 712 |
7218 |
boolean drawValues = true; |
| 713 |
7218 |
_linecolour = null; |
| 714 |
7218 |
if (min == max) |
| 715 |
|
{ |
| 716 |
3741 |
min = 999999999; |
| 717 |
636911 |
for (int i = 0; i < annotations.length; i++) |
| 718 |
|
{ |
| 719 |
633170 |
if (annotations[i] == null) |
| 720 |
|
{ |
| 721 |
149929 |
continue; |
| 722 |
|
} |
| 723 |
|
|
| 724 |
483241 |
if (drawValues && annotations[i].displayCharacter != null |
| 725 |
|
&& annotations[i].displayCharacter.length() > 1) |
| 726 |
|
{ |
| 727 |
1271 |
drawValues = false; |
| 728 |
|
} |
| 729 |
|
|
| 730 |
483241 |
if (annotations[i].value > max) |
| 731 |
|
{ |
| 732 |
3863 |
max = annotations[i].value; |
| 733 |
|
} |
| 734 |
|
|
| 735 |
483241 |
if (annotations[i].value < min) |
| 736 |
|
{ |
| 737 |
6866 |
min = annotations[i].value; |
| 738 |
|
} |
| 739 |
483241 |
if (_linecolour == null && annotations[i].colour != null) |
| 740 |
|
{ |
| 741 |
1391 |
_linecolour = annotations[i].colour; |
| 742 |
|
} |
| 743 |
|
} |
| 744 |
|
|
| 745 |
3741 |
if (min > 0) |
| 746 |
|
{ |
| 747 |
1778 |
min = 0; |
| 748 |
|
} |
| 749 |
|
else |
| 750 |
|
{ |
| 751 |
1963 |
if (max < 0) |
| 752 |
|
{ |
| 753 |
0 |
max = 0; |
| 754 |
|
} |
| 755 |
|
} |
| 756 |
|
} |
| 757 |
|
|
| 758 |
7218 |
graphMin = min; |
| 759 |
7218 |
graphMax = max; |
| 760 |
|
|
| 761 |
7218 |
areLabelsSecondaryStructure(); |
| 762 |
|
|
| 763 |
7218 |
if (!drawValues && graphType != NO_GRAPH) |
| 764 |
|
{ |
| 765 |
28597 |
for (int i = 0; i < annotations.length; i++) |
| 766 |
|
{ |
| 767 |
28416 |
if (annotations[i] != null) |
| 768 |
|
{ |
| 769 |
22147 |
annotations[i].displayCharacter = ""; |
| 770 |
|
} |
| 771 |
|
} |
| 772 |
|
} |
| 773 |
|
} |
| 774 |
|
|
| 775 |
|
|
| 776 |
|
|
| 777 |
|
|
| 778 |
|
|
| 779 |
|
@param |
| 780 |
|
|
| |
|
| 88.4% |
Uncovered Elements: 10 (86) |
Complexity: 16 |
Complexity Density: 0.29 |
|
| 781 |
1152 |
public AlignmentAnnotation(AlignmentAnnotation annotation)... |
| 782 |
|
{ |
| 783 |
1152 |
setAnnotationId(); |
| 784 |
1152 |
this.label = new String(annotation.label); |
| 785 |
1152 |
if (annotation.description != null) |
| 786 |
|
{ |
| 787 |
1062 |
this.description = new String(annotation.description); |
| 788 |
|
} |
| 789 |
1152 |
this.graphMin = annotation.graphMin; |
| 790 |
1152 |
this.graphMax = annotation.graphMax; |
| 791 |
1152 |
this.graph = annotation.graph; |
| 792 |
1152 |
this.graphHeight = annotation.graphHeight; |
| 793 |
1152 |
this.graphGroup = annotation.graphGroup; |
| 794 |
1152 |
this.groupRef = annotation.groupRef; |
| 795 |
1152 |
this.editable = annotation.editable; |
| 796 |
1152 |
this.autoCalculated = annotation.autoCalculated; |
| 797 |
1152 |
this.hasIcons = annotation.hasIcons; |
| 798 |
1152 |
this.hasText = annotation.hasText; |
| 799 |
1152 |
this.height = annotation.height; |
| 800 |
1152 |
this.label = annotation.label; |
| 801 |
1152 |
this.padGaps = annotation.padGaps; |
| 802 |
1152 |
this.visible = annotation.visible; |
| 803 |
1152 |
this.hasData = annotation.hasData; |
| 804 |
1152 |
this.centreColLabels = annotation.centreColLabels; |
| 805 |
1152 |
this.scaleColLabel = annotation.scaleColLabel; |
| 806 |
1152 |
this.showAllColLabels = annotation.showAllColLabels; |
| 807 |
1152 |
this.calcId = annotation.calcId; |
| 808 |
1152 |
if (annotation.properties != null) |
| 809 |
|
{ |
| 810 |
1152 |
properties = new HashMap<>(); |
| 811 |
1152 |
for (Map.Entry<String, String> val : annotation.properties.entrySet()) |
| 812 |
|
{ |
| 813 |
846 |
properties.put(val.getKey(), val.getValue()); |
| 814 |
|
} |
| 815 |
|
} |
| 816 |
? |
if (this.hasScore = annotation.hasScore) |
| 817 |
|
{ |
| 818 |
130 |
this.score = annotation.score; |
| 819 |
|
} |
| 820 |
1152 |
if (annotation.threshold != null) |
| 821 |
|
{ |
| 822 |
0 |
threshold = new GraphLine(annotation.threshold); |
| 823 |
|
} |
| 824 |
1152 |
Annotation[] ann = annotation.annotations; |
| 825 |
1152 |
if (annotation.annotations != null) |
| 826 |
|
{ |
| 827 |
1149 |
this.annotations = new Annotation[ann.length]; |
| 828 |
144210 |
for (int i = 0; i < ann.length; i++) |
| 829 |
|
{ |
| 830 |
143061 |
if (ann[i] != null) |
| 831 |
|
{ |
| 832 |
100109 |
annotations[i] = new Annotation(ann[i]); |
| 833 |
100109 |
if (_linecolour != null) |
| 834 |
|
{ |
| 835 |
0 |
_linecolour = annotations[i].colour; |
| 836 |
|
} |
| 837 |
|
} |
| 838 |
|
} |
| 839 |
|
} |
| 840 |
1152 |
if (annotation.sequenceRef != null) |
| 841 |
|
{ |
| 842 |
937 |
this.sequenceRef = annotation.sequenceRef; |
| 843 |
937 |
if (annotation.sequenceMapping != null) |
| 844 |
|
{ |
| 845 |
935 |
Integer p = null; |
| 846 |
935 |
sequenceMapping = new HashMap<>(); |
| 847 |
935 |
Iterator<Integer> pos = annotation.sequenceMapping.keySet() |
| 848 |
|
.iterator(); |
| 849 |
79376 |
while (pos.hasNext()) |
| 850 |
|
{ |
| 851 |
|
|
| 852 |
78441 |
p = pos.next(); |
| 853 |
78441 |
Annotation a = annotation.sequenceMapping.get(p); |
| 854 |
78441 |
if (a == null) |
| 855 |
|
{ |
| 856 |
0 |
continue; |
| 857 |
|
} |
| 858 |
78441 |
if (ann != null) |
| 859 |
|
{ |
| 860 |
12714517 |
for (int i = 0; i < ann.length; i++) |
| 861 |
|
{ |
| 862 |
12636076 |
if (ann[i] == a) |
| 863 |
|
{ |
| 864 |
78423 |
sequenceMapping.put(p, annotations[i]); |
| 865 |
|
} |
| 866 |
|
} |
| 867 |
|
} |
| 868 |
|
} |
| 869 |
|
} |
| 870 |
|
else |
| 871 |
|
{ |
| 872 |
2 |
this.sequenceMapping = null; |
| 873 |
|
} |
| 874 |
|
|
| 875 |
|
} |
| 876 |
|
|
| 877 |
|
|
| 878 |
|
{ |
| 879 |
|
|
| 880 |
|
} |
| 881 |
1152 |
validateRangeAndDisplay(); |
| 882 |
|
} |
| 883 |
|
|
| 884 |
|
|
| 885 |
|
|
| 886 |
|
|
| 887 |
|
|
| 888 |
|
@param |
| 889 |
|
@param |
| 890 |
|
|
| |
|
| 78.3% |
Uncovered Elements: 10 (46) |
Complexity: 12 |
Complexity Density: 0.46 |
|
| 891 |
142 |
public void restrict(int startRes, int endRes)... |
| 892 |
|
{ |
| 893 |
142 |
if (annotations == null) |
| 894 |
|
{ |
| 895 |
|
|
| 896 |
0 |
return; |
| 897 |
|
} |
| 898 |
142 |
if (startRes < 0) |
| 899 |
|
{ |
| 900 |
0 |
startRes = 0; |
| 901 |
|
} |
| 902 |
142 |
if (startRes >= annotations.length) |
| 903 |
|
{ |
| 904 |
0 |
startRes = annotations.length - 1; |
| 905 |
|
} |
| 906 |
142 |
if (endRes >= annotations.length) |
| 907 |
|
{ |
| 908 |
134 |
endRes = annotations.length - 1; |
| 909 |
|
} |
| 910 |
142 |
if (annotations == null) |
| 911 |
|
{ |
| 912 |
0 |
return; |
| 913 |
|
} |
| 914 |
142 |
Annotation[] temp = new Annotation[endRes - startRes + 1]; |
| 915 |
142 |
if (startRes < annotations.length) |
| 916 |
|
{ |
| 917 |
142 |
System.arraycopy(annotations, startRes, temp, 0, |
| 918 |
|
endRes - startRes + 1); |
| 919 |
|
} |
| 920 |
142 |
if (sequenceRef != null) |
| 921 |
|
{ |
| 922 |
|
|
| 923 |
136 |
int spos = sequenceRef.findPosition(startRes); |
| 924 |
136 |
int epos = sequenceRef.findPosition(endRes); |
| 925 |
136 |
if (sequenceMapping != null) |
| 926 |
|
{ |
| 927 |
136 |
Map<Integer, Annotation> newmapping = new HashMap<>(); |
| 928 |
136 |
Iterator<Integer> e = sequenceMapping.keySet().iterator(); |
| 929 |
11065 |
while (e.hasNext()) |
| 930 |
|
{ |
| 931 |
10929 |
Integer pos = e.next(); |
| 932 |
10929 |
if (pos.intValue() >= spos && pos.intValue() <= epos) |
| 933 |
|
{ |
| 934 |
10885 |
newmapping.put(pos, sequenceMapping.get(pos)); |
| 935 |
|
} |
| 936 |
|
} |
| 937 |
136 |
sequenceMapping.clear(); |
| 938 |
136 |
sequenceMapping = newmapping; |
| 939 |
|
} |
| 940 |
|
} |
| 941 |
142 |
annotations = temp; |
| 942 |
|
} |
| 943 |
|
|
| 944 |
|
|
| 945 |
|
|
| 946 |
|
|
| 947 |
|
@param |
| 948 |
|
|
| 949 |
|
@return |
| 950 |
|
|
| |
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
| 951 |
0 |
public boolean padAnnotation(int length)... |
| 952 |
|
{ |
| 953 |
0 |
if (annotations == null) |
| 954 |
|
{ |
| 955 |
0 |
return true; |
| 956 |
|
|
| 957 |
|
} |
| 958 |
0 |
if (annotations.length < length) |
| 959 |
|
{ |
| 960 |
0 |
Annotation[] na = new Annotation[length]; |
| 961 |
0 |
System.arraycopy(annotations, 0, na, 0, annotations.length); |
| 962 |
0 |
annotations = na; |
| 963 |
0 |
return true; |
| 964 |
|
} |
| 965 |
0 |
return annotations.length > length; |
| 966 |
|
|
| 967 |
|
} |
| 968 |
|
|
| 969 |
|
|
| 970 |
|
|
| 971 |
|
|
| 972 |
|
@return |
| 973 |
|
|
| |
|
| 88.2% |
Uncovered Elements: 4 (34) |
Complexity: 9 |
Complexity Density: 0.5 |
|
| 974 |
371 |
@Override... |
| 975 |
|
public String toString() |
| 976 |
|
{ |
| 977 |
371 |
if (annotations == null) |
| 978 |
|
{ |
| 979 |
207 |
return ""; |
| 980 |
|
} |
| 981 |
164 |
StringBuilder buffer = new StringBuilder(256); |
| 982 |
|
|
| 983 |
273 |
for (int i = 0; i < annotations.length; i++) |
| 984 |
|
{ |
| 985 |
109 |
if (annotations[i] != null) |
| 986 |
|
{ |
| 987 |
109 |
if (graph != 0) |
| 988 |
|
{ |
| 989 |
25 |
buffer.append(annotations[i].value); |
| 990 |
|
} |
| 991 |
84 |
else if (hasIcons) |
| 992 |
|
{ |
| 993 |
84 |
buffer.append(annotations[i].secondaryStructure); |
| 994 |
|
} |
| 995 |
|
else |
| 996 |
|
{ |
| 997 |
0 |
buffer.append(annotations[i].displayCharacter); |
| 998 |
|
} |
| 999 |
|
} |
| 1000 |
|
|
| 1001 |
109 |
buffer.append(", "); |
| 1002 |
|
} |
| 1003 |
|
|
| 1004 |
164 |
if (label.indexOf("Consensus") == 0) |
| 1005 |
|
{ |
| 1006 |
10 |
buffer.append("\n"); |
| 1007 |
|
|
| 1008 |
15 |
for (int i = 0; i < annotations.length; i++) |
| 1009 |
|
{ |
| 1010 |
5 |
if (annotations[i] != null) |
| 1011 |
|
{ |
| 1012 |
5 |
buffer.append(annotations[i].description); |
| 1013 |
|
} |
| 1014 |
|
|
| 1015 |
5 |
buffer.append(", "); |
| 1016 |
|
} |
| 1017 |
|
} |
| 1018 |
|
|
| 1019 |
164 |
return buffer.toString(); |
| 1020 |
|
} |
| 1021 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1022 |
2 |
public void setThreshold(GraphLine line)... |
| 1023 |
|
{ |
| 1024 |
2 |
threshold = line; |
| 1025 |
|
} |
| 1026 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1027 |
510 |
public GraphLine getThreshold()... |
| 1028 |
|
{ |
| 1029 |
510 |
return threshold; |
| 1030 |
|
} |
| 1031 |
|
|
| 1032 |
|
|
| 1033 |
|
|
| 1034 |
|
|
| 1035 |
|
|
| 1036 |
|
|
| 1037 |
|
@param |
| 1038 |
|
@param |
| 1039 |
|
@param |
| 1040 |
|
|
| |
|
| 91.3% |
Uncovered Elements: 2 (23) |
Complexity: 6 |
Complexity Density: 0.46 |
|
| 1041 |
2380 |
public void createSequenceMapping(SequenceI seqRef, int startRes,... |
| 1042 |
|
boolean alreadyMapped) |
| 1043 |
|
{ |
| 1044 |
|
|
| 1045 |
2380 |
if (seqRef == null) |
| 1046 |
|
{ |
| 1047 |
0 |
return; |
| 1048 |
|
} |
| 1049 |
2380 |
sequenceRef = seqRef; |
| 1050 |
2380 |
if (annotations == null) |
| 1051 |
|
{ |
| 1052 |
103 |
return; |
| 1053 |
|
} |
| 1054 |
2277 |
sequenceMapping = new HashMap<>(); |
| 1055 |
|
|
| 1056 |
2277 |
int seqPos; |
| 1057 |
|
|
| 1058 |
378601 |
for (int i = 0; i < annotations.length; i++) |
| 1059 |
|
{ |
| 1060 |
376324 |
if (annotations[i] != null) |
| 1061 |
|
{ |
| 1062 |
305757 |
if (alreadyMapped) |
| 1063 |
|
{ |
| 1064 |
216701 |
seqPos = seqRef.findPosition(i); |
| 1065 |
|
} |
| 1066 |
|
else |
| 1067 |
|
{ |
| 1068 |
89056 |
seqPos = i + startRes; |
| 1069 |
|
} |
| 1070 |
|
|
| 1071 |
305757 |
sequenceMapping.put(Integer.valueOf(seqPos), annotations[i]); |
| 1072 |
|
} |
| 1073 |
|
} |
| 1074 |
|
|
| 1075 |
|
} |
| 1076 |
|
|
| 1077 |
|
|
| 1078 |
|
|
| 1079 |
|
|
| 1080 |
|
|
| 1081 |
|
|
| 1082 |
|
|
| |
|
| 96.7% |
Uncovered Elements: 1 (30) |
Complexity: 7 |
Complexity Density: 0.39 |
|
| 1083 |
2618 |
public void adjustForAlignment()... |
| 1084 |
|
{ |
| 1085 |
2618 |
if (sequenceRef == null) |
| 1086 |
|
{ |
| 1087 |
248 |
return; |
| 1088 |
|
} |
| 1089 |
|
|
| 1090 |
2370 |
if (annotations == null) |
| 1091 |
|
{ |
| 1092 |
103 |
return; |
| 1093 |
|
} |
| 1094 |
|
|
| 1095 |
2267 |
int a = 0, aSize = sequenceRef.getLength(); |
| 1096 |
|
|
| 1097 |
2267 |
if (aSize == 0) |
| 1098 |
|
{ |
| 1099 |
|
|
| 1100 |
1 |
return; |
| 1101 |
|
} |
| 1102 |
|
|
| 1103 |
2266 |
int position; |
| 1104 |
2266 |
Annotation[] temp = new Annotation[aSize]; |
| 1105 |
2266 |
Integer index; |
| 1106 |
2266 |
if (sequenceMapping != null) |
| 1107 |
|
{ |
| 1108 |
309206 |
for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++) |
| 1109 |
|
{ |
| 1110 |
306940 |
index = Integer.valueOf(a); |
| 1111 |
306940 |
Annotation annot = sequenceMapping.get(index); |
| 1112 |
306940 |
if (annot != null) |
| 1113 |
|
{ |
| 1114 |
229806 |
position = sequenceRef.findIndex(a) - 1; |
| 1115 |
|
|
| 1116 |
229806 |
temp[position] = annot; |
| 1117 |
|
} |
| 1118 |
|
} |
| 1119 |
|
} |
| 1120 |
2266 |
annotations = temp; |
| 1121 |
|
} |
| 1122 |
|
|
| 1123 |
|
|
| 1124 |
|
|
| 1125 |
|
|
| 1126 |
|
|
| 1127 |
|
@return |
| 1128 |
|
|
| |
|
| 0% |
Uncovered Elements: 18 (18) |
Complexity: 4 |
Complexity Density: 0.33 |
|
| 1129 |
0 |
public int compactAnnotationArray()... |
| 1130 |
|
{ |
| 1131 |
0 |
int i = 0, iSize = annotations.length; |
| 1132 |
0 |
while (i < iSize) |
| 1133 |
|
{ |
| 1134 |
0 |
if (annotations[i] == null) |
| 1135 |
|
{ |
| 1136 |
0 |
if (i + 1 < iSize) |
| 1137 |
|
{ |
| 1138 |
0 |
System.arraycopy(annotations, i + 1, annotations, i, |
| 1139 |
|
iSize - i - 1); |
| 1140 |
|
} |
| 1141 |
0 |
iSize--; |
| 1142 |
|
} |
| 1143 |
|
else |
| 1144 |
|
{ |
| 1145 |
0 |
i++; |
| 1146 |
|
} |
| 1147 |
|
} |
| 1148 |
0 |
Annotation[] ann = annotations; |
| 1149 |
0 |
annotations = new Annotation[i]; |
| 1150 |
0 |
System.arraycopy(ann, 0, annotations, 0, i); |
| 1151 |
0 |
ann = null; |
| 1152 |
0 |
return iSize; |
| 1153 |
|
} |
| 1154 |
|
|
| 1155 |
|
|
| 1156 |
|
|
| 1157 |
|
|
| 1158 |
|
|
| 1159 |
|
|
| 1160 |
|
|
| 1161 |
|
|
| 1162 |
|
|
| 1163 |
|
@param |
| 1164 |
|
|
| |
|
| 63.6% |
Uncovered Elements: 8 (22) |
Complexity: 15 |
Complexity Density: 1.07 |
|
| 1165 |
3811 |
public void setSequenceRef(SequenceI sequenceI)... |
| 1166 |
|
{ |
| 1167 |
3811 |
if (sequenceI != null) |
| 1168 |
|
{ |
| 1169 |
3748 |
if (sequenceRef != null) |
| 1170 |
|
{ |
| 1171 |
2535 |
boolean rIsDs = sequenceRef.getDatasetSequence() == null, |
| 1172 |
|
tIsDs = sequenceI.getDatasetSequence() == null; |
| 1173 |
2535 |
if (sequenceRef != sequenceI |
| 1174 |
|
&& (rIsDs && !tIsDs |
| 1175 |
|
&& sequenceRef != sequenceI.getDatasetSequence()) |
| 1176 |
|
&& (!rIsDs && tIsDs |
| 1177 |
|
&& sequenceRef.getDatasetSequence() != sequenceI) |
| 1178 |
|
&& (!rIsDs && !tIsDs |
| 1179 |
|
&& sequenceRef.getDatasetSequence() != sequenceI |
| 1180 |
|
.getDatasetSequence()) |
| 1181 |
|
&& !sequenceRef.equals(sequenceI)) |
| 1182 |
|
{ |
| 1183 |
|
|
| 1184 |
|
|
| 1185 |
0 |
sequenceRef = null; |
| 1186 |
0 |
if (sequenceMapping != null) |
| 1187 |
|
{ |
| 1188 |
0 |
sequenceMapping = null; |
| 1189 |
|
|
| 1190 |
|
} |
| 1191 |
0 |
createSequenceMapping(sequenceI, 1, true); |
| 1192 |
0 |
adjustForAlignment(); |
| 1193 |
|
} |
| 1194 |
|
else |
| 1195 |
|
{ |
| 1196 |
|
|
| 1197 |
2535 |
sequenceRef = sequenceI; |
| 1198 |
|
} |
| 1199 |
|
} |
| 1200 |
|
else |
| 1201 |
|
{ |
| 1202 |
|
|
| 1203 |
1213 |
createSequenceMapping(sequenceI, 1, true); |
| 1204 |
1213 |
adjustForAlignment(); |
| 1205 |
|
} |
| 1206 |
|
} |
| 1207 |
|
else |
| 1208 |
|
{ |
| 1209 |
|
|
| 1210 |
63 |
sequenceMapping = null; |
| 1211 |
63 |
sequenceRef = null; |
| 1212 |
|
} |
| 1213 |
|
} |
| 1214 |
|
|
| 1215 |
|
|
| 1216 |
|
@return |
| 1217 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1218 |
156 |
public double getScore()... |
| 1219 |
|
{ |
| 1220 |
156 |
return score; |
| 1221 |
|
} |
| 1222 |
|
|
| 1223 |
|
|
| 1224 |
|
@param |
| 1225 |
|
|
| 1226 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 1227 |
34593 |
public void setScore(double score)... |
| 1228 |
|
{ |
| 1229 |
34593 |
hasScore = true; |
| 1230 |
34593 |
this.score = score; |
| 1231 |
|
} |
| 1232 |
|
|
| 1233 |
|
|
| 1234 |
|
|
| 1235 |
|
@return |
| 1236 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1237 |
1438 |
public boolean hasScore()... |
| 1238 |
|
{ |
| 1239 |
1438 |
return hasScore || !Double.isNaN(score); |
| 1240 |
|
} |
| 1241 |
|
|
| 1242 |
|
|
| 1243 |
|
|
| 1244 |
|
|
| 1245 |
|
@param |
| 1246 |
|
@param |
| 1247 |
|
@param |
| 1248 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 1249 |
33444 |
public AlignmentAnnotation(String label, String description, double score)... |
| 1250 |
|
{ |
| 1251 |
33444 |
this(label, description, null); |
| 1252 |
33444 |
setScore(score); |
| 1253 |
|
} |
| 1254 |
|
|
| 1255 |
|
|
| 1256 |
|
|
| 1257 |
|
|
| 1258 |
|
@param |
| 1259 |
|
@param |
| 1260 |
|
|
| |
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 1261 |
0 |
public AlignmentAnnotation(AlignmentAnnotation alignmentAnnotation,... |
| 1262 |
|
HiddenColumns hidden) |
| 1263 |
|
{ |
| 1264 |
0 |
this(alignmentAnnotation); |
| 1265 |
0 |
if (annotations == null) |
| 1266 |
|
{ |
| 1267 |
0 |
return; |
| 1268 |
|
} |
| 1269 |
0 |
makeVisibleAnnotation(hidden); |
| 1270 |
|
} |
| 1271 |
|
|
| |
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 6 |
Complexity Density: 0.75 |
|
| 1272 |
0 |
public void setPadGaps(boolean padgaps, char gapchar)... |
| 1273 |
|
{ |
| 1274 |
0 |
this.padGaps = padgaps; |
| 1275 |
0 |
if (padgaps) |
| 1276 |
|
{ |
| 1277 |
0 |
hasText = true; |
| 1278 |
0 |
for (int i = 0; i < annotations.length; i++) |
| 1279 |
|
{ |
| 1280 |
0 |
if (annotations[i] == null) |
| 1281 |
|
{ |
| 1282 |
0 |
annotations[i] = new Annotation(String.valueOf(gapchar), null, |
| 1283 |
|
' ', 0f, null); |
| 1284 |
|
} |
| 1285 |
0 |
else if (annotations[i].displayCharacter == null |
| 1286 |
|
|| annotations[i].displayCharacter.equals(" ")) |
| 1287 |
|
{ |
| 1288 |
0 |
annotations[i].displayCharacter = String.valueOf(gapchar); |
| 1289 |
|
} |
| 1290 |
|
} |
| 1291 |
|
} |
| 1292 |
|
} |
| 1293 |
|
|
| 1294 |
|
|
| 1295 |
|
|
| 1296 |
|
|
| 1297 |
|
@param |
| 1298 |
|
@return |
| 1299 |
|
|
| 1300 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
| 1301 |
10 |
public String getDescription(boolean seqname)... |
| 1302 |
|
{ |
| 1303 |
10 |
if (seqname && this.sequenceRef != null) |
| 1304 |
|
{ |
| 1305 |
3 |
int i = description.toLowerCase(Locale.ROOT).indexOf("<html>"); |
| 1306 |
3 |
if (i > -1) |
| 1307 |
|
{ |
| 1308 |
|
|
| 1309 |
1 |
return "<html>" + sequenceRef.getName() + " : " |
| 1310 |
|
+ description.substring(i + 6); |
| 1311 |
|
} |
| 1312 |
2 |
return sequenceRef.getName() + " : " + description; |
| 1313 |
|
} |
| 1314 |
7 |
return description; |
| 1315 |
|
} |
| 1316 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1317 |
236 |
public boolean isValidStruc()... |
| 1318 |
|
{ |
| 1319 |
236 |
return invalidrnastruc == -1; |
| 1320 |
|
} |
| 1321 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1322 |
1170922 |
public long getInvalidStrucPos()... |
| 1323 |
|
{ |
| 1324 |
1170921 |
return invalidrnastruc; |
| 1325 |
|
} |
| 1326 |
|
|
| 1327 |
|
|
| 1328 |
|
|
| 1329 |
|
|
| 1330 |
|
protected String calcId = ""; |
| 1331 |
|
|
| 1332 |
|
|
| 1333 |
|
|
| 1334 |
|
|
| 1335 |
|
protected Map<String, String> properties = new HashMap<>(); |
| 1336 |
|
|
| 1337 |
|
|
| 1338 |
|
|
| 1339 |
|
|
| 1340 |
|
|
| 1341 |
|
public java.awt.Color _linecolour; |
| 1342 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1343 |
23517 |
public String getCalcId()... |
| 1344 |
|
{ |
| 1345 |
23517 |
return calcId; |
| 1346 |
|
} |
| 1347 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1348 |
2080 |
public void setCalcId(String calcId)... |
| 1349 |
|
{ |
| 1350 |
2080 |
this.calcId = calcId; |
| 1351 |
|
} |
| 1352 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1353 |
15517 |
public boolean isRNA()... |
| 1354 |
|
{ |
| 1355 |
15517 |
return isrna; |
| 1356 |
|
} |
| 1357 |
|
|
| 1358 |
|
|
| 1359 |
|
|
| 1360 |
|
|
| 1361 |
|
|
| 1362 |
|
@param |
| 1363 |
|
@param |
| 1364 |
|
|
| 1365 |
|
|
| |
|
| 80% |
Uncovered Elements: 5 (25) |
Complexity: 8 |
Complexity Density: 0.62 |
|
| 1366 |
244 |
public void liftOver(SequenceI sq, Mapping sp2sq)... |
| 1367 |
|
{ |
| 1368 |
244 |
if (sp2sq.getMappedWidth() != sp2sq.getWidth()) |
| 1369 |
|
{ |
| 1370 |
|
|
| 1371 |
|
|
| 1372 |
0 |
throw new Error( |
| 1373 |
|
"liftOver currently not implemented for transfer of annotation between different types of seqeunce"); |
| 1374 |
|
} |
| 1375 |
244 |
boolean mapIsTo = (sp2sq != null) |
| 1376 |
|
? (sp2sq.getTo() == sq |
| 1377 |
|
|| sp2sq.getTo() == sq.getDatasetSequence()) |
| 1378 |
|
: false; |
| 1379 |
|
|
| 1380 |
|
|
| 1381 |
244 |
Map<Integer, Annotation> mapForsq = new HashMap<>(); |
| 1382 |
244 |
if (sequenceMapping != null) |
| 1383 |
|
{ |
| 1384 |
244 |
if (sp2sq != null) |
| 1385 |
|
{ |
| 1386 |
244 |
for (Entry<Integer, Annotation> ie : sequenceMapping.entrySet()) |
| 1387 |
|
{ |
| 1388 |
21918 |
Integer mpos = Integer |
| 1389 |
21918 |
.valueOf(mapIsTo ? sp2sq.getMappedPosition(ie.getKey()) |
| 1390 |
|
: sp2sq.getPosition(ie.getKey())); |
| 1391 |
21918 |
if (mpos >= sq.getStart() && mpos <= sq.getEnd()) |
| 1392 |
|
{ |
| 1393 |
21910 |
mapForsq.put(mpos, ie.getValue()); |
| 1394 |
|
} |
| 1395 |
|
} |
| 1396 |
244 |
sequenceMapping = mapForsq; |
| 1397 |
244 |
sequenceRef = sq; |
| 1398 |
244 |
adjustForAlignment(); |
| 1399 |
|
} |
| 1400 |
|
else |
| 1401 |
|
{ |
| 1402 |
|
|
| 1403 |
|
} |
| 1404 |
|
} |
| 1405 |
|
} |
| 1406 |
|
|
| 1407 |
|
|
| 1408 |
|
|
| 1409 |
|
|
| 1410 |
|
|
| 1411 |
|
|
| 1412 |
|
|
| 1413 |
|
@param |
| 1414 |
|
|
| 1415 |
|
|
| 1416 |
|
@param |
| 1417 |
|
|
| 1418 |
|
@param |
| 1419 |
|
|
| 1420 |
|
@param |
| 1421 |
|
|
| 1422 |
|
@param |
| 1423 |
|
|
| 1424 |
|
|
| 1425 |
|
|
| 1426 |
|
|
| 1427 |
|
|
| |
|
| 0% |
Uncovered Elements: 38 (38) |
Complexity: 11 |
Complexity Density: 0.5 |
|
| 1428 |
0 |
public void remap(SequenceI newref, HashMap<Integer, int[]> mapping,... |
| 1429 |
|
int from, int to, int idxoffset) |
| 1430 |
|
{ |
| 1431 |
0 |
if (mapping != null) |
| 1432 |
|
{ |
| 1433 |
0 |
Map<Integer, Annotation> old = sequenceMapping; |
| 1434 |
0 |
Map<Integer, Annotation> remap = new HashMap<>(); |
| 1435 |
0 |
int index = -1; |
| 1436 |
0 |
for (int mp[] : mapping.values()) |
| 1437 |
|
{ |
| 1438 |
0 |
if (index++ < 0) |
| 1439 |
|
{ |
| 1440 |
0 |
continue; |
| 1441 |
|
} |
| 1442 |
0 |
Annotation ann = null; |
| 1443 |
0 |
if (from == -1) |
| 1444 |
|
{ |
| 1445 |
0 |
ann = sequenceMapping.get(Integer.valueOf(idxoffset + index)); |
| 1446 |
|
} |
| 1447 |
|
else |
| 1448 |
|
{ |
| 1449 |
0 |
if (mp != null && mp.length > from) |
| 1450 |
|
{ |
| 1451 |
0 |
ann = sequenceMapping.get(Integer.valueOf(mp[from])); |
| 1452 |
|
} |
| 1453 |
|
} |
| 1454 |
0 |
if (ann != null) |
| 1455 |
|
{ |
| 1456 |
0 |
if (to == -1) |
| 1457 |
|
{ |
| 1458 |
0 |
remap.put(Integer.valueOf(idxoffset + index), ann); |
| 1459 |
|
} |
| 1460 |
|
else |
| 1461 |
|
{ |
| 1462 |
0 |
if (to > -1 && to < mp.length) |
| 1463 |
|
{ |
| 1464 |
0 |
remap.put(Integer.valueOf(mp[to]), ann); |
| 1465 |
|
} |
| 1466 |
|
} |
| 1467 |
|
} |
| 1468 |
|
} |
| 1469 |
0 |
sequenceMapping = remap; |
| 1470 |
0 |
old.clear(); |
| 1471 |
0 |
if (newref != null) |
| 1472 |
|
{ |
| 1473 |
0 |
sequenceRef = newref; |
| 1474 |
|
} |
| 1475 |
0 |
adjustForAlignment(); |
| 1476 |
|
} |
| 1477 |
|
} |
| 1478 |
|
|
| |
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 1479 |
959947 |
public String getProperty(String property)... |
| 1480 |
|
{ |
| 1481 |
959966 |
if (properties == null) |
| 1482 |
|
{ |
| 1483 |
0 |
return null; |
| 1484 |
|
} |
| 1485 |
959981 |
return properties.get(property); |
| 1486 |
|
} |
| 1487 |
|
|
| |
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 1488 |
2254 |
public void setProperty(String property, String value)... |
| 1489 |
|
{ |
| 1490 |
2254 |
if (properties == null) |
| 1491 |
|
{ |
| 1492 |
0 |
properties = new HashMap<>(); |
| 1493 |
|
} |
| 1494 |
2254 |
properties.put(property, value); |
| 1495 |
|
} |
| 1496 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1497 |
745 |
public boolean hasProperties()... |
| 1498 |
|
{ |
| 1499 |
745 |
return properties != null && properties.size() > 0; |
| 1500 |
|
} |
| 1501 |
|
|
| |
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 1502 |
301 |
public Collection<String> getProperties()... |
| 1503 |
|
{ |
| 1504 |
301 |
if (properties == null) |
| 1505 |
|
{ |
| 1506 |
0 |
return Collections.emptyList(); |
| 1507 |
|
} |
| 1508 |
301 |
return properties.keySet(); |
| 1509 |
|
} |
| 1510 |
|
|
| 1511 |
|
|
| 1512 |
|
|
| 1513 |
|
|
| 1514 |
|
|
| 1515 |
|
@param |
| 1516 |
|
@return |
| 1517 |
|
|
| |
|
| 66.7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
| 1518 |
336458 |
public Annotation getAnnotationForPosition(int position)... |
| 1519 |
|
{ |
| 1520 |
336463 |
return sequenceMapping == null ? null : sequenceMapping.get(position); |
| 1521 |
|
|
| 1522 |
|
} |
| 1523 |
|
|
| 1524 |
|
|
| 1525 |
|
|
| 1526 |
|
|
| 1527 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1528 |
39957 |
protected final void setAnnotationId()... |
| 1529 |
|
{ |
| 1530 |
39957 |
this.annotationId = ANNOTATION_ID_PREFIX + Long.toString(nextId()); |
| 1531 |
|
} |
| 1532 |
|
|
| 1533 |
|
|
| 1534 |
|
|
| 1535 |
|
|
| 1536 |
|
|
| 1537 |
|
@param |
| 1538 |
|
@return |
| 1539 |
|
|
| |
|
| 91.3% |
Uncovered Elements: 4 (46) |
Complexity: 12 |
Complexity Density: 0.46 |
|
| 1540 |
43 |
public String getDefaultRnaHelixSymbol(int column)... |
| 1541 |
|
{ |
| 1542 |
43 |
String result = "("; |
| 1543 |
43 |
if (annotations == null) |
| 1544 |
|
{ |
| 1545 |
1 |
return result; |
| 1546 |
|
} |
| 1547 |
|
|
| 1548 |
|
|
| 1549 |
|
|
| 1550 |
|
|
| 1551 |
|
|
| 1552 |
|
|
| 1553 |
150 |
for (int col = column - 1; col >= 0; col--) |
| 1554 |
|
{ |
| 1555 |
142 |
Annotation annotation = annotations[col]; |
| 1556 |
142 |
if (annotation == null) |
| 1557 |
|
{ |
| 1558 |
66 |
continue; |
| 1559 |
|
} |
| 1560 |
76 |
String displayed = annotation.displayCharacter; |
| 1561 |
76 |
if (displayed == null || displayed.length() != 1) |
| 1562 |
|
{ |
| 1563 |
0 |
continue; |
| 1564 |
|
} |
| 1565 |
76 |
char symbol = displayed.charAt(0); |
| 1566 |
76 |
if (!Rna.isOpeningParenthesis(symbol)) |
| 1567 |
|
{ |
| 1568 |
24 |
continue; |
| 1569 |
|
} |
| 1570 |
|
|
| 1571 |
|
|
| 1572 |
|
|
| 1573 |
|
|
| 1574 |
|
|
| 1575 |
|
|
| 1576 |
|
|
| 1577 |
52 |
String closer = String |
| 1578 |
|
.valueOf(Rna.getMatchingClosingParenthesis(symbol)); |
| 1579 |
52 |
String opener = String.valueOf(symbol); |
| 1580 |
52 |
int count = 0; |
| 1581 |
256 |
for (int j = col + 1; j < column; j++) |
| 1582 |
|
{ |
| 1583 |
204 |
if (annotations[j] != null) |
| 1584 |
|
{ |
| 1585 |
90 |
String s = annotations[j].displayCharacter; |
| 1586 |
90 |
if (closer.equals(s)) |
| 1587 |
|
{ |
| 1588 |
18 |
count++; |
| 1589 |
|
} |
| 1590 |
72 |
else if (opener.equals(s)) |
| 1591 |
|
{ |
| 1592 |
0 |
count--; |
| 1593 |
|
} |
| 1594 |
|
} |
| 1595 |
|
} |
| 1596 |
52 |
if (count < 1) |
| 1597 |
|
{ |
| 1598 |
34 |
return closer; |
| 1599 |
|
} |
| 1600 |
|
} |
| 1601 |
8 |
return result; |
| 1602 |
|
} |
| 1603 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1604 |
39957 |
protected static synchronized long nextId()... |
| 1605 |
|
{ |
| 1606 |
39957 |
return counter++; |
| 1607 |
|
} |
| 1608 |
|
|
| 1609 |
|
|
| 1610 |
|
|
| 1611 |
|
@return |
| 1612 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1613 |
5 |
public boolean isQuantitative()... |
| 1614 |
|
{ |
| 1615 |
5 |
return graphMin < graphMax; |
| 1616 |
|
} |
| 1617 |
|
|
| 1618 |
|
|
| 1619 |
|
@return |
| 1620 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1621 |
284519 |
public boolean isForDisplay()... |
| 1622 |
|
{ |
| 1623 |
284524 |
return hasData && visible; |
| 1624 |
|
} |
| 1625 |
|
|
| 1626 |
|
|
| 1627 |
|
|
| 1628 |
|
|
| 1629 |
|
|
| 1630 |
|
@param |
| 1631 |
|
|
| 1632 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 1633 |
2 |
public void makeVisibleAnnotation(HiddenColumns hiddenColumns)... |
| 1634 |
|
{ |
| 1635 |
2 |
if (annotations != null) |
| 1636 |
|
{ |
| 1637 |
1 |
makeVisibleAnnotation(0, annotations.length, hiddenColumns); |
| 1638 |
|
} |
| 1639 |
|
} |
| 1640 |
|
|
| 1641 |
|
|
| 1642 |
|
|
| 1643 |
|
|
| 1644 |
|
|
| 1645 |
|
@param |
| 1646 |
|
|
| 1647 |
|
@param |
| 1648 |
|
|
| 1649 |
|
@param |
| 1650 |
|
|
| 1651 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 1652 |
10 |
public void makeVisibleAnnotation(int start, int end,... |
| 1653 |
|
HiddenColumns hiddenColumns) |
| 1654 |
|
{ |
| 1655 |
10 |
if (annotations != null) |
| 1656 |
|
{ |
| 1657 |
9 |
if (hiddenColumns.hasHiddenColumns()) |
| 1658 |
|
{ |
| 1659 |
3 |
removeHiddenAnnotation(start, end, hiddenColumns); |
| 1660 |
|
} |
| 1661 |
|
else |
| 1662 |
|
{ |
| 1663 |
6 |
restrict(start, end); |
| 1664 |
|
} |
| 1665 |
|
} |
| 1666 |
|
} |
| 1667 |
|
|
| 1668 |
|
|
| 1669 |
|
|
| 1670 |
|
|
| 1671 |
|
@param |
| 1672 |
|
|
| 1673 |
|
@param |
| 1674 |
|
|
| 1675 |
|
@param |
| 1676 |
|
|
| 1677 |
|
|
| |
|
| 96.9% |
Uncovered Elements: 1 (32) |
Complexity: 5 |
Complexity Density: 0.21 |
|
| 1678 |
3 |
private void removeHiddenAnnotation(int start, int end,... |
| 1679 |
|
HiddenColumns hiddenColumns) |
| 1680 |
|
{ |
| 1681 |
|
|
| 1682 |
3 |
ArrayList<Annotation[]> annels = new ArrayList<>(); |
| 1683 |
3 |
Annotation[] els = null; |
| 1684 |
|
|
| 1685 |
3 |
int w = 0; |
| 1686 |
|
|
| 1687 |
3 |
Iterator<int[]> blocks = hiddenColumns.getVisContigsIterator(start, |
| 1688 |
|
end + 1, false); |
| 1689 |
|
|
| 1690 |
3 |
int copylength; |
| 1691 |
3 |
int annotationLength; |
| 1692 |
9 |
while (blocks.hasNext()) |
| 1693 |
|
{ |
| 1694 |
6 |
int[] block = blocks.next(); |
| 1695 |
6 |
annotationLength = block[1] - block[0] + 1; |
| 1696 |
|
|
| 1697 |
6 |
if (blocks.hasNext()) |
| 1698 |
|
{ |
| 1699 |
|
|
| 1700 |
3 |
copylength = annotationLength; |
| 1701 |
|
} |
| 1702 |
|
else |
| 1703 |
|
{ |
| 1704 |
3 |
if (annotationLength + block[0] <= annotations.length) |
| 1705 |
|
{ |
| 1706 |
|
|
| 1707 |
2 |
copylength = annotationLength; |
| 1708 |
|
} |
| 1709 |
|
else |
| 1710 |
|
{ |
| 1711 |
|
|
| 1712 |
1 |
copylength = annotations.length - block[0]; |
| 1713 |
|
} |
| 1714 |
|
} |
| 1715 |
|
|
| 1716 |
6 |
els = new Annotation[annotationLength]; |
| 1717 |
6 |
annels.add(els); |
| 1718 |
6 |
System.arraycopy(annotations, block[0], els, 0, copylength); |
| 1719 |
6 |
w += annotationLength; |
| 1720 |
|
} |
| 1721 |
|
|
| 1722 |
3 |
if (w != 0) |
| 1723 |
|
{ |
| 1724 |
3 |
annotations = new Annotation[w]; |
| 1725 |
|
|
| 1726 |
3 |
w = 0; |
| 1727 |
3 |
for (Annotation[] chnk : annels) |
| 1728 |
|
{ |
| 1729 |
6 |
System.arraycopy(chnk, 0, annotations, w, chnk.length); |
| 1730 |
6 |
w += chnk.length; |
| 1731 |
|
} |
| 1732 |
|
} |
| 1733 |
|
} |
| 1734 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 10 |
Complexity Density: 2 |
|
| 1735 |
204 |
public static Iterable<AlignmentAnnotation> findAnnotations(... |
| 1736 |
|
Iterable<AlignmentAnnotation> list, SequenceI seq, String calcId, |
| 1737 |
|
String label) |
| 1738 |
|
{ |
| 1739 |
|
|
| 1740 |
204 |
ArrayList<AlignmentAnnotation> aa = new ArrayList<>(); |
| 1741 |
204 |
for (AlignmentAnnotation ann : list) |
| 1742 |
|
{ |
| 1743 |
1330 |
if ((calcId == null || (ann.getCalcId() != null |
| 1744 |
|
&& ann.getCalcId().equals(calcId))) |
| 1745 |
|
&& (seq == null || (ann.sequenceRef != null |
| 1746 |
|
&& ann.sequenceRef == seq)) |
| 1747 |
|
&& (label == null |
| 1748 |
|
|| (ann.label != null && ann.label.equals(label)))) |
| 1749 |
|
{ |
| 1750 |
186 |
aa.add(ann); |
| 1751 |
|
} |
| 1752 |
|
} |
| 1753 |
204 |
return aa; |
| 1754 |
|
} |
| 1755 |
|
|
| 1756 |
|
|
| 1757 |
|
|
| 1758 |
|
|
| 1759 |
|
@param |
| 1760 |
|
|
| 1761 |
|
@param |
| 1762 |
|
@return |
| 1763 |
|
|
| |
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 4 |
Complexity Density: 0.8 |
|
| 1764 |
0 |
public static boolean hasAnnotation(List<AlignmentAnnotation> list,... |
| 1765 |
|
String calcId) |
| 1766 |
|
{ |
| 1767 |
|
|
| 1768 |
0 |
if (calcId != null && !"".equals(calcId)) |
| 1769 |
|
{ |
| 1770 |
0 |
for (AlignmentAnnotation a : list) |
| 1771 |
|
{ |
| 1772 |
0 |
if (a.getCalcId() == calcId) |
| 1773 |
|
{ |
| 1774 |
0 |
return true; |
| 1775 |
|
} |
| 1776 |
|
} |
| 1777 |
|
} |
| 1778 |
0 |
return false; |
| 1779 |
|
} |
| 1780 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 6 |
Complexity Density: 0.86 |
|
| 1781 |
523 |
public static Iterable<AlignmentAnnotation> findAnnotation(... |
| 1782 |
|
List<AlignmentAnnotation> list, String calcId) |
| 1783 |
|
{ |
| 1784 |
|
|
| 1785 |
523 |
List<AlignmentAnnotation> aa = new ArrayList<>(); |
| 1786 |
523 |
if (calcId == null) |
| 1787 |
|
{ |
| 1788 |
1 |
return aa; |
| 1789 |
|
} |
| 1790 |
522 |
for (AlignmentAnnotation a : list) |
| 1791 |
|
{ |
| 1792 |
|
|
| 1793 |
3023 |
if (a.getCalcId() == calcId || (a.getCalcId() != null |
| 1794 |
|
&& calcId != null && a.getCalcId().equals(calcId))) |
| 1795 |
|
{ |
| 1796 |
554 |
aa.add(a); |
| 1797 |
|
} |
| 1798 |
|
} |
| 1799 |
522 |
return aa; |
| 1800 |
|
} |
| 1801 |
|
|
| 1802 |
|
|
| 1803 |
|
|
| 1804 |
|
|
| 1805 |
|
|
| 1806 |
|
@return |
| 1807 |
|
|
| 1808 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1809 |
289 |
public boolean isShowGroupsForContactMatrix()... |
| 1810 |
|
{ |
| 1811 |
289 |
return getProperty(AlignmentAnnotation.CONTACT_MAP_NOGROUPS) == null |
| 1812 |
|
|| "".equals( |
| 1813 |
|
getProperty(AlignmentAnnotation.CONTACT_MAP_NOGROUPS)); |
| 1814 |
|
} |
| 1815 |
|
|
| 1816 |
|
|
| 1817 |
|
|
| 1818 |
|
|
| 1819 |
|
@see |
| 1820 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
| 1821 |
2 |
public void setShowGroupsForContactMatrix(boolean showGroups)... |
| 1822 |
|
{ |
| 1823 |
2 |
setProperty(AlignmentAnnotation.CONTACT_MAP_NOGROUPS, |
| 1824 |
2 |
showGroups ? "" : "nogroups"); |
| 1825 |
|
} |
| 1826 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1827 |
864875 |
public long getNoOfSequencesIncluded()... |
| 1828 |
|
{ |
| 1829 |
864904 |
return noOfSequencesIncluded; |
| 1830 |
|
} |
| 1831 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1832 |
8986 |
public void setNoOfSequencesIncluded(long noOfSequencesIncluded)... |
| 1833 |
|
{ |
| 1834 |
8986 |
this.noOfSequencesIncluded = noOfSequencesIncluded; |
| 1835 |
|
} |
| 1836 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1837 |
897 |
public long getNoOfTracksIncluded()... |
| 1838 |
|
{ |
| 1839 |
|
|
| 1840 |
897 |
return noOfTracksIncluded; |
| 1841 |
|
} |
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1842 |
3313 |
public void setNoOfTracksIncluded(long noOfTracks)... |
| 1843 |
|
{ |
| 1844 |
3313 |
this.noOfTracksIncluded = noOfTracks; |
| 1845 |
|
} |
| 1846 |
|
|
| 1847 |
|
|
| 1848 |
|
|
| 1849 |
|
|
| 1850 |
|
|
| 1851 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1852 |
8367 |
public boolean labelAndCalcIdMatches(String label, String calcId)... |
| 1853 |
|
{ |
| 1854 |
8367 |
return this.label.equalsIgnoreCase(label) |
| 1855 |
|
&& ((this.getCalcId() == null && calcId == null) |
| 1856 |
|
|| (this.getCalcId() != null && calcId != null |
| 1857 |
|
&& this.getCalcId().equals(calcId))); |
| 1858 |
|
} |
| 1859 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1860 |
98 |
public void setAnnotationDetailsProperty(String annotDetails) {... |
| 1861 |
98 |
this.setProperty(ANNOTATION_DETAILS, annotDetails); |
| 1862 |
|
} |
| 1863 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 1864 |
23 |
public String getAnnotationDetailsProperty() {... |
| 1865 |
23 |
if(hasAnnotationDetailsProperty()) |
| 1866 |
|
{ |
| 1867 |
18 |
return this.getProperty(ANNOTATION_DETAILS); |
| 1868 |
|
} |
| 1869 |
|
|
| 1870 |
5 |
return null; |
| 1871 |
|
} |
| 1872 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
| 1873 |
137901 |
public boolean hasAnnotationDetailsProperty() {... |
| 1874 |
137888 |
if(this.getProperty(ANNOTATION_DETAILS) != null |
| 1875 |
|
&& this.getProperty(ANNOTATION_DETAILS).length() > 0) |
| 1876 |
|
{ |
| 1877 |
137854 |
return true; |
| 1878 |
|
} |
| 1879 |
|
|
| 1880 |
35 |
return false; |
| 1881 |
|
} |
| 1882 |
|
} |