package jalview.api;
+import jalview.datamodel.Mapping;
+
public interface DBRefEntryI
{
* @return index of end residue in the source DB
*/
public int getEndRes();
+
+ public Mapping getMap();
}
}
+
public DBRefEntry(String source, String version, String accessionId)
{
this(source, version, accessionId, null);
this.map = map;
}
- public DBRefEntry(DBRefEntry entry)
+ public DBRefEntry(DBRefEntryI entry)
{
- this(
- (entry.source == null ? "" : new String(entry.source)),
- (entry.version == null ? "" : new String(entry.version)),
- (entry.accessionId == null ? "" : new String(entry.accessionId)),
- (entry.map == null ? null : new Mapping(entry.map)));
+ this((entry.getSource() == null ? "" : new String(entry.getSource())),
+ (entry.getVersion() == null ? "" : new String(
+ entry.getVersion())),
+ (entry.getAccessionId() == null ? "" : new String(
+ entry.getAccessionId())),
+ (entry.getMap() == null ? null : new Mapping(entry.getMap())));
}
@Override
}
+ @Override
public Mapping getMap()
{
return map;
initSeqAndName(seq.getName(), seq.getSequence(), seq.getStart(),
seq.getEnd());
description = seq.getDescription();
- sourceDBRef = seq.getSourceDBRef();
+ sourceDBRef = seq.getSourceDBRef() == null ? null : new DBRefEntry(
+ seq.getSourceDBRef());
if (seq.getSequenceFeatures() != null)
{
SequenceFeature[] sf = seq.getSequenceFeatures();
sourceDBRef.setStartRes(pdbSequence.getStart());
sourceDBRef.setEndRes(pdbSequence.getEnd());
- // PDBChain objects maintain reference to dataset
-
- // SequenceI chainseq = pdbSequence.deriveSequence();
- // chainseq.setSourceDBRef(sourceDBRef);
- // chainseq.addPDBId(entry);
- // chainseq.addDBRef(sourceDBRef);
- SequenceI chainseq = chain.sequence;
- chainseq.addPDBId(entry);
+ SequenceI chainseq = pdbSequence.deriveSequence();
chainseq.setSourceDBRef(sourceDBRef);
+ chainseq.addPDBId(entry);
chainseq.addDBRef(sourceDBRef);
+
seqs.addElement(chainseq);
AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
assertEquals("D", pf.getChains().get(3).id);
PDBChain chainA = pf.getChains().get(0);
+ SequenceI seqA = pf.getSeqs().get(0);
+
assertEquals(0, chainA.seqstart); // not set
assertEquals(0, chainA.seqend); // not set
assertEquals(18, chainA.sequence.getStart());
assertTrue(chainA.sequence.getSequenceAsString().endsWith("WNVEVY"));
assertEquals("3W5V|A", chainA.sequence.getName());
assertNull(chainA.sequence.getAnnotation());
- assertEquals(1, chainA.sequence.getAllPDBEntries().size());
- PDBEntry pdb = chainA.sequence.getAllPDBEntries().get(0);
+ assertEquals(1, seqA.getAllPDBEntries().size());
+ PDBEntry pdb = seqA.getAllPDBEntries().get(0);
assertEquals("A", pdb.getChainCode());
assertEquals("PDB", pdb.getType());
assertEquals("3W5V", pdb.getId());