'Unexpected keyword argument in python

I am trying to run python script for computing lipid interactions. The python script is downloaded from: https://pylipid.readthedocs.io/en/master/demo.html

When I run the script, the following error keeps popping up.

###########################

TypeError: compute_residue_koff() got an unexpected keyword argument 'fig_format'

###########################

I have highlighted the error line with BOLD in the script pasted below.

Following is the code:

import numpy as np

import matplotlib.pyplot as plt 

from pylipid.api import LipidInteraction

from pylipid.util import check_dir


trajfile_list = ["input.xtc"]

topfile_list = ["input.gro"]  

dt_traj = None  

stride = 1   

lipid = "CHOL"   

lipid_atoms = None  

cutoffs = [0.5, 0.8] 

nprot = 1   

binding_site_size = 4  

n_top_poses = 3     

n_clusters = "auto"  

save_dir = None  

save_pose_format = "gro"  

save_pose_traj = True  
                       
save_pose_traj_format = "xtc"  

timeunit = "us"  

resi_offset = 0  

radii = None  

pdb_file_to_map = None   
                         
fig_format = "pdf"  

num_cpus = None  
                 

#### calculate lipid interactions
li = LipidInteraction(trajfile_list, topfile_list=topfile_list, 

cutoffs=cutoffs, lipid=lipid, lipid_atoms=lipid_atoms, nprot=1, 

resi_offset=resi_offset, timeunit=timeunit, save_dir=save_dir, 

stride=stride, dt_traj=dt_traj)

li.collect_residue_contacts()

li.compute_residue_duration(residue_id=None)

li.compute_residue_occupancy(residue_id=None)

li.compute_residue_lipidcount(residue_id=None)

li.show_stats_per_traj(write_log=True, print_log=True)

li.compute_residue_koff(residue_id=None, plot_data=True, 

fig_close=True, fig_format=fig_format, num_cpus=num_cpus)

li.compute_binding_nodes(threshold=binding_site_size, 

print_data=False)

if len(li.node_list) == 0:

    
else:

    li.compute_site_duration(binding_site_id=None)

    li.compute_site_occupancy(binding_site_id=None)

    li.compute_site_lipidcount(binding_site_id=None) 

    li.compute_site_koff(binding_site_id=None, plot_data=True, 

fig_close=True, fig_format=fig_format, num_cpus=num_cpus) 

    pose_traj, pose_rmsd_data = 

li.analyze_bound_poses(binding_site_id=None,pose_format=save_pose_format,                                               

n_top_poses=n_top_poses, n_clusters=n_clusters,

 fig_format=fig_format, num_cpus=num_cpus)

#########################################################################################

Any help would be highly appreciated.

Thanks in advance !!!



Solution 1:[1]

I also installed the pylipid(version 1.5.0) and I met the same problem when running the demo code. So I checked the api.py of "pylipid" package and found that the functions in the "####calculate lipid interactions" of demo code didn't have parameters "fig_format". Maybe delete the "fig_format = fig_format" input in the "####calculate lipid interactions" can be helpful.

Solution 2:[2]

The pylipid source code shows this argument was added in 1.5.10, so you need to be on at least that version.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 botu
Solution 2 Jacob Walls