@SuppressWarnings("unused") private static void displayAlignment(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, StructureException { Atom[] ca1clone = StructureTools.cloneAtomArray(ca1); Atom[] ca2clone = StructureTools.cloneAtomArray(ca2); if (! GuiWrapper.isGuiModuleInstalled()) { System.err.println("The biojava-structure-gui and/or JmolApplet modules are not installed. Please install!"); // display alignment in console System.out.println(afpChain.toCE(ca1clone, ca2clone)); } else { Object jmol = GuiWrapper.display(afpChain,ca1clone,ca2clone); GuiWrapper.showAlignmentImage(afpChain, ca1clone,ca2clone,jmol); } } }
/** * Try showing a the afpChain in a GUI. * * <p>requires additional dependencies biojava-structure-gui and JmolApplet * * @param afpChain * @param ca1 * @param ca2 * @throws ClassNotFoundException * @throws NoSuchMethodException * @throws InvocationTargetException * @throws IllegalAccessException * @throws StructureException */ private static void displayAlignment(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, StructureException { Atom[] ca1clone = StructureTools.cloneAtomArray(ca1); Atom[] ca2clone = StructureTools.cloneAtomArray(ca2); if (! GuiWrapper.isGuiModuleInstalled()) { System.err.println("The biojava-structure-gui and/or JmolApplet modules are not installed. Please install!"); // display alignment in console System.out.println(afpChain.toCE(ca1clone, ca2clone)); } else { Object jmol = GuiWrapper.display(afpChain,ca1clone,ca2clone); GuiWrapper.showAlignmentImage(afpChain, ca1clone,ca2clone,jmol); } } }
Atom[] array2 = atomSet2.toArray(new Atom[atomSet2.size()]); array2 = StructureTools.cloneAtomArray(array2);
Atom[] array2 = atomSet2.toArray(new Atom[atomSet2.size()]); array2 = StructureTools.cloneAtomArray(array2);
Atom[] atoms2c = StructureTools.cloneAtomArray(atoms2); Calc.transform(atoms2c, transform);
Atom[] ca2p = StructureTools.cloneAtomArray(ca2);
/** Note: ca2, hetatoms2 and nucleotides2 should not be rotated. This will be done here... * */ public static final StructureAlignmentJmol display(AFPChain afpChain,Group[] twistedGroups, Atom[] ca1, Atom[] ca2,List<Group> hetatms1, List<Group> hetatms2 ) throws StructureException { List<Atom> twistedAs = new ArrayList<Atom>(); for ( Group g: twistedGroups){ if ( g == null ) continue; if ( g.size() < 1) continue; Atom a = g.getAtom(0); twistedAs.add(a); } Atom[] twistedAtoms = twistedAs.toArray(new Atom[twistedAs.size()]); twistedAtoms = StructureTools.cloneAtomArray(twistedAtoms); Atom[] arr1 = getAtomArray(ca1, hetatms1); Atom[] arr2 = getAtomArray(twistedAtoms, hetatms2); // //if ( hetatms2.size() > 0) // System.out.println("atom after:" + hetatms2.get(0).getAtom(0)); //if ( hetatms2.size() > 0) // System.out.println("atom after:" + hetatms2.get(0).getAtom(0)); String title = afpChain.getAlgorithmName() + " V." +afpChain.getVersion() + " : " + afpChain.getName1() + " vs. " + afpChain.getName2(); //System.out.println(artificial.toPDB()); StructureAlignmentJmol jmol = new StructureAlignmentJmol(afpChain,arr1,arr2); //jmol.setStructure(artificial); System.out.format("CA2[0]=(%.2f,%.2f,%.2f)%n", arr2[0].getX(), arr2[0].getY(), arr2[0].getZ()); //jmol.setTitle("Structure Alignment: " + afpChain.getName1() + " vs. " + afpChain.getName2()); jmol.setTitle(title); return jmol; }
Atom[] cloned = StructureTools.cloneAtomArray(symm.getAtoms()); AbstractAlignmentJmol jmol = StructureAlignmentDisplay.display( symm.getSelfAlignment(), symm.getAtoms(), cloned);
Atom[] origCA = StructureTools.cloneAtomArray(ca2); Atom[] iniTwistPdb = StructureTools.cloneAtomArray(ca2);
/** * @param afpChain Input afpchain. UNMODIFIED * @param ca1 * @param ca2 * @param optLens * @param optAln * @return A NEW AfpChain based off the input but with the optAln modified * @throws StructureException if an error occured during superposition */ public static AFPChain replaceOptAln(AFPChain afpChain, Atom[] ca1, Atom[] ca2, int blockNum, int[] optLens, int[][][] optAln) throws StructureException { int optLength = 0; for( int blk=0;blk<blockNum;blk++) { optLength += optLens[blk]; } //set everything AFPChain refinedAFP = (AFPChain) afpChain.clone(); refinedAFP.setOptLength(optLength); refinedAFP.setBlockSize(optLens); refinedAFP.setOptLen(optLens); refinedAFP.setOptAln(optAln); refinedAFP.setBlockNum(blockNum); //TODO recalculate properties: superposition, tm-score, etc Atom[] ca2clone = StructureTools.cloneAtomArray(ca2); // don't modify ca2 positions AlignmentTools.updateSuperposition(refinedAFP, ca1, ca2clone); AFPAlignmentDisplay.getAlign(refinedAFP, ca1, ca2clone); return refinedAFP; }
Structure structure1 = cache.getStructure(pair.getName1()); ca1 = StructureTools.getRepresentativeAtomArray(structure1); } else ca1 = StructureTools.cloneAtomArray(ca1); structure2 = cache.getStructure(pair.getName2()); ca2 = StructureTools.getRepresentativeAtomArray(structure2); } else ca2 = StructureTools.cloneAtomArray(ca2);
.cloneAtomArray(symmResult.getAtoms()); AbstractAlignmentJmol jmol = StructureAlignmentDisplay.display( symmResult.getSelfAlignment(), symmResult.getAtoms(),
Atom[] ca2clone = StructureTools.cloneAtomArray(ca2);
Atom[] ca2clone = StructureTools.cloneAtomArray(ca2); // don't modify ca2 positions AlignmentTools.updateSuperposition(copyAFP, ca1, ca2clone);
Atom[] ca2clone = StructureTools.cloneAtomArray(ca2);