@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); }
current_compound.setMolId(i);
eId, chain.getId()); entityInfo = new EntityInfo(); entityInfo.setMolId(eId); entityInfo.addChain(chain); if (chain.isWaterOnly()) {
private void addEntities(StructAsym asym) { int eId = 0; try { eId = Integer.parseInt(asym.getEntity_id()); } catch (NumberFormatException e) { logger.warn("Could not parse mol_id from string {}. Will use 0 for creating Entity",asym.getEntity_id()); } Entity e = getEntity(eId); // for some mmCIF files like 1yrm all 3 of _entity_src_gen, _entity_src_nat and _pdbx_entity_src_syn are missing // we need to fill the Compounds in some other way: EntityInfo entityInfo = structure.getEntityById(eId); if (entityInfo==null) { //logger.info("Creating new EntityInfo " + eId + " " + e.getId() + " " + e.getPdbx_description()); entityInfo = new EntityInfo(); entityInfo.setMolId(eId); // we only add the compound if a polymeric one (to match what the PDB parser does) if (e!=null) { entityInfo.setDescription(e.getPdbx_description()); EntityType eType = EntityType.entityTypeFromString(e.getType()); if (eType!=null) { entityInfo.setType(eType); } else { logger.warn("Type '{}' is not recognised as a valid entity type for entity {}", e.getType(), eId); } addAncilliaryEntityData(asym, eId, e, entityInfo); structure.addEntityInfo(entityInfo); logger.debug("Adding Entity with entity id {} from _entity, with name: {}",eId, entityInfo.getDescription()); } } }