GithubHelp home page GithubHelp logo

Comments (5)

jkosinski avatar jkosinski commented on July 28, 2024 1

from imp-sampcon.

jkosinski avatar jkosinski commented on July 28, 2024

@ichem001 if it helps:
I seem to get ambiguity taken into account by the imp-sampcon script if in get_rmsds_matrix of rmsd_calculation.py I replace:

    rmsd = calculator.pairwiseRMSDMatrix()

with

    rmsd = []
    for i in range(len(conforms)-1):
        rmsd.extend(calculator.oneVsFollowing(i))

from imp-sampcon.

ichem001 avatar ichem001 commented on July 28, 2024

@jkosinski

I have tried to reproduce your error but I am not able to reproduce either of the values.

  1. Produce the smallest possible example that shows the error. It does not make sense to debug on a six subunits complex.
  2. Could you run the test_rmsd_calculation.py test and make sure it passes. That test also makes sure you are using the latest version of imp-sampcom.
  3. I cannot reproduce your numbers. I get a RMSD of 76 Å, not of 114 Å.

Let's take it from here to try to understand what the issue is.

from imp-sampcon.

jkosinski avatar jkosinski commented on July 28, 2024

Hi Ilan,

Thanks for looking into this!

  1. Sure, taking your usual structure as an example, building a dimer, and saving two RMF files with identical coordinates but with swapped chains (RMSD should be 0.0 when ambiguity works):
import IMP
import IMP.atom
import IMP.rmf
import IMP.pmi
import IMP.pmi.topology
import RMF
import sys


random_tr3d = IMP.algebra.get_random_local_transformation([0,0,0], 10, 10)


#create two swapped files
for file_i in (0, 1):
    seqs = IMP.pmi.topology.Sequences(IMP.pmi.get_example_path('data/1WCM.fasta'))
    mdl = IMP.Model()
    s = IMP.pmi.topology.System(mdl)
    st = s.create_state()

    #add t
    mol = st.create_molecule("Rpb4", seqs["1WCM:D"], chain_id="D")

    atomic = mol.add_structure(IMP.pmi.get_example_path('data/1WCM_fitted.pdb'),
                        chain_id="D")

    mol.add_representation(
     atomic,
     resolutions=[1])

    clone = mol.create_clone("E")

    hier = s.build()

    if file_i == 0:
        #for the first file, transform the copy 0
        IMP.atom.transform(mol.get_hierarchy(), random_tr3d)
    else:
        #for the second file, transform the copy 1
        IMP.atom.transform(clone.get_hierarchy(), random_tr3d)

    orh = RMF.create_rmf_file('{0}.rmf3'.format(file_i))
    IMP.rmf.add_hierarchy(orh, s.get_hierarchy())
    IMP.rmf.save_frame(orh)
    del orh


#calculate RMSDs

import pyRMSD
from pyRMSD.matrixHandler import MatrixHandler
import scipy
import scipy.spatial
from IMP.sampcon import rmsd_calculation

symmetry = "symm_groups.txt"
with open(symmetry, 'w') as f:
    f.write('Rpb4.0 Rpb4.1')

###########################################
#  reproducing what imp-exhaust is doing: #
###########################################

(ps, masses, radii,
 conforms, symm_groups, models_name,
 n_models) = rmsd_calculation.get_rmfs_coordinates_one_rmf(
     "./",
     '0.rmf3',
     '1.rmf3',
     None,
     symmetry)

rmsd_calculation.get_rmsds_matrix(  # noqa
    conforms, 'cpu_omp', False, 2, symm_groups)

mHandler = MatrixHandler()
mHandler.loadMatrix("Distances_Matrix.data")

rmsd_matrix = mHandler.getMatrix()
distmat = rmsd_matrix.get_data()

distmat_full = scipy.spatial.distance.squareform(distmat)
print('RMSD from get_rmsds_matrix', distmat_full[0,1]) #this should be 0.0 Angstrom but is not !

###############################
# let's try differently then: #
###############################

calculator = pyRMSD.RMSDCalculator.RMSDCalculator(
  'NOSUP_OMP_CALCULATOR',
  fittingCoordsets=conforms,
  calcSymmetryGroups=symm_groups,
  fitSymmetryGroups=symm_groups)

rmsd = calculator.oneVsFollowing(0)[0]
print('RMSD from calculator.oneVsFollowing(0)', rmsd) # now it works, is 0.0 Angstrom !

#but rmsd from pairwiseRMSDMatrix() is still wrong!:
print('RMSD from calculator.pairwiseRMSDMatrix',calculator.pairwiseRMSDMatrix()[0])

###############################
# let's try without ambiguity: #
###############################
calculator = pyRMSD.RMSDCalculator.RMSDCalculator(
  'NOSUP_OMP_CALCULATOR',
  fittingCoordsets=conforms)

rmsd = calculator.oneVsFollowing(0)[0]
print('RMSD from calculator.oneVsFollowing(0) WITHOUT AMBUIGUITY', rmsd) # without ambiguity, the same value as from get_rmsds_matrix!

#but rmsd from pairwiseRMSDMatrix() is still wrong!:
print('RMSD from calculator.oneVsFollowing(0) WITHOUT AMBUIGUITY', calculator.pairwiseRMSDMatrix()[0]) # same here
  1. Yes, passes.
  2. Hmm, strange, I think Shruthi said she could reproduce. Still, with ambiguity should be much lower than 76A.

from imp-sampcon.

shruthivis avatar shruthivis commented on July 28, 2024

With the previous version of Jan's script pyRMSD_bug.zip
I could reproduce the numbers 2 A and 114 A. Looks like the script changed to include a selection.

from imp-sampcon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.