tssPairE.addContent(getMessageListElement(ProbeMakerPropertyUtils.getOwnMessages(tssPair)));
probeE.addContent(tssPairE);
//Create an ordered list of all subsequences
Element seqList = new Element(SUB_SEQUENCES,ns);
for (int s = 1;s<=pr.getSequenceCount();s++) {
Sequence seq = pr.getSequence(s);
Element seqE = null;
String seqID = seq.getID();
//Check the type of sequence based on its ID
//ID in tssIDs - TSS
if (tssIDs.contains(seqID)) {
seqE = new Element(TSS,ns);
seqE.setAttribute(ID,seqID,ns);
}
//ID starts with "Spacer" - spacer tag
else if (seqID.startsWith("Spacer")) { //$NON-NLS-1$
seqE = new Element(SPACER,ns);
seqE.setAttribute(ID,seqID,ns);
seqE.addContent(new Element(TYPE,ns).addContent(String.valueOf(((NucleotideSequence) seq).getType())));
seqE.addContent(new Element(SEQUENCE,ns).addContent(seq.seqString()));
}
//Otherwise - normal tag
else if (seq instanceof NucleotideSequence){
KeyValue kv = getLibraryTag(libraries,seqID);
if (kv == null) {
//Tag not in any library
seqE = getTagElement(TAG,(NucleotideSequence) seq);
}
else {
//Tag in lib, just print ID
seqE = new Element(TAG_ID,ns);
seqE.setAttribute(ID,seqID,ns);
}
}
else throw new UnsupportedOperationException("Unsupported subsequence " + seq.getID() + " of " + pr.getID() + ": " + seq.getClass()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
seqList.addContent(seqE);
}
probeE.addContent(seqList);
probeE.addContent(getMessageListElement(ProbeMakerPropertyUtils.getOwnMessages(pr)));
return probeE;