public ResidueIdentifier(Group g) { Chain c = g.getChain(); if (c==null) { logger.warn("Chain is not available for group {}. Contact comparison will not work for this residue",g.toString()); this.seqResIndex = -1; } else { EntityInfo comp = c.getEntityInfo(); if (comp==null) { logger.warn("Compound is not available for group {}. Contact comparison will not work for this residue",g.toString()); this.seqResIndex = -1; } else { this.seqResIndex = comp.getAlignedResIndex(g, c); } } }
/** * Finds the parent compounds by looking up the references of first atom of each side of this interface * @return */ public Pair<EntityInfo> getParentCompounds() { Pair<Chain> chains = getParentChains(); if (chains == null) { logger.warn("Could not find parents chains, compounds will be null"); return null; } return new Pair<EntityInfo>(chains.getFirst().getEntityInfo(), chains.getSecond().getEntityInfo()); }
/** * Converts a Chain into a List of {@link AtomSite} objects * @param c the chain * @param model the model number for the output AtomSites * @param chainName the chain identifier (author id) for the output AtomSites * @param chainId the internal chain identifier (asym id) for the output AtomSites * @return */ public static List<AtomSite> convertChainToAtomSites(Chain c, int model, String chainName, String chainId) { List<AtomSite> list = new ArrayList<>(); if (c.getEntityInfo()==null) { logger.warn("No Compound (entity) found for chain {}: entity_id will be set to 0, label_seq_id will be the same as auth_seq_id", c.getName()); } for ( int h=0; h<c.getAtomLength();h++){ Group g= c.getAtomGroup(h); list.addAll(convertGroupToAtomSites(g, model, chainName, chainId)); } return list; }
if ( cha.getEntityInfo() != null){ EntityInfo comp = cha.getEntityInfo(); String molName = comp.getDescription(); if ( molName != null){
/** * Returns true if the 2 molecules of this interface are the same entity (i.e. homomeric interface), false * otherwise (i.e. heteromeric interface) * @return true if homomeric or if either of the entities is unknonw (null Compounds), false otherwise */ public boolean isHomomeric() { EntityInfo first = getParentChains().getFirst().getEntityInfo(); EntityInfo second = getParentChains().getSecond().getEntityInfo(); if (first==null || second==null) { logger.warn("Some compound of interface {} is null, can't determine whether it is homo/heteromeric. Consider it homomeric", getId()); return true; } return first.getRepresentative().getId().equals(second.getRepresentative().getId()); }
public void addChain(Chain c) { EntityInfo info = c.getEntityInfo(); if ( info == null || info.getType() == null) { logger.info("No entity info could be found while adding chain with asym id {} (author id {}). Will consider it a polymer chain.", c.getId(), c.getName()); polyChains.add(c); } else if ( info.getType() == EntityType.POLYMER) { polyChains.add(c); } else if (info.getType() == EntityType.NONPOLYMER) { nonPolyChains.add(c); } else if (info.getType() == EntityType.WATER) { waterChains.add(c); } else if (info.getType() == EntityType.MACROLIDE) { logger.warn("Chain with asym id {} (author id {}) has entity type 'macrolide', considering it non-polymeric", c.getId(), c.getName()); nonPolyChains.add(c); } else { logger.warn("Chain with asym id {} (author id {}) has unsupported entity type '{}'. Will not add it to the Structure.", c.getId(), c.getName(), info.getType().toString()); // ignore it } }
c.getEntityInfo().addChain(clonedChain);
Pair<Chain> otherChains = other.getParentChains(); if (thisChains.getFirst().getEntityInfo() == null || thisChains.getSecond().getEntityInfo() == null || otherChains.getFirst().getEntityInfo() == null || otherChains.getSecond().getEntityInfo() == null ) { Pair<EntityInfo> thisCompounds = new Pair<EntityInfo>(thisChains.getFirst().getEntityInfo(), thisChains.getSecond().getEntityInfo()); Pair<EntityInfo> otherCompounds = new Pair<EntityInfo>(otherChains.getFirst().getEntityInfo(), otherChains.getSecond().getEntityInfo());
!c.getEntityInfo().getDescription().contains("SUGAR") ) {
if (g.getChain()!=null && g.getChain().getEntityInfo()!=null) { entityId = Integer.toString(g.getChain().getEntityInfo().getMolId()); labelSeqId = Integer.toString(g.getChain().getEntityInfo().getAlignedResIndex(g, g.getChain()));
newChain.setId(chain.getId()); newChain.setName(chain.getName()); newChain.setEntityInfo(chain.getEntityInfo()); structure.addChain(newChain); } else {
if (currentChain == null || !currentChain.getId().equals(chain.getId())) { structure.addChain(chain); chain.setEntityInfo(group.getChain().getEntityInfo()); chain.setStructure(structure); chain.setSwissprotId(group.getChain().getSwissprotId());
newChain.setId(chain.getId()); newChain.setName(chain.getName()); newChain.setEntityInfo(chain.getEntityInfo()); newChain.setSwissprotId(chain.getSwissprotId());
chain.setName(oldChain.getName()); EntityInfo oldEntityInfo = oldChain.getEntityInfo();
c1.setId(c.getId()); c1.setName(c.getName()); c1.setEntityInfo(c.getEntityInfo()); s.addChain(c1);