Codota Logo
Calc.shift
Code IndexAdd Codota to your IDE (free)

How to use
shift
method
in
org.biojava.nbio.structure.Calc

Best Java code snippets using org.biojava.nbio.structure.Calc.shift (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: biojava/biojava

/**
 * Shift an array of atoms at once.
 *
 * @param ca
 *            array of Atoms to shift
 * @param b
 *            reference Atom vector
 */
public static void shift(Atom[] ca, Atom b) {
  for (Atom atom : ca)
    Calc.shift(atom, b);
}
origin: biojava/biojava

/** rotate and shift atoms with currentRotMatrix and current Tranmatrix
 *
 * @param ca
 */
private void rotateShiftAtoms(Atom[] ca){
  for (int i  = 0 ; i < ca.length; i++){
    Atom c = ca[i];
    Calc.rotate(c,currentRotMatrix);
    Calc.shift(c,currentTranMatrix);
    //System.out.println("after " + c);
    ca[i] = c;
  }
  //System.out.println("after " + ca[0]);
}
origin: biojava/biojava

public void rotate(Atom[] atoms, double theta) {
  Matrix rot = getRotationMatrix(theta);
  if(rotationPos == null) {
    // Undefined rotation axis; do nothing
    return;
  }
  Atom negPos;
    negPos = Calc.invert(rotationPos);
  for(Atom a: atoms) {
    Calc.shift(a, negPos);
  }
  Calc.rotate(atoms, rot);
  for(Atom a: atoms) {
    Calc.shift(a, rotationPos);
  }
}
origin: biojava/biojava

/** only shift CA positions.
 *
 */
public static void shiftCA2(AFPChain afpChain, Atom[] ca2,  Matrix m, Atom shift, Group[] twistedGroups) {
  int i = -1;
  for (Atom a: ca2){
    i++;
    Group g = a.getGroup();
    Calc.rotate(g,m);
    Calc.shift(g, shift);
    if (g.hasAltLoc()){
      for (Group alt: g.getAltLocs()){
        for (Atom alta : alt.getAtoms()){
          if ( g.getAtoms().contains(alta))
            continue;
          Calc.rotate(alta,m);
          Calc.shift(alta,shift);
        }
      }
    }
    twistedGroups[i]=g;
  }
}
origin: biojava/biojava

private void rot_mol(Atom[] caA, Atom[] caB, int nse2, Matrix m , Atom shift) throws StructureException{
  for(int l=0; l<nse2; l++) {
    Atom a = caA[l];
    Group g = (Group)a.getGroup().clone();
    //Group g = (Group)a.getParent();
    Calc.rotate( g, m);
    Calc.shift(  g, shift);
    caB[l] = g.getAtom(a.getName());
  }
}
origin: biojava/biojava

private void rot_mol(Atom[] caA, Atom[] caB, int nse2, Matrix m , Atom shift) throws StructureException{
  for(int l=0; l<nse2; l++) {
    Atom a = caA[l];
    Group g = (Group)a.getGroup().clone();
    //Group g = (Group)a.getParent();
    Calc.rotate( g, m);
    Calc.shift(  g, shift);
    caB[l] = g.getAtom(a.getName());
  }
}
origin: biojava/biojava

Atom ca2clone = ca2[optAln[b][1][p]];
Calc.rotate(ca2clone, afpChain.getBlockRotationMatrix()[b]);
Calc.shift(ca2clone, afpChain.getBlockShiftVector()[b]);
origin: biojava/biojava

Calc.shift(s3,shift2);
origin: biojava/biojava

Calc.shift(g,vector1);
origin: biojava/biojava

/** 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;
}
origin: biojava/biojava

/**
 * Get the RMS of the JointFragments pair frag
 *
 * @param ca1 the array of all atoms of structure1
 * @param ca2 the array of all atoms of structure1
 * @param frag the JointFragments object that contains the list of identical positions
 * @return the rms
 */
public static double getRMS(Atom[] ca1, Atom[]ca2,JointFragments frag) throws StructureException {
  //      now svd ftmp and check if the rms is < X ...
  AlternativeAlignment ali = new AlternativeAlignment();
  ali.apairs_from_idxlst(frag);
  double rms = 999;
  int[] idx1 = ali.getIdx1();
  int[] idx2 = ali.getIdx2();
  Atom[] ca1subset = AlignUtils.getFragmentFromIdxList(ca1, idx1);
  Atom[] ca2subset = AlignUtils.getFragmentFromIdxList(ca2,idx2);
  ali.calculateSuperpositionByIdx(ca1,ca2);
  Matrix rot = ali.getRotationMatrix();
  Atom atom = ali.getShift();
  for (Atom a : ca2subset) {
    Calc.rotate(a, rot);
    Calc.shift(a, atom);
  }
  rms = Calc.rmsd(ca1subset,ca2subset);
  return rms;
}
origin: biojava/biojava

Calc.shift(a, shift);
org.biojava.nbio.structureCalcshift

Javadoc

Shift a vector.

Popular methods of Calc

  • getDistance
    calculate distance between two atoms.
  • rotate
  • add
    add two atoms ( a + b).
  • amount
    Gets the length of the vector (2-norm)
  • angle
    Gets the angle between two vectors
  • atomsToPoints
    Convert an array of atoms into an array of vecmath points
  • calcRotationAngleInDegrees
    Calculates the angle from centerPt to targetPt in degrees. The return should range from [0,360), rot
  • centerAtoms
    Center the atoms at the Centroid, if the centroid is already know.
  • centerOfMass
    Returns the center of mass of the set of atoms. Atomic masses of the Atoms are used.
  • createVirtualCBAtom
    creates a virtual C-beta atom. this might be needed when working with GLY thanks to Peter Lackner fo
  • getCenterVector
    Returns the Vector that needs to be applied to shift a set of atoms to the Centroid, if the centroid
  • getCentroid
    Returns the centroid of the set of atoms.
  • getCenterVector,
  • getCentroid,
  • getDistanceFast,
  • getTMScore,
  • getTransformation,
  • getTranslationVector,
  • getZYZEuler,
  • invert,
  • isConnected

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now