*/
public static File downloadSiftsFile(String pdbId) throws SiftsException
{
+ if (pdbId.contains(".cif"))
+ {
+ pdbId = pdbId.replace(".cif", "");
+ }
String siftFile = pdbId + ".xml.gz";
String siftsFileFTPURL = SIFTS_FTP_BASE_URL + siftFile;
String downloadedSiftsFile = SiftsSettings.getSiftDownloadDirectory()
}
/**
+ *
+ * @param chainId
+ * Target chain to populate mapping of its atom positions.
+ * @param mapping
+ * Two dimension array of residue index versus atom position
+ * @throws IllegalArgumentException
+ * Thrown if chainId or mapping is null
+ */
+ void populateAtomPositions(String chainId,
+ HashMap<Integer, int[]> mapping) throws IllegalArgumentException
+ {
+ PDBChain chain = pdb.findChain(chainId);
+ if (chain == null || mapping == null)
+ {
+ throw new IllegalArgumentException(
+ "Chain id or mapping must not be null.");
+ }
+ for (int[] map : mapping.values())
+ {
+ if (map[PDB_RES_POS] != UNASSIGNED)
+ {
+ map[PDB_ATOM_POS] = getAtomIndex(map[PDB_RES_POS], chain.atoms);
+ }
+ }
+ }
+
+ /**
+ *
+ * @param residueIndex
+ * The residue index used for the search
+ * @param atoms
+ * A collection of Atom to search
+ * @return atom position for the given residue index
+ */
+ int getAtomIndex(int residueIndex, Collection<Atom> atoms)
+ {
+ if (atoms == null)
+ {
+ throw new IllegalArgumentException(
+ "atoms collection must not be null!");
+ }
+ for (Atom atom : atoms)
+ {
+ if (atom.resNumber == residueIndex)
+ {
+ return atom.atomIndex;
+ }
+ }
+ return UNASSIGNED;
+ }
+
+ /**
* Checks if the residue instance is marked 'Not_observed' or not
*
* @param residue
}
}
- /**
- *
- * @param chainId
- * Target chain to populate mapping of its atom positions.
- * @param mapping
- * Two dimension array of residue index versus atom position
- * @throws IllegalArgumentException
- * Thrown if chainId or mapping is null
- */
- void populateAtomPositions(String chainId, HashMap<Integer, int[]> mapping)
- throws IllegalArgumentException
- {
- PDBChain chain = pdb.findChain(chainId);
- if (chain == null || mapping == null)
- {
- throw new IllegalArgumentException(
- "Chain id or mapping must not be null.");
- }
- for (int[] map : mapping.values())
- {
- if (map[PDB_RES_POS] != UNASSIGNED)
- {
- map[PDB_ATOM_POS] = getAtomIndex(map[PDB_RES_POS], chain.atoms);
- }
- }
- }
- /**
- *
- * @param residueIndex
- * The residue index used for the search
- * @param atoms
- * A collection of Atom to search
- * @return atom position for the given residue index
- */
- int getAtomIndex(int residueIndex, Collection<Atom> atoms)
- {
- if (atoms == null)
- {
- throw new IllegalArgumentException(
- "atoms collection must not be null!");
- }
- for (Atom atom : atoms)
- {
- if (atom.resNumber == residueIndex)
- {
- return atom.atomIndex;
- }
- }
- return UNASSIGNED;
- }
@Override
public Entity getEntityById(String id) throws SiftsException