probeend + length;
String plong = p.subsequence(pb, pe);
//log.info("Checking hyb of " + sequencelong + " to " + plong);
NAHybridStructure s1 = complementStructCalc.calculateStructure(sequencelong,
plong,
t.getType(), p.getType());
//If hybridization is interfered with, add message and put tag in badtags
if (s1.getSecondString().length() > pa5.length()) {
ProbeMakerPropertyUtils.addMessage(p,new Message("Hybridization temp. of 5' arm may be incorrect. Other part of probe may hybridize to the target.", //$NON-NLS-1$
FIVE_PRIME_HYBRIDIZATION_INTERFERENCE,
Message.WARNING));
//Record as bad only if there are tags
if (p.getTags().size()>0)
ta.setCurrentTagBad(0);
}
}
}
}
if (tests[1].perform()) {
//Check threeprime part
if (t == null) {
ProbeMakerPropertyUtils.addMessage(p,new Message(
"Could not check 3' hybridization: No target found", //$NON-NLS-1$
THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
Message.ALERT));
}
else {
PropertyAcceptorNucleotideSequence pa3;
try {
pa3 = (PropertyAcceptorNucleotideSequence) p.getTSSPair().getSequence(TSSPair.KEY_THREE_PRIME);
}
catch (ClusterException e) {
pa3 = null;
}
SimpleSubSequenceTemplate threeTemplate = null;
try {
threeTemplate = (SimpleSubSequenceTemplate) t.getTemplateCluster().getSequence(ProbeMakerTarget.KEY_THREE_PRIME);
}
catch (ClusterException e) {
ProbeMakerPropertyUtils.addMessage(p,new Message(
"Could not check 3' hybridization: No 3' TSS template found", //$NON-NLS-1$
THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
Message.ALERT));
}
catch (ClassCastException cx) {
ProbeMakerPropertyUtils.addMessage(p,new Message(
"Could not check 3' hybridization: 3' TSS template is not a subsequence", //$NON-NLS-1$
THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
Message.ALERT));
}
if (pa3 == null) {
ProbeMakerPropertyUtils.addMessage(p,new Message(
"Could not check 3' hybridization: No 3' TSS found", //$NON-NLS-1$
THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
Message.ALERT));
}
else if (threeTemplate != null) {
int targetLength = t.length();
String tseq = t.seqString();
int[] positions = TemplateHandler.subTemplatePositions(threeTemplate,pa3.length(),t.getThreePrimeFixedEnd());
int begin = positions[0];
int end = positions[1];
String sequencelong = tseq.substring(begin - length - 1 < 0 ? 0 :
begin - length - 1,
end + length > targetLength ?
targetLength : end + length);
int block = p.getBlockNoOf3();
int probebegin = p.getStartOfSequence(block);
int probeend = p.getEndOfSequence(block);
String plong = p.subsequence(probebegin - length < 1 ? 1 :
probebegin - length,
probeend + length > p.length() ?
p.length() : end + length);
//log.info("Checking hyb of " + sequencelong + " to " + plong);
NAHybridStructure s1 = complementStructCalc.calculateStructure(sequencelong,
plong,
t.getType(), p.getType());
//Structure s2 = complementStructCalc.getStructure(sequence, pa3.getSequence(), t.getType(), pa3.getType(), true, false);
if (s1.getSecondString().length() > pa3.length()) {
// if (s1.getLength() > s2.getLength()) {
ProbeMakerPropertyUtils.addMessage(p,new Message("Hybridization temp. of 3' arm may be incorrect. Other part of probe may hybridize to the target.", //$NON-NLS-1$
THREE_PRIME_HYBRIDIZATION_INTERFERENCE,
Message.WARNING));
//Record as bad if adjacent sequence is a tag