import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefEntry;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.io.FileParse;
doParse();
}
+ @Override
public String print()
{
return null;
}
+ @Override
public void parse() throws IOException
{
// TODO set the filename sensibly - try using data source name.
*/
protected SequenceI postProcessChain(PDBChain chain)
{
- SequenceI dataset = chain.sequence;
- dataset.setName(id + "|" + dataset.getName());
+ SequenceI pdbSequence = chain.sequence;
+ pdbSequence.setName(id + "|" + pdbSequence.getName());
PDBEntry entry = new PDBEntry();
entry.setId(id);
entry.setType(PDBEntry.Type.PDB);
// TODO: decide if we should dump the datasource to disk
entry.setFile(getDataName());
}
- dataset.addPDBId(entry);
+ pdbSequence.addPDBId(entry);
+
+ DBRefEntry sourceDBRef = new DBRefEntry();
+ sourceDBRef.setAccessionId(id);
+ sourceDBRef.setSource("PDB");
+ sourceDBRef.setStartRes(pdbSequence.getStart());
+ sourceDBRef.setEndRes(pdbSequence.getEnd());
+ pdbSequence.setSourceDBRef(sourceDBRef);
// PDBChain objects maintain reference to dataset
- SequenceI chainseq = dataset.deriveSequence();
+ SequenceI chainseq = pdbSequence.deriveSequence();
seqs.addElement(chainseq);
AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
initSeqAndName(seq.getName(), seq.getSequence(), seq.getStart(),
seq.getEnd());
description = seq.getDescription();
+ sourceDBRef = seq.getSourceDBRef();
if (seq.getSequenceFeatures() != null)
{
SequenceFeature[] sf = seq.getSequenceFeatures();
*/
public AlignmentI getSequenceRecords(String queries) throws Exception
{
- AlignmentI pdbfile = null;
+ AlignmentI pdbAlignment = null;
Vector result = new Vector();
String chain = null;
String id = null;
try
{
- pdbfile = new FormatAdapter().readFile(file,
+ pdbAlignment = new FormatAdapter().readFile(file,
jalview.io.AppletFormatAdapter.FILE, "PDB");
- if (pdbfile != null)
+ if (pdbAlignment != null)
{
List<SequenceI> toremove = new ArrayList<SequenceI>();
- for (SequenceI pdbcs : pdbfile.getSequences())
+ for (SequenceI pdbcs : pdbAlignment.getSequences())
{
String chid = null;
// Mapping map=null;
// now remove marked sequences
for (SequenceI pdbcs : toremove)
{
- pdbfile.deleteSequence(pdbcs);
+ pdbAlignment.deleteSequence(pdbcs);
if (pdbcs.getAnnotation() != null)
{
for (AlignmentAnnotation aa : pdbcs.getAnnotation())
{
- pdbfile.deleteAnnotation(aa);
+ pdbAlignment.deleteAnnotation(aa);
}
}
}
}
- if (pdbfile == null || pdbfile.getHeight() < 1)
+ if (pdbAlignment == null || pdbAlignment.getHeight() < 1)
{
throw new Exception(MessageManager.formatMessage(
"exception.no_pdb_records_for_chain", new String[] { id,
stopQuery();
throw (ex);
}
- return pdbfile;
+ return pdbAlignment;
}
/*
&& getAllMappingAccession().contains(accessionId);
}
-
@Override
public Entity getEntityById(String id) throws SiftsException
{
: strName.length();
int len = 72 - maxid - 1;
- // int nochunks = 2;// mp.getWrapHeight();
int nochunks = ((seqRes.length()) / len)
+ ((seqRes.length()) % len > 0 ? 1 : 0);
// output mappings