* </ul>
* @return true if relationship found and sequence added.
*/
- boolean searchDataset(boolean fromDna, SequenceI fromSeq,
- DBRefEntry xrf, List<SequenceI> foundSeqs, AlignedCodonFrame mappings,
+ boolean searchDataset(boolean fromDna, SequenceI fromSeq, DBRefEntry xrf,
+ List<SequenceI> foundSeqs, AlignedCodonFrame mappings,
boolean direct)
{
boolean found = false;
// }
if (!cands.isEmpty())
{
- if (!foundSeqs.contains(nxt))
+ if (foundSeqs.contains(nxt))
{
- found = true;
- foundSeqs.add(nxt);
- if (mappings != null && !direct)
+ continue;
+ }
+ found = true;
+ foundSeqs.add(nxt);
+ if (mappings != null && !direct)
+ {
+ /*
+ * if the matched sequence has mapped dbrefs to
+ * protein product / cdna, add equivalent mappings to
+ * our source sequence
+ */
+ for (DBRefEntry candidate : cands)
{
- /*
- * if the matched sequence has mapped dbrefs to
- * protein product / cdna, add equivalent mappings to
- * our source sequence
- */
- for (DBRefEntry candidate : cands)
+ Mapping mapping = candidate.getMap();
+ if (mapping != null)
{
- Mapping mapping = candidate.getMap();
- if (mapping != null)
+ MapList map = mapping.getMap();
+ if (mapping.getTo() != null
+ && map.getFromRatio() != map.getToRatio())
{
- MapList map = mapping.getMap();
- if (mapping.getTo() != null
- && map.getFromRatio() != map.getToRatio())
+ /*
+ * add a mapping, as from dna to peptide sequence
+ */
+ if (map.getFromRatio() == 3)
{
- /*
- * add a mapping, as from dna to peptide sequence
- */
- if (map.getFromRatio() == 3)
- {
- mappings.addMap(nxt, fromSeq, map);
- }
- else
- {
- mappings.addMap(nxt, fromSeq, map.getInverse());
- }
+ mappings.addMap(nxt, fromSeq, map);
+ }
+ else
+ {
+ mappings.addMap(nxt, fromSeq, map.getInverse());
}
}
}