Skip to content

Commit

Permalink
Fix citation, logging in libraries.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gitesei committed Nov 5, 2024
1 parent d287968 commit 7b6b5f4
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 47 deletions.
18 changes: 10 additions & 8 deletions FRETpredict/FRET.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ def __init__(self, protein, residues, **kwargs):

# Logging set up
if self.verbose:
logging.basicConfig(filename=kwargs.get('log_file', 'log'), level=logging.INFO)
else:
logging.basicConfig(filename=kwargs.get('log_file', 'log'), level=logging.DEBUG)
logging.root.setLevel(logging.DEBUG)
else:
logging.basicConfig(filename=kwargs.get('log_file', 'log'), level=logging.INFO)
logging.root.setLevel(logging.INFO)

# Write the string for the placement residues selection
for i in range(2):
Expand All @@ -167,7 +169,7 @@ def __init__(self, protein, residues, **kwargs):
residue_sel += " and segid {:s}".format(self.chains[i])

# Logging information on the selected residues
logging.info('{:s} = {:s}'.format(residue_sel, self.protein.select_atoms(residue_sel).atoms.resnames[0]))
logging.debug('{:s} = {:s}'.format(residue_sel, self.protein.select_atoms(residue_sel).atoms.resnames[0]))

# Raise error if the specified placement residues are different from two
if len(residues) != 2:
Expand Down Expand Up @@ -337,7 +339,7 @@ def trajectoryAnalysis(self):
"""

# Print info
logging.info("Starting rotamer distance analysis of trajectory {:s} with labeled residues "
logging.debug("Starting rotamer distance analysis of trajectory {:s} with labeled residues "
"{:d} and {:d}".format(self.protein.trajectory.filename, self.residues[0], self.residues[1]))

# Create H5PY file
Expand Down Expand Up @@ -511,7 +513,7 @@ def save(self, **kwargs):
if self.weights.size != k2.size:

# Warning log
logging.info('Weights array has size {} whereas the number of frames is {}'.
logging.debug('Weights array has size {} whereas the number of frames is {}'.
format(self.weights.size, k2.size))

# Raise error
Expand All @@ -534,7 +536,7 @@ def save(self, **kwargs):
if self.user_weights.size != k2.size:

# Warning log
logging.info('User weights array has size {} whereas the number of frames is {}'.
logging.debug('User weights array has size {} whereas the number of frames is {}'.
format(self.user_weights.size, k2.size))

# Raise error
Expand All @@ -553,7 +555,7 @@ def save(self, **kwargs):
else:

# Warning log
logging.info('User weights argument should be a numpy array')
logging.debug('User weights argument should be a numpy array')

# Raise error
raise ValueError('User weights argument should be a numpy array')
Expand Down Expand Up @@ -647,4 +649,4 @@ def run(self):
# Calculate k2 distribution and k2, Static, Dynamic1, Dynamic2 averaging. Save data to file.
self.save()

logging.info('Done')
logging.debug('Done')
2 changes: 1 addition & 1 deletion FRETpredict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
from .lennardjones import lj_parameters
from .libraries import *

__version__ = '0.2.2'
__version__ = '0.2.7'


60 changes: 30 additions & 30 deletions FRETpredict/lib/libraries.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ATTO 390 C2R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T39_C2R_cutoff30
licence: GPLv3
mu:
Expand All @@ -12,7 +12,7 @@ ATTO 390 C2R:
- C7 and resname T39
ATTO 390 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T39_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -24,7 +24,7 @@ ATTO 390 L1R:
- C7 and resname T39
ATTO 425 C2R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T42_C2R_cutoff30
licence: GPLv3
mu:
Expand All @@ -36,7 +36,7 @@ ATTO 425 C2R:
- C7 and resname T42
ATTO 425 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T42_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -48,7 +48,7 @@ ATTO 425 L1R:
- C7 and resname T42
ATTO 465 C2R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T46_C2R_cutoff30
licence: GPLv3
mu:
Expand All @@ -63,7 +63,7 @@ ATTO 465 C2R:
- N1 and resname T46
ATTO 465 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T46_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -78,7 +78,7 @@ ATTO 465 L1R:
- N1 and resname T46
ATTO 488 C3R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T48_C3R_cutoff30
licence: GPLv3
mu:
Expand All @@ -94,7 +94,7 @@ ATTO 488 C3R:
- C15 and resname T48
ATTO 495 C2R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T49_C2R_cutoff30
licence: GPLv3
mu:
Expand All @@ -107,7 +107,7 @@ ATTO 495 C2R:
- N1 and resname T49
ATTO 495 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T49_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -120,7 +120,7 @@ ATTO 495 L1R:
- N1 and resname T49
ATTO 520 C2R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T52_C2R_cutoff30
licence: GPLv3
mu:
Expand All @@ -134,7 +134,7 @@ ATTO 520 C2R:
- C7 and resname T52
ATTO 520 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T52_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -148,7 +148,7 @@ ATTO 520 L1R:
- C7 and resname T52
ATTO 610 C2R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T61_C2R_cutoff30
licence: GPLv3
mu:
Expand All @@ -162,7 +162,7 @@ ATTO 610 C2R:
- C8 and resname T61
ATTO 610 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: T61_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -176,7 +176,7 @@ ATTO 610 L1R:
- C8 and resname T61
ATTO Thio12 C3R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: Tth_C3R_cutoff30
licence: GPLv3
mu:
Expand All @@ -190,7 +190,7 @@ ATTO Thio12 C3R:
- C9 and resname Tth
AlexaFluor 350 C1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A35_C1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -204,7 +204,7 @@ AlexaFluor 350 C1R:
- C5 and resname A35
AlexaFluor 350 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A35_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -218,7 +218,7 @@ AlexaFluor 350 L1R:
- C5 and resname A35
AlexaFluor 488 B1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A48_B1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -235,7 +235,7 @@ AlexaFluor 488 B1R:
- C7 and resname A48
AlexaFluor 488 C1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A48_C1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -252,7 +252,7 @@ AlexaFluor 488 C1R:
- C7 and resname A48
AlexaFluor 488 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A48_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -269,7 +269,7 @@ AlexaFluor 488 L1R:
- C7 and resname A48
AlexaFluor 532 C1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A53_C1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -285,7 +285,7 @@ AlexaFluor 532 C1R:
- C7 and resname A53
AlexaFluor 532 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A53_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -301,7 +301,7 @@ AlexaFluor 532 L1R:
- C7 and resname A53
AlexaFluor 568 C1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A56_C1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -318,7 +318,7 @@ AlexaFluor 568 C1R:
- C10 and resname A56
AlexaFluor 568 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A56_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -335,7 +335,7 @@ AlexaFluor 568 L1R:
- C10 and resname A56
AlexaFluor 594 C1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A59_C1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -352,7 +352,7 @@ AlexaFluor 594 C1R:
- C10 and resname A59
AlexaFluor 594 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A59_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -369,7 +369,7 @@ AlexaFluor 594 L1R:
- C10 and resname A59
AlexaFluor 647 C2R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A64_C2R_cutoff30
licence: GPLv3
mu:
Expand All @@ -387,7 +387,7 @@ AlexaFluor 647 C2R:
- C29 and resname A64
AlexaFluor 647 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: A64_L1R_cutoff30
licence: GPLv3
mu:
Expand Down Expand Up @@ -466,7 +466,7 @@ Lumiprobe Cy5 C2R:
- CX3
Lumiprobe Cy5.5 C2R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: C55_C2R_cutoff30
licence: GPLv3
mu:
Expand All @@ -480,7 +480,7 @@ Lumiprobe Cy5.5 C2R:
- C39 and resname C55
Lumiprobe Cy5.5 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: C55_L1R_cutoff30
licence: GPLv3
mu:
Expand All @@ -494,7 +494,7 @@ Lumiprobe Cy5.5 L1R:
- C39 and resname C55
Lumiprobe Cy7.5 L1R:
author: D Montepietra, G Tesei, JM Martins, MBA Kunze, RB Best, K Lindorff-Larsen
citation: TBD
citation: https://doi.org/10.1038/s42003-024-05910-6
filename: C75_L1R_cutoff30
licence: GPLv3
mu:
Expand Down
15 changes: 7 additions & 8 deletions FRETpredict/libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import yaml

# Create logger
logger = logging.getLogger("MDAnalysis.app")
#logger = logging.getLogger("MDAnalysis.app")
#logger.setLevel(logging.DEBUG)
#logger.root.setLevel(logging.DEBUG)

#: Name of the directory in the package that contains the library data.
LIBDIR = "lib"
Expand Down Expand Up @@ -107,17 +109,14 @@ def __init__(self, name):
raise ValueError("No rotamer library with name {0} known: must be one of {1}".format(
name, list(LIBRARIES.keys())))

# Print logging information
logger.info("Using rotamer library '{0}' by {1[author]}".format(self.name, self.lib))
logger.info("Please cite: {0[citation]}".format(self.lib))

# Obtain filename path
self.lib['filename'] = find_file(self.lib['filename'][:-2] + name.split(' cutoff')[1])

# Print logging information
logger.info("[rotamers] ensemble {:s} with topology {:s}.pdb".format(self.lib['filename'],
self.lib['filename'].split('_cutoff')[0]))
logger.info("[rotamers] populations {:s}".format(self.lib['filename'] + '_weights.txt'))
#logger.debug("Using rotamer library '{0}' by {1[author]}".format(self.name, self.lib))
#logger.debug("Please cite: {0[citation]}".format(self.lib))
#logger.debug("[rotamers] ensemble {:s} with topology {:s}.pdb".format(self.lib['filename'],self.lib['filename'].split('_cutoff')[0]))
#logger.debug("[rotamers] populations {:s}".format(self.lib['filename'] + '_weights.txt'))

# If trajectory is not found
if not os.path.isfile(self.lib['filename'] + '.dcd'):
Expand Down

0 comments on commit 7b6b5f4

Please sign in to comment.