public class PdbDocument extends DefaultMolecularStructureDocument implements SequenceListDocument, XMLSerializable.OldVersionCompatible
PluginDocument.ReferencedDocumentsAlwaysLoaded, PluginDocument.ReferencedDocumentsNotLoaded, PluginDocument.SizeRequiredToLoadIntoMemoryProviderXMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportTypeMAXIMUM_HTML_TEXT_LENGTHFILE_DATA_ATTRIBUTE_NAME, MAXIMUM_HTML_LENGTH, MODIFIED_DATE_FIELDROOT_ELEMENT_NAME| Constructor and Description |
|---|
PdbDocument() |
PdbDocument(String defaultName,
Date date,
String content)
Construct a PDB document from contents in PDB format.
|
PdbDocument(String defaultName,
Date date,
String content,
URN urn)
Construct an externally retrieved PDB document.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fromXML(org.jdom.Element root)
Restore the object from the JDOM Element returned by
XMLSerializable.toXML(). |
List<AminoAcidSequenceDocument> |
getAminoAcidSequences()
Gets the amino acid sequences in this document.
|
Collection<String> |
getChainIdentifiers()
Get a collection of the identifiers of all chains in the document
|
int |
getChainMissingResiduesBefore(String chainIdentifier,
int index)
Number of residues that occur prior to the start of this chain
|
String |
getDescription()
A human readable single line of text describing this document,
to appear in the description field in the document table.
|
List<DocumentField> |
getDisplayableFields()
A list of columns for display in the main document panel.
|
String |
getName()
A short name (preferably one or two words) for the document.
|
List<NucleotideSequenceDocument> |
getNucleotideSequences()
Gets the nucleotide sequences in this document.
|
Geneious.MajorVersion |
getVersionSupport(XMLSerializable.VersionSupportType versionType)
Gets either the latest version this class can serialize to via
XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
or the most recent version in which the XML returned from XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener) last changed. |
boolean |
hasSeqres(String chainIdentifier)
Whether the given chain has SEQRES records
|
boolean |
seqresAndAtomMatch(String chainIdentifier)
Whether the ATOM records in this chain have residue sequence numbers which correspond to the sequence given in the SEQRES section
|
void |
setDefaultValues(String defaultName,
Date date,
String content)
Set document fields and info from data.
|
String |
toHTML()
Provide a textual view of document.
|
String |
toString() |
org.jdom.Element |
toXML()
Convert object to a JDOM element.
|
getStructureaddDisplayableField, addReferencedDocumentUrn, clearReferencedDocumentUrns, createFromBaseElement, getBaseElement, getBaseElementString, getCreationDate, getFieldValue, getFieldValueCodes, getReferencedDocumentUrns, getURN, hasProperties, setBaseElement, setCreated, setFieldValue, setFieldValue, setFieldValues, setURN, toXMLclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittoXMLgetCreationDate, getFieldValue, getURNpublic PdbDocument()
public PdbDocument(String defaultName, Date date, String content)
defaultName - name of documentdate - creation datecontent - data in PDB formatpublic void fromXML(org.jdom.Element root)
throws XMLSerializationException
XMLSerializableXMLSerializable.toXML().
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classFromXML(org.jdom.Element)
or XMLSerializer.classFromXML(org.jdom.Element, Class)
which calls this method internally.
It is optional to implement this method. Instead of implementing an empty constructor and implementing
this method properly, the implementation may instead
throw an UnsupportedOperationException and implement a constructor
that takes a single Element as a parameter.
This allows for cleaner code such as support for final fields in the XMLSerializable class.
The element parameter should not be modified since it may be reused. If you need a modified version of it,
take a copy with Element.clone().fromXML in interface XMLSerializablefromXML in class AbstractPluginDocumentroot - representation from a previous call to toXML()RuntimeException - with an XMLSerializationException cause if an error occurs during the XML deserialization.XMLSerializationException - if the Element can't be converted into this type of objectpublic Geneious.MajorVersion getVersionSupport(XMLSerializable.VersionSupportType versionType)
XMLSerializable.OldVersionCompatibleXMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
or the most recent version in which the XML returned from XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener) last changed.getVersionSupport in interface XMLSerializable.OldVersionCompatiblegetVersionSupport in class AbstractPluginDocumentversionType - specifies which version property to returnpublic org.jdom.Element toXML()
XMLSerializableXMLSerializable.fromXML(org.jdom.Element) can completely
restore the objects representation.
It is recommended that the returned element use XMLSerializable.ROOT_ELEMENT_NAME as its name,
in which case it must not define an attribute called "type". In this case,
fromXML, will be called with an element whose name may differ from the element
return from this function. This recommendation allows a more compact representation
of the XML can be stored.
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classToXML(String, XMLSerializable)
which calls this method internally.
PluginDocument implementations of this method may choose to throw an XMLSerializationException,
enclosed in a RuntimeException.toXML in interface XMLSerializabletoXML in class AbstractPluginDocumentpublic void setDefaultValues(String defaultName, Date date, String content)
setDefaultValues in class DefaultMolecularStructureDocumentdefaultName - name of documentdate - creation datecontent - data in PDB formatpublic boolean seqresAndAtomMatch(String chainIdentifier)
chainIdentifier - chain ID. This should be one of the values returned from getChainIdentifiers()public boolean hasSeqres(String chainIdentifier)
chainIdentifier - chain ID. This should be one of the values returned from getChainIdentifiers()public int getChainMissingResiduesBefore(String chainIdentifier, int index)
chainIdentifier - chain ID. This should be one of the values returned from getChainIdentifiers()index - index in chain, as numbered by the ATOM records in the PDB file. One-based. Offsets can occasionally be
zero or less and are considered to be indices "before" the start. For all intents and purposes the lowest index
is the zeroth (zero-based) index of the sequence.public Collection<String> getChainIdentifiers()
public List<DocumentField> getDisplayableFields()
PluginDocumentPluginDocument.getFieldValue(String).
Each column is specified by a Field. The fields should be obtained from a call to the appropriate
Field.createXXXXField, where XXXX is the appropriate type.
While it is not required, it is recommended that a PluginDocument
handle returning a complete list of its displayable fields before
the document has been properly constructed via a call to XMLSerializable.fromXML(org.jdom.Element)
The returned list need not and should not be modifiable.getDisplayableFields in interface PluginDocumentgetDisplayableFields in class DefaultMolecularStructureDocumentpublic String getName()
PluginDocumentAnnotatedPluginDocument then this method
will be overridden and delegate back to AnnotatedPluginDocument.getName(). One way to look at it is
that when you call PluginDocument.getName() you will get the current name of the document. If you are implementing PluginDocument.getName() then you are
returning the default name for the document.getName in interface PluginDocumentgetName in class DefaultMolecularStructureDocumentpublic String getDescription()
PluginDocumentgetDescription in interface PluginDocumentgetDescription in class DefaultMolecularStructureDocumentpublic String toHTML()
PluginDocument<html>toHTML in interface PluginDocumenttoHTML in class DefaultMolecularStructureDocumentpublic List<NucleotideSequenceDocument> getNucleotideSequences()
SequenceListDocumentEditableSequenceDocuments.
To add/delete/reorder sequences use EditableSequenceListDocument.
To modify individual sequences in the list, use ExtendedEditableSequenceListDocument.replaceNucleotideSequence(int, NucleotideSequenceDocument)
Note that using the editing methods will require loading the entire sequence list into memory, which
might not be possible on large sequence lists. See DefaultSequenceListDocument.replaceContents for a discussion on efficiently
handling editing large sequence lists.getNucleotideSequences in interface SequenceListDocumentpublic List<AminoAcidSequenceDocument> getAminoAcidSequences()
SequenceListDocumentEditableSequenceDocuments.
To add/delete/reorder sequences use EditableSequenceListDocument.
To modify individual sequences in the list, use ExtendedEditableSequenceListDocument.replaceAminoAcidSequence(int, AminoAcidSequenceDocument)getAminoAcidSequences in interface SequenceListDocument