/**Check if this probe is templated by other probes or targets*/
public boolean checkTemplatingByOtherProbes(Probe p, DefiniteSequenceDB<? extends Probe> probes) {
boolean found = false;
//Iterate through all probes
for (Iterator<? extends Probe> pi = probes.iterator(); pi.hasNext(); ) {
Probe other = pi.next();
//Check for templating and add messages accordingly
if (other != p) {
//Does other probe template this probe
if (other.tagsAllocated()) {
//Tags allocated, test as circle
if (isLigationTemplate(other, p, true, false) != null) {
ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message("May be templated by " + //$NON-NLS-1$
other.getName(),
OTHER_PROBE_IS_TEMPLATE,
Message.ERROR));
found = true;
}
}
else {
//Tags not allocated, test arms only (connected in ligation point)
try {
if (isLigationTemplate(new SimpleNucleotideSequence(other.getTSSPair().
getSequence(TSSPair.KEY_THREE_PRIME).seqString() +
other.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME).seqString(),
"Arms of " + other.getName(), //$NON-NLS-1$
other.getType()), p, false, false) != null) {
ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message("May be templated by " + //$NON-NLS-1$
other.getName(),
OTHER_PROBE_IS_TEMPLATE,
Message.ERROR));
found = true;
}
}