@Override public void setEntityInfo(int[] chainIndices, String sequence, String description, String type) { // First get the chains EntityInfo entityInfo = new EntityInfo(); entityInfo.setDescription(description); entityInfo.setType(EntityType.entityTypeFromString(type)); List<Chain> chains = new ArrayList<>(); // Now loop through the chain ids and make a list of them for( int index : chainIndices) { chains.add(chainList.get(index)); chainList.get(index).setEntityInfo(entityInfo); chainSequenceMap.put(chainList.get(index).getId(), sequence); } entityInfo.setChains(chains); entityInfoList.add(entityInfo); }
current_compound.setType(EntityType.POLYMER);
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()); } } }