public String getPdbId() { return canonical.getPdbId(); }
/** * Get the PDB ID for this name, if any. * * Equivalent to {@link SubstructureIdentifier#getPdbId() * toCanonical().getPdbId()} * @return The upper-case PDB Name, or null if not applicable * @throws StructureException Wraps errors which occur when converting to canonical form */ public String getPdbId() throws StructureException { if( pdbId == null) { pdbId = toCanonical().getPdbId(); } return pdbId; }
/** * Loads the complete structure based on {@link #getPdbId()}. * * @param AtomCache A source of structures * @return A Structure containing at least the atoms identified by this, * or null if no PDB ID is set * @throws StructureException For errors loading and parsing the structure * @throws IOException Errors reading the structure from disk */ @Override public Structure loadStructure(AtomCache cache) throws IOException, StructureException { String pdb = getPdbId(); if(pdb == null) return null; return cache.getStructureForPdbId(pdb); }
private boolean initFromPDB(String suffix) { mySource = Source.PDB; SubstructureIdentifier si = new SubstructureIdentifier(suffix); base = si; // Safe to realize immediately pdbId = si.getPdbId(); // Set chainName if unique Set<String> chains = getChainNames(si); if(chains.size() == 1) { this.chainName = chains.iterator().next(); } else if(chains.size() > 1) { this.chainName = "."; } else { this.chainName = null; } return true; } private boolean initFromURL(String suffix) {
.get(templateIndex); SubstructureIdentifier canon = tName.toCanonical(); String tPdbId = canon.getPdbId(); String tChain = null; for(ResidueRange range : canon.getResidueRanges()) {
/** * Return the symmetric repeats as structure identifiers, if the result is * symmetric and it was refined, return null otherwise. * * @return List of StructureIdentifiers or null if not defined * @throws StructureException */ public List<StructureIdentifier> getRepeatsID() throws StructureException { if (!isRefined()) return null; List<StructureIdentifier> repeats = new ArrayList<StructureIdentifier>( numRepeats); String pdbId = structureId.toCanonical().getPdbId(); Block align = multipleAlignment.getBlocks().get(0); for (int su = 0; su < numRepeats; su++) { // Get the start and end residues of the repeat ResidueNumber res1 = atoms[align.getStartResidue(su)].getGroup() .getResidueNumber(); ResidueNumber res2 = atoms[align.getFinalResidue(su)].getGroup() .getResidueNumber(); ResidueRange range = new ResidueRange(res1.getChainName(), res1, res2); StructureIdentifier id = new SubstructureIdentifier(pdbId, Arrays.asList(range)); repeats.add(id); } return repeats; }