import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.PDBEntry;
+import jalview.datamodel.PDBEntry.Type;
import jalview.datamodel.SequenceI;
import jalview.structure.StructureImportSettings;
private String id;
- private String dbRefType;
+ private PDBEntry.Type dbRefType;
/**
* set to true to add derived sequence annotations (temp factor read from
this.visibleChainAnnotation = StructureImportSettings
.isVisibleChainAnnotation();
this.predictSecondaryStructure = StructureImportSettings
- .isPredictSecondaryStructure();
+ .isProcessSecondaryStructure();
this.externalSecondaryStructure = StructureImportSettings
.isExternalSecondaryStructure();
pdbSequence.setName(getId() + "|" + pdbSequence.getName());
PDBEntry entry = new PDBEntry();
entry.setId(getId());
- entry.setType(this.dbRefType);
+ entry.setType(getStructureFileType());
entry.setProperty(new Hashtable());
if (chain.id != null)
{
DBRefEntry sourceDBRef = new DBRefEntry();
sourceDBRef.setAccessionId(getId());
sourceDBRef.setSource(DBRefSource.PDB);
- sourceDBRef.setStartRes(pdbSequence.getStart());
- sourceDBRef.setEndRes(pdbSequence.getEnd());
- pdbSequence.setSourceDBRef(sourceDBRef);
+ // TODO: specify version for 'PDB' database ref if it is read from a file.
+ // TODO: decide if jalview.io should be creating primary refs!
+ sourceDBRef.setVersion("");
pdbSequence.addPDBId(entry);
pdbSequence.addDBRef(sourceDBRef);
SequenceI chainseq = pdbSequence;
return chainseq;
}
+ /**
+ * filetype of structure file - default is PDB
+ */
+ String structureFileType = PDBEntry.Type.PDB.toString();
+
+ protected void setStructureFileType(String structureFileType)
+ {
+ this.structureFileType = structureFileType;
+ }
+
+ /**
+ * filetype of last file processed
+ *
+ * @return
+ */
+ public String getStructureFileType()
+ {
+ return structureFileType;
+ }
+
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void processPdbFileWithAnnotate3d(List<SequenceI> rna)
throws Exception
Class cl = Class.forName("jalview.ext.jmol.JmolParser");
if (cl != null)
{
- final Constructor constructor = cl.getConstructor(new Class[] {
- boolean.class, boolean.class, boolean.class, FileParse.class });
- final Object[] args = new Object[] { visibleChainAnnotation,
- predictSecondaryStructure, externalSecondaryStructure,
- new FileParse(getDataName(), type) };
+ final Constructor constructor = cl
+ .getConstructor(new Class[] { FileParse.class });
+ final Object[] args = new Object[] { new FileParse(getDataName(),
+ type) };
StructureImportSettings.setShowSeqFeatures(false);
StructureImportSettings.setVisibleChainAnnotation(false);
StructureImportSettings
- .setPredictSecondaryStructure(predictSecondaryStructure);
+ .setProcessSecondaryStructure(predictSecondaryStructure);
StructureImportSettings
.setExternalSecondaryStructure(externalSecondaryStructure);
Object jmf = constructor.newInstance(args);
this.chains = chains;
}
- public String getDbRefType()
+ public Type getDbRefType()
{
return dbRefType;
}
public void setDbRefType(String dbRefType)
{
+ this.dbRefType = Type.getType(dbRefType);
+ }
+
+ public void setDbRefType(Type dbRefType)
+ {
this.dbRefType = dbRefType;
}