/** * Adds a chain to the given structure to form a biological assembly, * adding the symmetry expanded chains as new models per transformId. * @param s * @param newChain * @param transformId */ private void addChainMultiModel(Structure s, Chain newChain, String transformId) { // multi-model bioassembly if ( modelIndex.size() == 0) modelIndex.add("PLACEHOLDER FOR ASYM UNIT"); int modelCount = modelIndex.indexOf(transformId); if ( modelCount == -1) { modelIndex.add(transformId); modelCount = modelIndex.indexOf(transformId); } if (modelCount == 0) { s.addChain(newChain); } else if (modelCount > s.nrModels()) { List<Chain> newModel = new ArrayList<Chain>(); newModel.add(newChain); s.addModel(newModel); } else { s.addChain(newChain, modelCount-1); } }
@Override public void finalizeStructure() { // Number the remaining ones int counter =0; // Add the entity info for (EntityInfo entityInfo : entityInfoList) { counter++; entityInfo.setMolId(counter); } structure.setEntityInfos(entityInfoList); // Add the actual chains for(int i=0; i<chainMap.size(); i++) { // Now add the chain information Map<String, Chain> modelChainMap = chainMap.get(i); for(Chain modelChain : modelChainMap.values()){ structure.addChain(modelChain, i); String sequence = chainSequenceMap.get(modelChain.getId()); if (sequence == null) { logger.warn("Sequence is null for chain with asym_id {}. Most likely the chain is non-polymeric. Will not add seqres groups for it.", modelChain.getId()); continue; } MmtfUtils.addSeqRes(modelChain, sequence); } } StructureTools.cleanUpAltLocs(structure); }
/** * Adds a chain to the given structure to form a biological assembly, * adding the symmetry-expanded chains as new chains with renamed * chain ids and names (in the form originalAsymId_transformId and originalAuthId_transformId). * @param s * @param newChain * @param transformId */ private void addChainFlattened(Structure s, Chain newChain, String transformId) { newChain.setId(newChain.getId()+"_"+transformId); newChain.setName(newChain.getName()+"_"+transformId); s.addChain(newChain); }
tmp1.setPDBHeader(structure1.getPDBHeader()); tmp1.setPDBCode(structure1.getPDBCode()); tmp1.addChain(c1); System.out.println("ok");
tmp1.setPDBHeader(structure1.getPDBHeader()); tmp1.setPDBCode(structure1.getPDBCode()); tmp1.addChain(c1); System.out.println("ok");
/** * Create and set a new structure from a given atom array. * @param atoms */ public void setAtoms(Atom[] atoms){ Structure s = new StructureImpl(); Chain c = new ChainImpl(); c.setId("A"); for (Atom a: atoms){ c.addGroup(a.getGroup()); } s.addChain(c); setStructure(s); }
/** * Aligns two chains from the structures using user provided parameters. * * @param s1 * @param chainId1 * @param s2 * @param chainId2 * @param params * @throws StructureException */ public void align(Structure s1, String chainId1, Structure s2, String chainId2, StrucAligParameters params) throws StructureException { reset(); this.params = params; Chain c1 = s1.getPolyChainByPDB(chainId1); Chain c2 = s2.getPolyChainByPDB(chainId2); Structure s3 = new StructureImpl(); s3.addChain(c1); Structure s4 = new StructureImpl(); s4.addChain(c2); Atom[] ca1 = getAlignmentAtoms(s3); Atom[] ca2 = getAlignmentAtoms(s4); notifyStartingAlignment(s1.getName(), ca1, s2.getName(), ca2); align(ca1, ca2, params); }
newChain.setName(chain.getName()); newChain.setEntityInfo(chain.getEntityInfo()); structure.addChain(newChain); } else { newChain = structure.getNonPolyChain(chain.getId());
chain.setId(group.getChain().getId()); if (currentChain == null || !currentChain.getId().equals(chain.getId())) { structure.addChain(chain); chain.setEntityInfo(group.getChain().getEntityInfo()); chain.setStructure(structure);
c1.setName(c.getName()); c1.setEntityInfo(c.getEntityInfo()); s.addChain(c1);
chain.setSeqMisMatches(oldChain.getSeqMisMatches()); s.addChain(chain,model);