setData(KEY_SELECTOR_5_MATCH_LENGTH,new Integer(PROPERTY_SELECTOR_5_MATCH_LENGTH));
setData(KEY_SELECTOR_3_MATCH_LENGTH,new Integer(PROPERTY_SELECTOR_3_MATCH_LENGTH));
}
public void doAnalysis(Probe p, TagAllocator pd, DefiniteSequenceDB<? extends Probe> probes) {
NucleotideSequence sel5;
NucleotideSequence sel3;
try {
sel5 = p.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
}
catch (ClusterException e) {
sel5 = null;
}
try {
sel3 = p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);
}
catch (ClusterException e) {
sel3 = null;
}
if (tests[0].perform() && sel5 != null) {
//Selector 5' end ligates to 5' end of self
if (isMatch(p, sel5, false, FIVE_PRIME_END)) {
ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(SELECTOR_SELF_LIGATION_5.getDescription(),
SELECTOR_SELF_LIGATION_5, Message.WARNING));
}
}
if (tests[1].perform() && sel3 != null) {
//Selector 3' end ligates to 3' end of self
if (isMatch(p, sel3, false, THREE_PRIME_END)) {
ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(SELECTOR_SELF_LIGATION_3.getDescription(),
SELECTOR_SELF_LIGATION_3, Message.WARNING));
}
}
if (tests[2].perform()) {
//Selector 5' end ligates to 5' end of target
Target t = p.getTarget();
if (t != null) {
if (t instanceof SelectorTarget) {
SelectorTarget it = (SelectorTarget) t;
if (Integer.parseInt(it.getVariant().getName()) > 0) {
if (isMatch(it, sel5, true, FIVE_PRIME_END)) {
ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(SELECTOR_TARGET_LIGATION_5.
getDescription(),
SELECTOR_TARGET_LIGATION_5,
Message.WARNING));
}
}
}
else {
ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
"Could not perform ligation to target test: Incompatible target", //$NON-NLS-1$
SELECTOR_TARGET_LIGATION_5, Message.ALERT));
}
}
else {
ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
"Could not perform ligation to target test: No target", //$NON-NLS-1$
SELECTOR_TARGET_LIGATION_5, Message.ALERT));
}
}
for (Iterator<? extends Probe> pi = probes.iterator(); pi.hasNext(); ) {
Probe other = pi.next();
NucleotideSequence other5;
NucleotideSequence other3;
try {
other5 = other.getTSSPair().getSequence(TSSPair.KEY_FIVE_PRIME);
}
catch (ClusterException e) {
other5 = null;