Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The calculated results are inconsistent with those calculated by amber cpptraj #131

Open
astomer2 opened this issue Jan 9, 2024 · 1 comment

Comments

@astomer2
Copy link

astomer2 commented Jan 9, 2024

Dear Developers, I'm counting multiple different peptides binding to a receptor and analyzing the differences in the contacts they make. Firstly, I used cpptraj to calculate a nativecontacts as a reference, because the results calculated using ContactFrequency could not display their residue numbers separately according to peptides and receptors, causing all the structures to be mixed together, even if I set the query and haystack. But this problem is only inconvenient, not fatal. I compared the results calculated by cpptraj and contact_map and found that the results calculated by cpptraj have more contact residue pairs and the contact frequency is much higher. How do I interpret this result?
My code is as follows:

freq = ContactFrequency(traj, query=ligand, haystack=receptor, cutoff=0.7)
contact_lists = []
freq.residue_contacts.most_common_idx()
for i in range(len(freq.residue_contacts.most_common_idx())):
tup = freq.residue_contacts.most_common_idx()[i]
if tup[1] >0.2:
contact_lists.append(list(tup[0])[1])
set(contact_lists)

and my cpptraj code:
nativatecontacts :1-255&!@h= :256-356&!@h= byresidue distance 7 out nc_by_frame.dat mindist maxdist
resout contact_frac_byres.dat \

Relevant results have been placed in the attachment
contact_frac_byres.txt

contact_map_output.txt

@sroet
Copy link
Collaborator

sroet commented Jan 9, 2024

Dear @astomer2,

First of all, it has been a while since I looked at this code, and secondly I am not familiar with ccptraj, but I will try to help you find some answers:

I compared the results calculated by cpptraj and contact_map and found that the results calculated by cpptraj have more contact residue pairs and the contact frequency is much higher. How do I interpret this result?

From looking at your result, it seems like ccptraj gives the TotalFrac, as a number between 0 and 100, while contactmap gives you a number between 0 and 1. So looking at that it seems like contactmap both gives higher frequencies and way more pairs (if you only look at the entries where TotalFrac is above 20)

I don't know the explicit reasons why these two list differ, but common causes are (in no particular order):

  • different definition of the cutoff (angstrom vs nm, between atoms or centers-of-mass or centers-of-geometry)
  • different definitions of when a contact exists between residues (should 1 atom be within the cutoff or all, or half?)
  • different handling of possible periodic boundary conditions
  • different counting of the residue numbers (are they ordered, do you start at 1, or 0, do you use the loaded labels from the pdb, or generate your own?)

I am also very unsure about the Contacts column of you ccptraj output. It does not seem to mean "number of frames with a contact" as it has no correlation with the TotalFrac column, so my first guess is that there are some mismatches in the definition of "what is a contact between residues"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants