private void init(String header, TCharArrayList sequence, TCharArrayList structure) {
this.header = header;
if (this.originalSequence == null) {
this.originalSequence = new TCharArrayList();
this.originalStructure = new TCharArrayList();
} else {
this.originalSequence.resetQuick();
this.originalStructure.resetQuick();
}
for (int i = 0; i < sequence.size(); i++) {
this.originalSequence.add(sequence.getQuick(i));
this.originalStructure.add(structure.getQuick(i));
}
this.innerStructureMap.clear();
// init only if needed
if (this.backbone != null) {
this.backbone.resetQuick();
this.stemLoopSequence.resetQuick();
this.danglingLeft.resetQuick();
this.danglingRight.resetQuick();
} else {
this.backbone = new TCharArrayList();
this.stemLoopSequence = new TCharArrayList();
this.danglingLeft = new TCharArrayList();
this.danglingRight = new TCharArrayList();
}
// get the root information
final int rootStart = structure.lastIndexOf('(') + 1;
final int rootEnd = structure.indexOf(rootStart, ')') - 1;