wlsong / PyLipID

A python toolkit for analysing membrane protein-lipid interactions.
https://pylipid.readthedocs.io
MIT License
60 stars 28 forks source link

LipidInteraction not finding the protein #14

Closed ppacak closed 3 years ago

ppacak commented 3 years ago

Hello, I was trying to run your tutorial notebook (0-application-walk-thourgh) on my own CG simulation files (.gro, .xtc) and the script has collected some interactions but with other lipids and not the protein. Number of interacting residues corresponds to the number of protein residues (li.residue_list), but the residues listed are just lipids, that are the first entry listed in my gro file.

Is there a way to input the starting atom/row number for the protein or some other way to identify it?

I would be be grateful for any advice, and maybe a short explanation what some of the variables are: nprot- is it number of proteins present in the system? what role does the resi_offset have?

Thanks

wlsong commented 3 years ago

Hi,

Thanks for using our package. Sorry that I haven't completed the documentation so that many of the variables look confusing. I have provided a no-brainer script at "Mics." (https://pylipid.readthedocs.io/en/latest/mics.html) which could be helpful in understanding the roles of some of the variables.

I don't think the order of protein/lipids should matter as PyLipID (or more specific 'mdtraj') will recognize protein residues. Could you upload your e.g. gro file here so that I can have a look?

Wanling

wlsong commented 3 years ago

Please update PyLipID to the latest version (1.3.13) if you want to use the script provided at "Mics.".

ppacak commented 3 years ago

Hi Wanling,

Thanks for the hint on the mics, I haven't noticed that it has such a good comments section. When I run the no-brainer script, I get the error

 File "mics.py", line 50, in <module>
    fig_close=True)
  File "/anaconda3/envs/pylipid/lib/python3.6/site-packages/pylipid/api/api.py", line 562, in compute_site_koff
    text = self._format_BS_print_info(bs_id, nodes, sort_residue)
  File "/anaconda3/envs/pylipid/lib/python3.6/site-packages/pylipid/api/api.py", line 988, in _format_BS_print_info
    res_stats[Residue_property_book[re.findall("[a-zA-Z]+$", residue)[0]]] += 1
KeyError: 'CHOL' 

Which would be consistent with the fact, that first residue collected as "protein" for analysis is a cholesterol?

Unfortunately, I cannot publish the exact file, but here is another one that also correctly finds the number of residues in the protein, but doesn't identify them correctly from the .gro file (it is not fully suitable for other analysis though, so the errors in no-brainer script are different, but li.residue_list has the same type of outcome).

system.gro.txt

Hope that helps, Paulina

wlsong commented 3 years ago

Hi,

I think the error is complaining no cholesterol was found in your system. I wonder if you have cholesterols in your system. You may want to use PyLipID to find interactions of your specified lipid with the proteins in the system. Based on the topology you offered, your system contains POPC lipids, but no cholesterol. If you want to check POPC interactions, you may want to change the script to lipid='POPC'.

Based on how PyLipID is coded, the order of protein and lipids in your topology shouldn't matter. I hope this makes sense.

Wanling

ppacak commented 3 years ago

Hi,

Sorry if that wasn't clear, but I have tested it with different lipid types, corresponding to what is in different files. However, they were all created in the same manner, and no matter what, I cannot get the right protein residues. notebook

Is there another method to test whether the script really finds the protein?

Best, Paulina

wlsong commented 3 years ago

Hi,

Thanks for pointing that out. I tried to make some changes, could you update to the latest version to see if the error has been fixed? You can use pip install --upgrade PyLipID to upgrade. Let me know if the issue still exists after the upgrade.

Wanling

ppacak commented 3 years ago

Hi again,

It seems to be working now! Thanks for your help!

Paulina

Sfatihi commented 2 years ago

Hi, Is there a way to modify the list of protein residues? I have a modified residue in my system, which is not being picked up by PyLipID as a protein residue.