/** * @return A SubstructureIdentifier without ranges (e.g. including all residues) */ @Override public SubstructureIdentifier toCanonical() { return new SubstructureIdentifier(null, new ArrayList<ResidueRange>()); }
@Override public SubstructureIdentifier toCanonical() throws StructureException { return new SubstructureIdentifier(pdbCode, new ArrayList<ResidueRange>()); }
public PDPDomain(String pdpDomainName, List<ResidueRange> ranges) { this.identifier = pdpDomainName; Matcher matcher = PDP_NAME_PATTERN.matcher(identifier); if(!matcher.matches()) { throw new IllegalArgumentException("Malformed PDP domain name"); } String pdbId = matcher.group(1); this.canonical = new SubstructureIdentifier(pdbId,ranges); }
public StructureIdentifier getName1() { String pdbId = f1.getText().trim(); String chainId = c1.getText().trim(); String range = r1.getText().trim(); // Prefer range over chain if( ! range.isEmpty() ) { return new SubstructureIdentifier(pdbId, ResidueRange.parseMultiple(range)); } else if ( ! chainId.isEmpty() ){ return new SubstructureIdentifier(pdbId, ResidueRange.parseMultiple(chainId)); } return new SubstructureIdentifier(pdbId); } public StructureIdentifier getName2() {
public StructureIdentifier getName2() { String pdbId = f2.getText().trim(); String chainId = c2.getText().trim(); String range = r2.getText().trim(); // Prefer range over chain if( ! range.isEmpty() ) { return new SubstructureIdentifier(pdbId, ResidueRange.parseMultiple(range)); } else if ( ! chainId.isEmpty() ){ return new SubstructureIdentifier(pdbId, ResidueRange.parseMultiple(chainId)); } return new SubstructureIdentifier(pdbId); } @Override
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) {
/** * @return A SubstructureIdentifier without ranges (e.g. including all residues) */ @Override public SubstructureIdentifier toCanonical() { String pdbId = null; List<ResidueRange> ranges = Collections.emptyList(); try { Map<String, String> params = parseQuery(url); if(params.containsKey(PDBID_PARAM)) { pdbId = params.get(PDBID_PARAM); } if(params.containsKey(RESIDUES_PARAM)) { ranges = ResidueRange.parseMultiple(params.get(RESIDUES_PARAM)); } else if(params.containsKey(CHAINID_PARAM)) { ranges = Arrays.asList(new ResidueRange(params.get(CHAINID_PARAM),(ResidueNumber)null,(ResidueNumber)null)); } } catch (UnsupportedEncodingException e) { logger.error("Unable to decode URL "+url,e); } if(pdbId == null) { String path = url.getPath(); pdbId = guessPDBID(path.substring(path.lastIndexOf("/")+1)); } return new SubstructureIdentifier(pdbId, ranges); }
@Override public SubstructureIdentifier toCanonical() { List<ResidueRange> ranges = new ArrayList<ResidueRange>(); String chain = String.valueOf(getDomainName().charAt(getDomainName().length() - 3)); for (CathSegment segment : this.getSegments()) { ranges.add(new ResidueRange(chain, segment.getStart(), segment.getStop())); } return new SubstructureIdentifier(getThePdbId(), ranges); }
@Override public SubstructureIdentifier toCanonical() { return new SubstructureIdentifier(getPdbId(), ResidueRange.parseMultiple(getRange())); }
@Override public SubstructureIdentifier toCanonical() { return new SubstructureIdentifier(getPdbId(), ResidueRange.parseMultiple(getRanges())); }
List<ResidueRange> ranges = new ArrayList<ResidueRange>(); for(String domainRange : domainRanges) { SubstructureIdentifier strucId = new SubstructureIdentifier(domainRange); if(pdbId == null) { pdbId = strucId.getPdbId();
return new SubstructureIdentifier(getPDBCode(),range);
/** * 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; }
base = new SubstructureIdentifier(pdbId); } else { base = new SubstructureIdentifier(pdbId,ResidueRange.parseMultiple(chainName)); break; case PDB: base = new SubstructureIdentifier(getIdentifier()); break; default: