/** * 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<>(); }
structure = new StructureImpl();
/** * 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; }
System.out.println("dir: " + dir); Structure tmp1 = new StructureImpl();
Structure tmp1 = new StructureImpl();
/** Get an artifical Structure containing both chains. * Does NOT rotate anything * @param ca1 * @param ca2 * @return a structure object containing two models, one for each set of Atoms. * @throws StructureException */ public static final Structure getAlignedStructure(Atom[] ca1, Atom[] ca2) throws StructureException{ /* Previous implementation commented Structure s = new StructureImpl(); List<Chain>model1 = getAlignedModel(ca1); List<Chain>model2 = getAlignedModel(ca2); s.addModel(model1); s.addModel(model2); return s;*/ Structure s = new StructureImpl(); List<Chain>model1 = getAlignedModel(ca1); s.addModel(model1); List<Chain> model2 = getAlignedModel(ca2); s.addModel(model2); return s; }
s = new StructureImpl();
structure = new StructureImpl() ; currentModel = null; currentChain = null;
/** * 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); }
Structure s = new StructureImpl(); s.addModel(new ArrayList<Chain>(1)); s.setStructureIdentifier(repeatsId.get(i));
/** * 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); }
Structure n = new StructureImpl();
jmol.setTitle(pdb1 + " vs. " + pdb2); Structure n = new StructureImpl();
Structure newstruc = new StructureImpl();
/** create an artifical Structure object that contains the two * structures superimposed onto each other. Each structure is in a separate model. * Model 1 is structure 1 and Model 2 is structure 2. * * @param s1 the first structure. its coordinates will not be changed * @param s2 the second structure, it will be cloned and the cloned coordinates will be rotated according to the alignment results. * @return composite structure containing the 2 aligned structures as a models 1 and 2 */ public Structure getAlignedStructure(Structure s1, Structure s2){ // do not change the original coords .. Structure s3 = s2.clone(); currentRotMatrix.print(3,3); Calc.rotate(s3, currentRotMatrix); Calc.shift( s3, currentTranMatrix); Structure newpdb = new StructureImpl(); newpdb.setPDBCode("Java"); newpdb.setName("Aligned with BioJava"); newpdb.addModel(s1.getChains(0)); newpdb.addModel(s3.getChains(0)); return newpdb; }
Structure newS = new StructureImpl(); newS.setPDBCode(s.getPDBCode()); newS.setPDBHeader(s.getPDBHeader());
/** * Remove all models from a Structure and keep only the first * * @param s * original Structure * @return a structure that contains only the first model * @since 3.0.5 */ public static Structure removeModels(Structure s) { if (s.nrModels() == 1) return s; Structure n = new StructureImpl(); // go through whole substructure and clone ... // copy structure data n.setPDBCode(s.getPDBCode()); n.setName(s.getName()); // TODO: do deep copying of data! n.setPDBHeader(s.getPDBHeader()); n.setDBRefs(s.getDBRefs()); n.setSites(s.getSites()); n.setChains(s.getModel(0)); return n; }
Structure newS = new StructureImpl();
Structure s = new StructureImpl(); s.setPDBHeader(orig.getPDBHeader()); for ( Chain c : orig.getChains()){