- try
- {
- String lastID = "";
- List<SequenceI> rna = new ArrayList<SequenceI>();
- List<SequenceI> prot = new ArrayList<SequenceI>();
- PDBChain tmpchain;
- String pdbId = (String) ms.getInfo(0, "title");
- setId(pdbId);
- List<Atom> significantAtoms = convertSignificantAtoms(ms);
- for (Atom tmpatom : significantAtoms)
+ DBRefEntry sourceDBRef = new DBRefEntry();
+ sourceDBRef.setAccessionId(accessionId);
+ sourceDBRef.setSource(DBRefSource.MMCIF);
+ sourceDBRef.setStartRes(start);
+ sourceDBRef.setEndRes(end);
+ sq.setSourceDBRef(sourceDBRef);
+ sq.addDBRef(sourceDBRef);
+ }
+
+ /**
+ * Add a PDBEntry giving the source of PDB data to the sequence
+ *
+ * @param sq
+ * @param id
+ * @param chainId
+ */
+ protected void addPdbid(SequenceI sq, String id, String chainId)
+ {
+ PDBEntry entry = new PDBEntry();
+ entry.setId(id);
+ entry.setType(PDBEntry.Type.MMCIF);
+ entry.setProperty(new Hashtable());
+ if (chainId != null)
+ {
+ // entry.getProperty().put("CHAIN", chains.elementAt(i).id);
+ entry.setChainCode(String.valueOf(chainId));
+ }
+ if (inFile != null)
+ {
+ entry.setFile(inFile.getAbsolutePath());
+ }
+ else
+ {
+ // TODO: decide if we should dump the datasource to disk
+ entry.setFile(getDataName());
+ }
+
+ sq.addPDBId(entry);
+ }
+
+
+ /**
+ * Helper method that adds an AlignmentAnnotation for secondary structure to
+ * the sequence, provided at least one secondary structure prediction has been
+ * made
+ *
+ * @param modelTitle
+ * @param seq
+ * @param secstr
+ * @param secstrcode
+ * @param chainId
+ * @param firstResNum
+ * @return
+ */
+ protected void addSecondaryStructureAnnotation(String modelTitle,
+ SequenceI sq, char[] secstr, char[] secstrcode, String chainId,
+ int firstResNum)
+ {
+ char[] seq = sq.getSequence();
+ boolean ssFound = false;
+ Annotation asecstr[] = new Annotation[seq.length + firstResNum - 1];
+ for (int p = 0; p < seq.length; p++)
+ {
+ if (secstr[p] >= 'A' && secstr[p] <= 'z')