import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
+import jalview.datamodel.ContiguousI;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SearchResults;
import jalview.io.AppletFormatAdapter;
import jalview.io.DataSourceType;
import jalview.io.StructureFile;
+import jalview.structure.StructureImportSettings.TFType;
import jalview.util.MappingUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
IProgressIndicator progress)
{
return computeMapping(true, sequence, targetChains, pdbFile, protocol,
- progress);
+ progress, null, null);
}
/**
*/
synchronized public StructureFile setMapping(boolean forStructureView,
SequenceI[] sequenceArray, String[] targetChainIds,
- String pdbFile, DataSourceType sourceType)
+ String pdbFile, DataSourceType sourceType, TFType tft,
+ String paeFilename)
{
return computeMapping(forStructureView, sequenceArray, targetChainIds,
- pdbFile, sourceType, null);
+ pdbFile, sourceType, null, tft, paeFilename);
}
/**
synchronized public StructureFile computeMapping(boolean forStructureView,
SequenceI[] sequenceArray, String[] targetChainIds,
String pdbFile, DataSourceType sourceType,
- IProgressIndicator progress)
+ IProgressIndicator progress, TFType tft, String paeFilename)
{
long progressSessionId = System.currentTimeMillis() * 3;
// FIXME if sourceType is not null, we've lost data here
sourceType = AppletFormatAdapter.checkProtocol(pdbFile);
pdb = new JmolParser(false, pdbFile, sourceType);
+ if (paeFilename != null)
+ {
+ pdb.setPAEMatrix(paeFilename);
+ }
+ pdb.setTemperatureFactorType(tft);
pdb.addSettings(parseSecStr && processSecondaryStructure,
parseSecStr && addTempFacAnnot,
parseSecStr && secStructServices);
sl.highlightAtoms(atoms);
}
+ public void highlightStructureRegionsFor(StructureListener sl,
+ SequenceI[] seqs, int... columns)
+ {
+ List<SequenceI> to_highlight = new ArrayList<SequenceI>();
+ for (SequenceI seq : seqs)
+ {
+ if (sl.isListeningFor(seq))
+ {
+ to_highlight.add(seq);
+ }
+ }
+ if (to_highlight.size() == 0)
+ {
+ return;
+ }
+ List<AtomSpec> atoms = new ArrayList<>();
+ for (SequenceI seq : to_highlight)
+ {
+ int atomNo;
+ for (StructureMapping sm : mappings)
+ {
+ if (sm.sequence == seq || sm.sequence == seq.getDatasetSequence()
+ || (sm.sequence.getDatasetSequence() != null && sm.sequence
+ .getDatasetSequence() == seq.getDatasetSequence()))
+ {
+
+ for (int i = 0; i < columns.length; i += 2)
+ {
+ ContiguousI positions = seq.findPositions(columns[i] + 1,
+ columns[i + 1] + 1);
+ if (positions == null)
+ {
+ continue;
+ }
+ for (int index = positions.getBegin(); index <= positions
+ .getEnd(); index++)
+ {
+
+ atomNo = sm.getAtomNum(index);
+
+ if (atomNo > 0)
+ {
+ atoms.add(new AtomSpec(sm.pdbfile, sm.pdbchain,
+ sm.getPDBResNum(index), atomNo));
+ }
+ }
+ }
+ }
+ }
+ if (atoms.size() > 0)
+ {
+ sl.highlightAtoms(atoms);
+ }
+ }
+ }
+
/**
* true if a mouse over event from an external (ie Vamsas) source is being
* handled
return seqmappings;
}
+ /**
+ * quick and dirty route to just highlight all structure positions for a range
+ * of columns
+ *
+ * @param sequencesArray
+ * @param is
+ * start-end columns on sequencesArray
+ * @param source
+ * origin parent AlignmentPanel
+ */
+ public void highlightPositionsOnMany(SequenceI[] sequencesArray, int[] is,
+ Object source)
+ {
+ for (int i = 0; i < listeners.size(); i++)
+ {
+ Object listener = listeners.elementAt(i);
+ if (listener == source)
+ {
+ // TODO listener (e.g. SeqPanel) is never == source (AlignViewport)
+ // Temporary fudge with SequenceListener.getVamsasSource()
+ continue;
+ }
+ if (listener instanceof StructureListener)
+ {
+ highlightStructureRegionsFor((StructureListener) listener,
+ sequencesArray, is);
+ }
+ }
+ }
+
+ public Map<String, String> getPdbFileNameIdMap()
+ {
+ return pdbFileNameId;
+ }
+
+ public Map<String, String> getPdbIdFileNameMap()
+ {
+ return pdbIdFileName;
+ }
+
}