Ejemplo n.º 1
0
 /**
  * Sets both peptide object that are interconnected by this cross-linker.
  *
  * @param prePeptide - PolyPeptide object of the preAtom.
  * @param postPeptide - PolyPeptide object of the postAtom.
  * @return {@code TRUE} if both peptides contain both cross-linked atoms, {@code FALSE} otherwise.
  */
 public final boolean setPeptides(final PolyPeptide prePeptide, final PolyPeptide postPeptide) {
   for (AminoAcid aa : prePeptide) {
     if (aa.getAllAtoms().contains(this.preAtom)) {
       this.preAtomPeptide = prePeptide;
     }
     if (aa.getAllAtoms().contains(this.postAtom)) {
       this.postAtomPeptide = prePeptide;
     }
   }
   // here the order must be inverse, i.e. first check for post than for
   // pre atom to allow for "self-cross-links". Self-cross-links are
   // cross-links between two identical atom, which is physically
   // incorrect but might be requested over a distance file.
   for (AminoAcid aa : postPeptide) {
     if (aa.getAllAtoms().contains(this.postAtom)) {
       this.postAtomPeptide = postPeptide;
     }
     if (aa.getAllAtoms().contains(this.preAtom)) {
       this.preAtomPeptide = postPeptide;
     }
   }
   if (this.preAtomPeptide != null && this.postAtomPeptide != null) {
     return true;
   }
   return false;
 }
Ejemplo n.º 2
0
  /**
   * Sets to all amino acids atoms in a protein their associated XlogP values.
   *
   * @return float value representing the sum of XlogP values for the protein complex.
   */
  private float setAtomicXlogP() {

    Hashtable<AminoAcidType, Hashtable<AtomType, Float>> xlogPs =
        ParameterReader.getXlogPparameterSet();
    float sum = 0;
    for (PolyPeptide polyPeptide : this.polyPeptideComplex) {
      for (AminoAcid aa : polyPeptide) {
        for (Atom atom : aa.getAllAtoms()) {
          if (!atom.getElement().getSymbol().equals("H")) {
            Hashtable<AtomType, Float> atomicXlogPs = xlogPs.get(aa.getType());
            float xlogP = atomicXlogPs.get(atom.getType());
            atom.setXlogP(xlogP);
            sum += xlogP;
          } else {
            // hydrogen atoms have always a XlogP value of 0.
            atom.setXlogP(0);
          }
        }
      }
    }
    return sum;
  }