boolean foundTIO = false;
boolean foundOIT = false;
/**This probe's tag*/
NucleotideSequence tag = thisProbe.getTagAt(tagpos);
String tagseq = tag.seqString();
//Check that tag sequence is longer than 0
if (tagseq.length() > 0) {
//Go through each tag position of this probe ...
/**Tag*/
if (checkSequence) {
//Search for the tag sequence in the other probe
occurrences = tsc1.getOccurrences(tagseq, otherSeq, tag.getType(),
otherProbe.getType(), true);
int blockStart = otherProbe.getStartOfSequence(thisProbe.getBlockNoOfTag(tagpos));
//Check each occurrence
for (int occ = 0; occ < occurrences.length; occ++) {
int pos = occurrences[occ].intValue() + 1;
boolean add;
switch (mode) {
case TagLibrary.USE_SAME_TAG:
case TagLibrary.USE_ANY_TAG:
//Add only if tag is present in other position. If index is the
//starting position of the block with the same block index as the tag, OK.
add = (pos != blockStart);
break;
case TagLibrary.USE_UNIQUE_IN_GROUP:
//Add if present in other position or if in same group
add = (pos != blockStart) || sameGroup;
break;
case TagLibrary.USE_PER_GROUP:
//Add if present in other position or target is in different group
add = (pos != blockStart) || !sameGroup;
break;
default:
//Always add
add = true;
}
//If we're supposed to add a warning, do so now
if (add) {
foundTIO = true;
ProbeMakerPropertyUtils.addMessage(thisProbe,new Message(tag.getID() +
" found in " + otherProbe.getName(), //$NON-NLS-1$
TAG_ELSEWHERE_EXTERNAL,
Message.ERROR));
}
}
}
//Check the complement too
/**Complement*/
if (checkComplement) {
occurrences = tsc1.getOccurrences(NucleotideSequenceHandler.getRevComp(
tag, otherProbe.getType()), otherSeq, tag.getType(),
otherProbe.getType(), true);
//Check each occurrence
for (int occ = 0; occ < occurrences.length; occ++) {
foundTIO = true;
ProbeMakerPropertyUtils.addMessage(thisProbe,new Message("Complement of " + //$NON-NLS-1$
tag.getID() +
" found in " + otherProbe.getName(), //$NON-NLS-1$
TAG_COMPLEMENT_EXTERNAL,
Message.ERROR));
}
}
}
/**Other probe's tag*/
//Check number of tag libraries in other probe
if (otherProbe.getTags().size() > tagpos) {
//Get the tag from the other probe
tag = otherProbe.getTagAt(tagpos);
tagseq = tag.seqString();
//Check that tag sequence is longer than 0
if (tagseq.length() > 0) {
/**Tag*/
if (checkSequence) {
//search for the tag sequence in this probe
occurrences = tsc1.getOccurrences(tagseq, thisSeq, tag.getType(),
otherProbe.getType(), true);
}
else {
occurrences = new Integer[0];
}
//Check each occurrence
for (int occ = 0; occ < occurrences.length; occ++) {
int pos = occurrences[occ].intValue() + 1;
int blockStart = thisProbe.getStartOfSequence(otherProbe.getBlockNoOfTag(
tagpos));
boolean add;
switch (mode) {
case TagLibrary.USE_SAME_TAG:
case TagLibrary.USE_ANY_TAG:
//Add only if present in other position
add = (pos != blockStart);
break;
case TagLibrary.USE_UNIQUE_IN_GROUP:
//Add if present in other position or if targets in same group
add = (pos != blockStart) || sameGroup;
break;
case TagLibrary.USE_PER_GROUP:
//Add if present in other position or target is in different group
add = (pos != blockStart) || !sameGroup;
break;
default:
//Always add
add = true;
}
//if we're supposed to add a warning, do so now
if (add) {
foundOIT = true;
ProbeMakerPropertyUtils.addMessage(thisProbe,new Message(tag.getID() +
" from " + //$NON-NLS-1$
otherProbe.getName() +
" found (position " + //$NON-NLS-1$
pos + ")", //$NON-NLS-1$
OTHER_TAG_PRESENT, Message.ERROR));
}
}
/**Complement*/
if (checkComplement) {
if (otherProbe.getTags().size() > tagpos) {
//Get the tag from the other probe
tag = otherProbe.getTagAt(tagpos);
tagseq = tag.seqString();
//Search for the tag sequence in this probe
occurrences = tsc1.getOccurrences(NucleotideSequenceHandler.
getRevComp(tag,
thisProbe.getType()), thisSeq, tag.getType(),
otherProbe.getType(), true);
}
else {
occurrences = new Integer[0];
}
//Check each occurrence
for (int occ = 0; occ < occurrences.length; occ++) {
foundOIT = true;
ProbeMakerPropertyUtils.addMessage(thisProbe,new Message("Complement of " + //$NON-NLS-1$
tag.getID() +
" from " + //$NON-NLS-1$
otherProbe.getName() +
" found (position " + //$NON-NLS-1$
occurrences[occ] + ")", //$NON-NLS-1$
OTHER_TAG_COMPLEMENT_PRESENT,