/** * Instantiates a new bio java structure decoder. */ public MmtfStructureReader() { structure = new StructureImpl(); modelNumber = 0; entityInfoList = new ArrayList<>(); chainList = new ArrayList<>(); chainMap = new ArrayList<>(); transformList = new ArrayList<>(); chainSequenceMap = new HashMap<>(); }
/** {@inheritDoc} */ @Override public void addChain(Chain chain) { int modelnr = 0 ; addChain(chain,modelnr); }
/** {@inheritDoc} */ @Override public Chain findChain(String chainId) throws StructureException { return findChain(chainId,0); }
/** {@inheritDoc} */ @Override public Chain getChainByPDB(String chainId) throws StructureException{ if(nrModels() < 1 ) { throw new StructureException("No chains are present."); } return getChainByPDB(chainId,0); }
Structure n = new StructureImpl(); n.setPDBCode(getPDBCode()); n.setName(getName()); n.setDBRefs(this.getDBRefs()); n.setSites(getSites()); for (int i=0;i<nrModels();i++){ List<Chain> cloned_model = new ArrayList<Chain>(); for (int j=0;j<size(i);j++){ Chain cloned_chain = (Chain) getChainByIndex(i,j).clone();
StructureIdentifier real = getStructureIdentifier(); if(real != null) { try { for (Chain chain : getChains()) { List<Group> groups = chain.getAtomGroups(); ListIterator<Group> groupsIt = groups.listIterator(); return new SubstructureIdentifier(getPDBCode(),range);
str.append(" "); if ( nrModels()>1 ){ str.append( " models: "); str.append(nrModels()); str.append(newline) ; str.append(newline) ; for (int i=0;i<nrModels();i++){ if ( nrModels()>1 ) { str.append(" model["); str.append(i); str.append(newline); for (int j=0;j<size(i);j++){ Chain cha = getChainByIndex(i,j); List<Group> agr = cha.getAtomGroups(GroupType.AMINOACID); List<Group> hgr = cha.getAtomGroups(GroupType.HETATM);
/** {@inheritDoc} */ @Override public List<Chain> getChains(){ if (models.size()==0) { return new ArrayList<>(0); } return getChains(0); }
/** {@inheritDoc} */ @Override public Chain getChainByIndex(int number) { int modelnr = 0 ; return getChainByIndex(modelnr,number); }
/** {@inheritDoc} */ @Override public Group findGroup(String chainName, String pdbResnum) throws StructureException { return findGroup(chainName, pdbResnum, 0); }
/** {@inheritDoc} */ @Override public Chain findChain(String chainName, int modelnr) throws StructureException { return getChainByPDB(chainName, modelnr); }
/** {@inheritDoc} */ @Override public EntityInfo getCompoundById(int molId) { return getEntityById(molId); }
/** {@inheritDoc} */ @Override public Chain getChain(String asymId) { return getChain(asymId,0); }
/** {@inheritDoc} */ @Override public Chain getChain(String asymId, int modelnr) { List<Chain> chains = getChains(modelnr); for (Chain c : chains) { if (c.getId().equals(asymId)) { return c; } } return null; }
structure = new StructureImpl();
/** {@inheritDoc} */ @Override public boolean hasChain(String authId) { int modelnr = 0; List<Chain> chains = getChains(modelnr); for (Chain c : chains) { // we check here with equals because we might want to distinguish between upper and lower case chains! if (c.getId().equals(authId)) { return true; } } return false; }
/** construct a Structure object that contains a particular chain * * @param c chain */ public StructureImpl(Chain c){ this(); addChain(c); }
/** * Get an artificial Structure containing a different model for every * input structure, so that the alignment result can be viewed in Jmol. * The Atoms have to be rotated beforehand. * * @param atomArrays an array of Atoms for every aligned structure * @return a structure object containing a set of models, * one for each input array of Atoms. * @throws StructureException */ public static final Structure getAlignedStructure(List<Atom[]> atomArrays) throws StructureException { Structure s = new StructureImpl(); for (int i=0; i<atomArrays.size(); i++){ List<Chain> model = AlignmentTools.getAlignedModel(atomArrays.get(i)); s.addModel(model); } return s; }
/** {@inheritDoc} */ @Override public boolean hasPdbChain(String authId) { int modelnr = 0; List<Chain> chains = getChains(modelnr); for (Chain c : chains) { // we check here with equals because we might want to distinguish between upper and lower case chains! if (c.getName().equals(authId)) { return true; } } return false; }
/** Construct a Structure object that only contains a single group * * @param g group object */ public StructureImpl(Group g){ this(); Chain c = new ChainImpl(); c.addGroup(g); addChain(c); }