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

Unittest structure similarity #14

Merged
merged 26 commits into from
Nov 27, 2019
Merged

Conversation

CunliangGeng
Copy link
Member

@CunliangGeng CunliangGeng commented Nov 11, 2019

  • update and fix bugs in StuctureSimilarity.py
  • add thorough unittests for StructureSimilarity.py

Note: This PR contains #11, #13.

Copy link
Member

@NicoRenaud NicoRenaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it s a bit hard to disentanlge all the PR. That's mainly my fault since I have not so much time to review them. an you review PR13 and then we'' ldeal with that one

@@ -252,34 +238,27 @@ def compute_irmsd_fast(self,izone=None,method='svd',cutoff=10,check=True):
# read the izone file
if izone is None:
resData = self.compute_izone(cutoff,save_file=False)
elif not os.path.isfile(izone):
resData = self.compute_izone(cutoff,save_file=True,filename=izone)
# elif not os.path.isfile(izone):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why comment that ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

izone is used as both input file and output file, which is not unique. I left a TODO comment around that to add output file to the function.

data_decoy_long, data_decoy_short = self.get_data_zone_backbone(self.decoy,resData,return_not_in_zone=True)
data_ref_long, data_ref_short = self.get_data_zone_backbone(self.ref,resData,return_not_in_zone=True)

atom_long = data_ref_long.intersection(data_decoy_long)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this intersection stuff does all the work ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets the common residues or atoms and ignore missing ones. It's actually checking if the sequences are consistent or not, but it cannot fix it if not consistent(even the former code cannot do this).



def compute_izone(self,cutoff=5.0,save_file=True,filename=None):
def compute_izone(self,cutoff=10.0,save_file=True,filename=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why a cutoff of 10 now ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be 10Å for iRMSD and 5Å for FNAT.
It's a bug but fine, the code invoking it resets the cutoff to 10.

# create the sql
sql_decoy = pdb2sql(self.decoy,sqlfile='decoy.db')
sql_ref = pdb2sql(self.ref,sqlfile='ref.db')

# extract the pos of chains A
xyz_decoy_A = np.array(sql_decoy.get('x,y,z',chainID='A'))
xyz_ref_A = np.array(sql_ref.get('x,y,z',chainID='A'))
xyz_decoy_A = np.array(sql_decoy.get('x,y,z',chainID='A', name=backbone))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only backbone ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only backbone is needed in L-RMSD calculation, for both fitting and rmsd calculation. Here is the original reference https://doi.org/10.1002/prot.10393.

@CunliangGeng CunliangGeng merged commit fd5f96f into master Nov 27, 2019
@CunliangGeng CunliangGeng deleted the unittest_StructureSimilarity branch November 27, 2019 08:38
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

Successfully merging this pull request may close these issues.

None yet

2 participants