int transEnd = transStart + genLength;
// split out exon seg between last insert (or start of exon) and current insert
// [unless start of exon and the insert is actually at exact beginning of exon]
if (istart != genStart) {
MutableSeqSymmetry segSym = new SimpleMutableSeqSymmetry();
SeqSpan gSpan = new SimpleSeqSpan(genStart, istart, genomic); // start of insert is end of exon seg
SeqSpan tSpan = new SimpleSeqSpan(transStart, transEnd, mrna);
segSym.addSpan(gSpan);
segSym.addSpan(tSpan);
exonSym.addChild(segSym);
}
// now add exon seg for the current insert
transStart = transEnd;
transEnd += ilength;
SeqSpan insert_tspan = new SimpleSeqSpan(transStart, transEnd, mrna);
SeqSpan insert_gspan = new SimpleSeqSpan(istart, istart, genomic);
MutableSeqSymmetry isegSym = new SimpleMutableSeqSymmetry();
isegSym.addSpan(insert_tspan);
// experimenting with adding a zero-length placeholder for exon insert relative to genomic
isegSym.addSpan(insert_gspan);
exonSym.addChild(isegSym);
// set current genomic start point for next loop to location of current insert
genStart = istart;
transStart = transEnd;
}
// if last insert is not _exactly_ at end of exon, then need to add last exon seg
// after finished looping through inserts
if (genStart != egSpan.getEnd()) {
SeqSpan gSpan = new SimpleSeqSpan(genStart, egSpan.getEnd(), genomic);
SeqSpan tSpan = new SimpleSeqSpan(transStart, etSpan.getEnd(), mrna);
MutableSeqSymmetry endSym = new SimpleMutableSeqSymmetry();
endSym.addSpan(gSpan);
endSym.addSpan(tSpan);
exonSym.addChild(endSym);
}
}