diff --git a/lintools/analysis/__init__.pyc b/lintools/analysis/__init__.pyc deleted file mode 100644 index d807572..0000000 Binary files a/lintools/analysis/__init__.pyc and /dev/null differ diff --git a/lintools/analysis/hbonds.pyc b/lintools/analysis/hbonds.pyc deleted file mode 100644 index 94594e0..0000000 Binary files a/lintools/analysis/hbonds.pyc and /dev/null differ diff --git a/lintools/analysis/residence_time.pyc b/lintools/analysis/residence_time.pyc deleted file mode 100644 index dc7822d..0000000 Binary files a/lintools/analysis/residence_time.pyc and /dev/null differ diff --git a/lintools/data.pyc b/lintools/data.pyc deleted file mode 100644 index 85c3aa2..0000000 Binary files a/lintools/data.pyc and /dev/null differ diff --git a/lintools/figure.pyc b/lintools/figure.pyc deleted file mode 100644 index 6bb977f..0000000 Binary files a/lintools/figure.pyc and /dev/null differ diff --git a/lintools/lintools.py b/lintools/lintools.py index 21e2ed7..34c77ce 100755 --- a/lintools/lintools.py +++ b/lintools/lintools.py @@ -1,4 +1,3 @@ - from argparse import ArgumentParser import os import shutil @@ -38,13 +37,12 @@ class Lintools(object): * end_frame * - end frame(s) for trajectory analysis (can be different for each trajectory) * skip * - number of frames to skip (can be different for each trajectory) * analysis_cutoff * - a fraction of time a residue has to fullfil the analysis parameters for (default - 0.3) - * sasa * - set this to 1 to turn on solvent accessible surface area calculation (currently only works across whole trajectory) * diagram_type * - string of the selected diagram type (e.g. "amino" or "clocks") * output_name * - name of the folder with results and the final SVG file """ - __version__ = "06.2018" - def __init__(self,topology,trajectory,mol_file,ligand,offset,cutoff,start_frame,end_frame,skip,analysis_cutoff,sasa,diagram_type,output_name,cfg): + __version__ = "09.2016" + def __init__(self,topology,trajectory,mol_file,ligand,offset,cutoff,start_frame,end_frame,skip,analysis_cutoff,diagram_type,output_name,cfg): """Defines the input variables.""" self.topology = os.path.abspath(topology) try: @@ -69,7 +67,6 @@ def __init__(self,topology,trajectory,mol_file,ligand,offset,cutoff,start_frame, self.end = end_frame self.skip = skip self.analysis_cutoff = analysis_cutoff - self.sasa = sasa self.diagram_type = diagram_type self.output_name = output_name def data_input_and_res_time_analysis(self): @@ -93,17 +90,16 @@ def analysis_of_prot_lig_interactions(self): """ self.hbonds = HBonds(self.topol_data,self.trajectory,self.start,self.end,self.skip,self.analysis_cutoff,distance=3) self.pistacking = PiStacking(self.topol_data,self.trajectory,self.start,self.end,self.skip, self.analysis_cutoff) - if self.sasa==1: - self.sasa = SASA(self.topol_data,self.trajectory) + self.sasa = SASA(self.topol_data,self.trajectory) self.lig_descr = LigDescr(self.topol_data) if self.trajectory!=[]: self.rmsf = RMSF_measurements(self.topol_data,self.topology,self.trajectory,self.ligand,self.start,self.end,self.skip) self.salt_bridges = SaltBridges(self.topol_data,self.trajectory,self.lig_descr,self.start,self.end,self.skip,self.analysis_cutoff) - def plot_residues(self): + def plot_residues(self, colormap): """ Calls Plot() that plots the residues with the required diagram_type. """ - self.plots = Plots(self.topol_data,self.diagram_type) + self.plots = Plots(self.topol_data, self.diagram_type, colormap) def draw_figure(self,data_for_color=None, data_for_size=None, data_for_clouds=None, rot_bonds=None, color_for_clouds="Blues", color_type_color="viridis"): """ Draws molecule through Molecule() and then puts the final figure together with @@ -149,7 +145,6 @@ def write_config_file(self, cfg): 'offset': self.offset, 'distance cutoff': self.cutoff, 'analysis cutoff': self.analysis_cutoff, - 'sasa': self.sasa, 'diagram type': self.diagram_type, 'output name': self.output_name}, 'representation':{ @@ -173,7 +168,6 @@ def remove_files(self): if os.path.isfile(f)==True: os.remove(f) - if __name__ == '__main__': ################################################################################################################# @@ -188,16 +182,13 @@ def remove_files(self): parser.add_argument('-o', '--outname', dest = "output_name", help='Name for output folder and file') parser.add_argument('-c', '--cutoff', dest = "cutoff", default = 3.5, help='Cutoff distance in angstroms.') parser.add_argument('-ac', '--analysis_cutoff', dest = "analysis_cutoff", default=0.3, help='Analysis cutoff - a feature has to appear for at least a fraction of the simulation to be plotted.') - parser.add_argument('-sasa', '--sasa', dest = "sasa", default = 0, help='Perform solvent accessible surface area (sasa) calculation') args = parser.parse_args() #################################################################################################################### - - if args.config!=None: - #If config file exists, args.will be ingnored + #If config file exists, args.will be ignored print "#####################################################################" print "WARNING" print "The arguments from command line will be ignored," @@ -209,7 +200,7 @@ def remove_files(self): cfg = yaml.load(ymlfile) ## Check config file input - mainly topology and output file, also handling bad input - lintools = Lintools(cfg['input']['topology'],cfg['input']['trajectory'],cfg['input']['mol file'],cfg['input']['ligand'],cfg['input']['offset'],float(cfg['input']['distance cutoff']),cfg['input']['traj start'],cfg['input']['traj end'],cfg['input']['traj skip'],cfg['input']['analysis cutoff'],cfg['input']['sasa'],cfg['input']['diagram type'],cfg['input']['output name'],cfg=True) + lintools = Lintools(cfg['input']['topology'],cfg['input']['trajectory'],cfg['input']['mol file'],cfg['input']['ligand'],cfg['input']['offset'],float(cfg['input']['distance cutoff']),cfg['input']['traj start'],cfg['input']['traj end'],cfg['input']['traj skip'],cfg['input']['analysis cutoff'],cfg['input']['diagram type'],cfg['input']['output name'],cfg=True) lintools.save_files() lintools.data_input_and_res_time_analysis() lintools.analysis_of_prot_lig_interactions() @@ -281,7 +272,7 @@ def find_diagram_type(): ligand_name = find_ligand_name() diagram_type = find_diagram_type() - lintools = Lintools(args.topology,args.trajectory,None,ligand_name,0,args.cutoff,args.start_frame,args.end_frame,args.skip,float(args.analysis_cutoff),args.sasa,diagram_type,args.output_name,cfg=False) + lintools = Lintools(args.topology,args.trajectory,None,ligand_name,0,args.cutoff,args.start_frame,args.end_frame,args.skip,float(args.analysis_cutoff),diagram_type,args.output_name,cfg=False) lintools.save_files() lintools.data_input_and_res_time_analysis() lintools.analysis_of_prot_lig_interactions() diff --git a/lintools/molecule.pyc b/lintools/molecule.pyc deleted file mode 100644 index 06070e4..0000000 Binary files a/lintools/molecule.pyc and /dev/null differ diff --git a/lintools/plots.py b/lintools/plots.py index 5a10585..72881b5 100755 --- a/lintools/plots.py +++ b/lintools/plots.py @@ -4,7 +4,6 @@ from matplotlib import pylab import numpy - class Plots(object): """ This module plots the residue data. @@ -23,21 +22,28 @@ class Plots(object): """ __version__ = "09.2016" matplotlib.rcParams['svg.fonttype'] = 'none' - matplotlib.rcParams['font.weight']=900 + matplotlib.rcParams['font.weight'] = 900 matplotlib.rcParams['text.usetex'] = False matplotlib.rcParams['patch.linewidth'] = 0 - def __init__(self, topology_data_object,diagram_type,colormap='summer'): + def __init__(self, topology_data_object, diagram_type, colormap='summer'): self.topology_data = topology_data_object - self.colors_amino_acids = {"acidic":"#D9774B", "basic":"#889DCC", - "aromatic":"#9FC74A", "polar":"#D06AC1", - "hydrophobic":"#6AC297","lipids":"#ffff99", - "water":"turquoise","ions":"gold"} - self.amino_acids = {"ASP":"acidic","GLU":"acidic","LYS":"basic","ARG":"basic", - "PHE":"aromatic","TYR":"aromatic","TRP":"aromatic","SER":"polar", - "THR":"polar","ASN":"polar","GLN":"polar","CYS":"polar", - "HIS":"polar","ALA":"hydrophobic","VAL":"hydrophobic", - "ILE":"hydrophobic","LEU":"hydrophobic","MET":"hydrophobic","GLY":"hydrophobic","PRO":"hydrophobic", - "PC":"lipids","HOH":"water","SOL":"water"} + self.colors_amino_acids = {"acidic": "#D9774B", "basic": "#889DCC", + "aromatic": "#9FC74A", "polar": "#D06AC1", + "hydrophobic": "#6AC297", + "lipids": "#ffff99", "water": "turquoise", + "ions": "gold"} + self.amino_acids = {"ASP": "acidic","GLU": "acidic","LYS": "basic", + "ARG": "basic", "PHE": "aromatic", + "TYR": "aromatic", "TRP": "aromatic", + "SER": "polar", "THR": "polar", "ASN": "polar", + "GLN": "polar", "CYS": "polar", "HIS": "polar", + "ALA": "hydrophobic", "VAL": "hydrophobic", + "ILE": "hydrophobic", "LEU": "hydrophobic", + "MET": "hydrophobic", "GLY": "hydrophobic", + "PRO": "hydrophobic", "PC": "lipids", + "HOH": "water", "SOL": "water"} + # Let's try to fix this so that default config works + self.colormap = colormap if diagram_type == "amino": self.plot_amino_diagrams() if diagram_type == "domains": diff --git a/lintools/plots.pyc b/lintools/plots.pyc deleted file mode 100644 index 7056e6a..0000000 Binary files a/lintools/plots.pyc and /dev/null differ