{
if (targetChainId.trim().length() == 0)
{
- targetChainId = " ";
+ targetChainId = StructureMapping.NO_CHAIN;
}
else
{
*/
int max = -10;
AlignSeq maxAlignseq = null;
- String maxChainId = " ";
+ String maxChainId = StructureMapping.NO_CHAIN; // space
PDBChain maxChain = null;
boolean first = true;
for (PDBChain chain : pdb.getChains())
.getString("status.obtaining_mapping_with_phyre2_template_alignment"));
String fastaFile = getPhyre2FastaFileFor(pdbFile);
StructureMapping phyre2ModelMapping = new Phyre2Client(pdb)
- .getStructureMapping(seq, pdbFile, fastaFile, " ");
+ .getStructureMapping(seq, pdbFile, fastaFile,
+ StructureMapping.NO_CHAIN);
seqToStrucMapping.add(phyre2ModelMapping);
maxChain.makeExactMapping(maxAlignseq, seq);
maxChain.transferRESNUMFeatures(seq, null);
if (listeners.elementAt(i) instanceof StructureListener)
{
sl = (StructureListener) listeners.elementAt(i);
- for (String pdbfile : sl.getPdbFile())
+ for (String pdbfile : sl.getStructureFiles())
{
pdbs.remove(pdbfile);
}
return;
}
+ SearchResultsI results = findAlignmentPositionsForStructurePositions(atoms);
+ for (Object li : listeners)
+ {
+ if (li instanceof SequenceListener)
+ {
+ ((SequenceListener) li).highlightSequence(results);
+ }
+ }
+ }
+
+ /**
+ * Constructs a SearchResults object holding regions (if any) in the Jalview
+ * alignment which have a mapping to the structure viewer positions in the
+ * supplied list
+ *
+ * @param atoms
+ * @return
+ */
+ public SearchResultsI findAlignmentPositionsForStructurePositions(
+ List<AtomSpec> atoms)
+ {
SearchResultsI results = new SearchResults();
for (AtomSpec atom : atoms)
{
&& sm.pdbchain.equals(atom.getChain()))
{
int indexpos = sm.getSeqPos(atom.getPdbResNum());
- if (lastipos != indexpos && lastseq != sm.sequence)
+ if (lastipos != indexpos || lastseq != sm.sequence)
{
results.addResult(sm.sequence, indexpos, indexpos);
lastipos = indexpos;
}
}
}
- for (Object li : listeners)
- {
- if (li instanceof SequenceListener)
- {
- ((SequenceListener) li).highlightSequence(results);
- }
- }
+ return results;
}
/**
return instances.values().iterator().next();
}
+ public void addStructureMapping(StructureMapping smapping)
+ {
+ mappings.add(smapping);
+ }
+
}