mailRe: [bug #21959] cpmg_analysis


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on April 24, 2014 - 13:44:
Hi,

Could you check that the file C:\relax-3.1.7\lib\list.py exists?
Also, what do you see from the output of running 'relax -i'?

Regards,

Edward



On 24 April 2014 13:00,  <mengjun.xue@xxxxxxxxxxxxxxxxxxxx> wrote:
Hi Edward,

I have tried it again, modify the data path to DATA_PATH =
'C:\Relax-3.1.7\\test_suite\shared_data\dispersion\Hansen', and copy the
cpmg_analysis.py to
C:\Relax-3.1.7\\test_suite\shared_data\dispersion\Hansen, and run the
script:




                                  relax 3.1.7

                    Molecular dynamics by NMR data analysis

                   Copyright (C) 2001-2006 Edward d'Auvergne
              Copyright (C) 2006-2014 the relax development team

This is free software which you are welcome to modify and redistribute under
the conditions of the GNU General Public License (GPL).  This program,
including all modules, is licensed under the GPL and comes with absolutely
no
warranty.  For details type 'GPL' within the relax prompt.

Assistance in using the relax prompt and scripting interface can be accessed
by
typing 'help' within the prompt.

Processor fabric:  Uni-processor.

script =
'C:\\relax-3.1.7\\test_suite\\shared_data\\dispersion\\Hansen\\cpmg_analysis.py'

----------------------------------------------------------------------------------------------------
###############################################################################
#
#
# Copyright (C) 2013 Edward d'Auvergne
#
#
#
# This file is part of the program relax (http://www.nmr-relax.com).
#
#
#
# This program is free software: you can redistribute it and/or modify
#
# it under the terms of the GNU General Public License as published by
#
# the Free Software Foundation, either version 3 of the License, or
#
# (at your option) any later version.
#
#
#
# This program is distributed in the hope that it will be useful,
#
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#
# GNU General Public License for more details.
#
#
#
# You should have received a copy of the GNU General Public License
#
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#
#
###############################################################################

"""Script for performing a full relaxation dispersion analysis using
CPMG-type data."""


# Python module imports.
from os import sep

# relax module imports.
from auto_analyses.relax_disp import Relax_disp


# Analysis variables.
#####################

# The dispersion models.
MODELS = ['R2eff', 'No Rex', 'CR72', 'NS CPMG 2-site expanded']

# The grid search size (the number of increments per dimension).
GRID_INC = 11

# The number of Monte Carlo simulations to be used for error analysis at the
end of the analysis.
MC_NUM = 500

# A flag which if True will activate Monte Carlo simulations for all models.
Note this will hugely increase the computation time.
MC_SIM_ALL_MODELS = False

# The results directory.
RESULTS_DIR = '.'

# The directory of results of an earlier analysis without clustering.
PRE_RUN_DIR = None

# The model selection technique to use.
MODSEL = 'AIC'

# The flag for only using numeric models in the final model selection.
NUMERIC_ONLY = False

# The R2eff value in rad/s by which to judge insignificance.  If the maximum
difference between two points on all dispersion curves for a spin is less
than this value, that spin will be deselected.
INSIGNIFICANCE = 1.0



# Set up the data pipe.
#######################

# The path to the data files.
DATA_PATH = 'C:\Relax-3.1.7\\test_suite\shared_data\dispersion\Hansen'


# Create the data pipe.
pipe_name = 'base pipe'
pipe_bundle = 'relax_disp'
pipe.create(pipe_name=pipe_name, bundle=pipe_bundle, pipe_type='relax_disp')

# Load the sequence.
sequence.read('fake_sequence.in', dir=DATA_PATH, res_num_col=1,
res_name_col=2)

# Name the spins so they can be matched to the assignments, and the isotope
for field strength scaling.
spin.name(name='N')
spin.isotope(isotope='15N')

# The spectral data - spectrum ID, peak list file name, CPMG frequency (Hz),
spectrometer frequency in Hertz.
data = [
    ['500_reference.in',    '500_MHz'+sep+'reference.in_sparky',
None,  500e6],
    ['500_66.667.in',       '500_MHz'+sep+'66.667.in_sparky',
66.6666,  500e6],
    ['500_133.33.in',       '500_MHz'+sep+'133.33.in_sparky',
133.3333,  500e6],
    ['500_133.33.in.bis',   '500_MHz'+sep+'133.33.in.bis_sparky',
133.3333,  500e6],
    ['500_200.in',          '500_MHz'+sep+'200.in_sparky',
200.0000,  500e6],
    ['500_266.67.in',       '500_MHz'+sep+'266.67.in_sparky',
266.6666,  500e6],
    ['500_333.33.in',       '500_MHz'+sep+'333.33.in_sparky',
333.3333,  500e6],
    ['500_400.in',          '500_MHz'+sep+'400.in_sparky',
400.0000,  500e6],
    ['500_466.67.in',       '500_MHz'+sep+'466.67.in_sparky',
466.6666,  500e6],
    ['500_533.33.in',       '500_MHz'+sep+'533.33.in_sparky',
533.3333,  500e6],
    ['500_533.33.in.bis',   '500_MHz'+sep+'533.33.in.bis_sparky',
533.3333,  500e6],
    ['500_600.in',          '500_MHz'+sep+'600.in_sparky',
600.0000,  500e6],
    ['500_666.67.in',       '500_MHz'+sep+'666.67.in_sparky',
666.6666,  500e6],
    ['500_733.33.in',       '500_MHz'+sep+'733.33.in_sparky',
733.3333,  500e6],
    ['500_800.in',          '500_MHz'+sep+'800.in_sparky',
800.0000,  500e6],
    ['500_866.67.in',       '500_MHz'+sep+'866.67.in_sparky',
866.6666,  500e6],
    ['500_933.33.in',       '500_MHz'+sep+'933.33.in_sparky',
933.3333,  500e6],
    ['500_933.33.in.bis',   '500_MHz'+sep+'933.33.in.bis_sparky',
933.3333,  500e6],
    ['500_1000.in',         '500_MHz'+sep+'1000.in_sparky',
1000.0000,  500e6],
    ['800_reference.in',    '800_MHz'+sep+'reference.in_sparky',
None,  800e6],
    ['800_66.667.in',       '800_MHz'+sep+'66.667.in_sparky',
66.6666,  800e6],
    ['800_133.33.in',       '800_MHz'+sep+'133.33.in_sparky',
133.3333,  800e6],
    ['800_133.33.in.bis',   '800_MHz'+sep+'133.33.in.bis_sparky',
133.3333,  800e6],
    ['800_200.in',          '800_MHz'+sep+'200.in_sparky',
200.0000,  800e6],
    ['800_266.67.in',       '800_MHz'+sep+'266.67.in_sparky',
266.6666,  800e6],
    ['800_333.33.in',       '800_MHz'+sep+'333.33.in_sparky',
333.3333,  800e6],
    ['800_400.in',          '800_MHz'+sep+'400.in_sparky',
400.0000,  800e6],
    ['800_466.67.in',       '800_MHz'+sep+'466.67.in_sparky',
466.6666,  800e6],
    ['800_533.33.in',       '800_MHz'+sep+'533.33.in_sparky',
533.3333,  800e6],
    ['800_533.33.in.bis',   '800_MHz'+sep+'533.33.in.bis_sparky',
533.3333,  800e6],
    ['800_600.in',          '800_MHz'+sep+'600.in_sparky',
600.0000,  800e6],
    ['800_666.67.in',       '800_MHz'+sep+'666.67.in_sparky',
666.6666,  800e6],
    ['800_733.33.in',       '800_MHz'+sep+'733.33.in_sparky',
733.3333,  800e6],
    ['800_800.in',          '800_MHz'+sep+'800.in_sparky',
800.0000,  800e6],
    ['800_866.67.in',       '800_MHz'+sep+'866.67.in_sparky',
866.6666,  800e6],
    ['800_933.33.in',       '800_MHz'+sep+'933.33.in_sparky',
933.3333,  800e6],
    ['800_933.33.in.bis',   '800_MHz'+sep+'933.33.in.bis_sparky',
933.3333,  800e6],
    ['800_1000.in',         '800_MHz'+sep+'1000.in_sparky',
1000.0000,  800e6]
]

# Loop over the spectra.
for id, file, cpmg_frq, H_frq in data:
    # Load the peak intensities.
    spectrum.read_intensities(file=file, dir=DATA_PATH, spectrum_id=id,
int_method='height')

    # Set the relaxation dispersion experiment type.
    relax_disp.exp_type(spectrum_id=id, exp_type='SQ CPMG')

    # Set the relaxation dispersion CPMG frequencies.
    relax_disp.cpmg_frq(spectrum_id=id, cpmg_frq=cpmg_frq)

    # Set the NMR field strength of the spectrum.
    spectrometer.frequency(id=id, frq=H_frq)

    # Relaxation dispersion CPMG constant time delay T (in s).
    relax_disp.relax_time(spectrum_id=id, time=0.030)

# Specify the duplicated spectra.
spectrum.replicated(spectrum_ids=['500_133.33.in', '500_133.33.in.bis'])
spectrum.replicated(spectrum_ids=['500_533.33.in', '500_533.33.in.bis'])
spectrum.replicated(spectrum_ids=['500_933.33.in', '500_933.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_133.33.in', '800_133.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_533.33.in', '800_533.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_933.33.in', '800_933.33.in.bis'])

# Peak intensity error analysis.
spectrum.error_analysis(subset=['500_reference.in', '500_66.667.in',
'500_133.33.in', '500_133.33.in.bis', '500_200.in', '500_266.67.in',
'500_333.33.in', '500_400.in', '500_466.67.in', '500_533.33.in',
'500_533.33.in.bis', '500_600.in', '500_666.67.in', '500_733.33.in',
'500_800.in', '500_866.67.in', '500_933.33.in', '500_933.33.in.bis',
'500_1000.in'])
spectrum.error_analysis(subset=['800_reference.in', '800_66.667.in',
'800_133.33.in', '800_133.33.in.bis', '800_200.in', '800_266.67.in',
'800_333.33.in', '800_400.in', '800_466.67.in', '800_533.33.in',
'800_533.33.in.bis', '800_600.in', '800_666.67.in', '800_733.33.in',
'800_800.in', '800_866.67.in', '800_933.33.in', '800_933.33.in.bis',
'800_1000.in'])

# Deselect unresolved spins.
deselect.read(file='unresolved', dir=DATA_PATH+sep+'500_MHz', res_num_col=1)
deselect.read(file='unresolved', dir=DATA_PATH+sep+'800_MHz', res_num_col=1)



# Auto-analysis execution.
##########################

# Do not change!
Relax_disp(pipe_name=pipe_name, pipe_bundle=pipe_bundle,
results_dir=RESULTS_DIR, models=MODELS, grid_inc=GRID_INC,
mc_sim_num=MC_NUM, modsel=MODSEL, pre_run_dir=PRE_RUN_DIR,
insignificance=INSIGNIFICANCE, numeric_only=NUMERIC_ONLY,
mc_sim_all_models=MC_SIM_ALL_MODELS)
----------------------------------------------------------------------------------------------------
debug> Execution lock:  Acquisition by 'script UI' ('script' mode).
debug> Execution lock:  Release by 'script UI' ('script' mode).
Traceback (most recent call last):
  File "multi\processor.py", line 494, in run
    self.callback.init_master(self)
  File "multi\__init__.py", line 318, in default_init_master
    self.master.run()
  File "C:\relax-3.1.7\\relax.py", line 194, in run
    self.interpreter.run(self.script_file)
  File "prompt\interpreter.py", line 275, in run
    return run_script(intro=self.__intro_string, local=locals(),
script_file=script_file, show_script=self.__show_script,
raise_relax_error=self.__raise_relax_error)
  File "prompt\interpreter.py", line 578, in run_script
    return console.interact(intro, local, script_file,
show_script=show_script, raise_relax_error=raise_relax_error)
  File "prompt\interpreter.py", line 477, in interact_script
    exec_script(script_file, local)

  File "prompt\interpreter.py", line 352, in exec_script
    runpy.run_module(module, globals)
  File "C:\Python27\lib\runpy.py", line 180, in run_module
    fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File
"C:\relax-3.1.7\test_suite\shared_data\dispersion\Hansen\cpmg_analysis.py",
line 29, in <module>
    from auto_analyses.relax_disp import Relax_disp
  File "C:\relax-3.1.7\auto_analyses\relax_disp.py", line 33, in <module>
    from lib.list import unique_elements
ImportError: No module named list


When I copy the cpmg_analysis.py to C:\Users\xmj, and run cpmg_anglysis.py:





                                  relax 3.1.7

                    Molecular dynamics by NMR data analysis

                   Copyright (C) 2001-2006 Edward d'Auvergne
              Copyright (C) 2006-2014 the relax development team

This is free software which you are welcome to modify and redistribute under
the conditions of the GNU General Public License (GPL).  This program,
including all modules, is licensed under the GPL and comes with absolutely
no
warranty.  For details type 'GPL' within the relax prompt.

Assistance in using the relax prompt and scripting interface can be accessed
by
typing 'help' within the prompt.

Processor fabric:  Uni-processor.

script = 'C:\\Users\\xmj\\cpmg_analysis.py'

----------------------------------------------------------------------------------------------------
###############################################################################
#
#
# Copyright (C) 2013 Edward d'Auvergne
#
#
#
# This file is part of the program relax (http://www.nmr-relax.com).
#
#
#
# This program is free software: you can redistribute it and/or modify
#
# it under the terms of the GNU General Public License as published by
#
# the Free Software Foundation, either version 3 of the License, or
#
# (at your option) any later version.
#
#
#
# This program is distributed in the hope that it will be useful,
#
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#
# GNU General Public License for more details.
#
#
#
# You should have received a copy of the GNU General Public License
#
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#
#
###############################################################################

"""Script for performing a full relaxation dispersion analysis using
CPMG-type data."""


# Python module imports.
from os import sep

# relax module imports.
from auto_analyses.relax_disp import Relax_disp


# Analysis variables.
#####################

# The dispersion models.
MODELS = ['R2eff', 'No Rex', 'CR72', 'NS CPMG 2-site expanded']

# The grid search size (the number of increments per dimension).
GRID_INC = 11

# The number of Monte Carlo simulations to be used for error analysis at the
end of the analysis.
MC_NUM = 500

# A flag which if True will activate Monte Carlo simulations for all models.
Note this will hugely increase the computation time.
MC_SIM_ALL_MODELS = False

# The results directory.
RESULTS_DIR = '.'

# The directory of results of an earlier analysis without clustering.
PRE_RUN_DIR = None

# The model selection technique to use.
MODSEL = 'AIC'

# The flag for only using numeric models in the final model selection.
NUMERIC_ONLY = False

# The R2eff value in rad/s by which to judge insignificance.  If the maximum
difference between two points on all dispersion curves for a spin is less
than this value, that spin will be deselected.
INSIGNIFICANCE = 1.0



# Set up the data pipe.
#######################

# The path to the data files.
DATA_PATH = 'C:\Relax-3.1.7\\test_suite\shared_data\dispersion\Hansen'


# Create the data pipe.
pipe_name = 'base pipe'
pipe_bundle = 'relax_disp'
pipe.create(pipe_name=pipe_name, bundle=pipe_bundle, pipe_type='relax_disp')

# Load the sequence.
sequence.read('fake_sequence.in', dir=DATA_PATH, res_num_col=1,
res_name_col=2)

# Name the spins so they can be matched to the assignments, and the isotope
for field strength scaling.
spin.name(name='N')
spin.isotope(isotope='15N')

# The spectral data - spectrum ID, peak list file name, CPMG frequency (Hz),
spectrometer frequency in Hertz.
data = [
    ['500_reference.in',    '500_MHz'+sep+'reference.in_sparky',
None,  500e6],
    ['500_66.667.in',       '500_MHz'+sep+'66.667.in_sparky',
66.6666,  500e6],
    ['500_133.33.in',       '500_MHz'+sep+'133.33.in_sparky',
133.3333,  500e6],
    ['500_133.33.in.bis',   '500_MHz'+sep+'133.33.in.bis_sparky',
133.3333,  500e6],
    ['500_200.in',          '500_MHz'+sep+'200.in_sparky',
200.0000,  500e6],
    ['500_266.67.in',       '500_MHz'+sep+'266.67.in_sparky',
266.6666,  500e6],
    ['500_333.33.in',       '500_MHz'+sep+'333.33.in_sparky',
333.3333,  500e6],
    ['500_400.in',          '500_MHz'+sep+'400.in_sparky',
400.0000,  500e6],
    ['500_466.67.in',       '500_MHz'+sep+'466.67.in_sparky',
466.6666,  500e6],
    ['500_533.33.in',       '500_MHz'+sep+'533.33.in_sparky',
533.3333,  500e6],
    ['500_533.33.in.bis',   '500_MHz'+sep+'533.33.in.bis_sparky',
533.3333,  500e6],
    ['500_600.in',          '500_MHz'+sep+'600.in_sparky',
600.0000,  500e6],
    ['500_666.67.in',       '500_MHz'+sep+'666.67.in_sparky',
666.6666,  500e6],
    ['500_733.33.in',       '500_MHz'+sep+'733.33.in_sparky',
733.3333,  500e6],
    ['500_800.in',          '500_MHz'+sep+'800.in_sparky',
800.0000,  500e6],
    ['500_866.67.in',       '500_MHz'+sep+'866.67.in_sparky',
866.6666,  500e6],
    ['500_933.33.in',       '500_MHz'+sep+'933.33.in_sparky',
933.3333,  500e6],
    ['500_933.33.in.bis',   '500_MHz'+sep+'933.33.in.bis_sparky',
933.3333,  500e6],
    ['500_1000.in',         '500_MHz'+sep+'1000.in_sparky',
1000.0000,  500e6],
    ['800_reference.in',    '800_MHz'+sep+'reference.in_sparky',
None,  800e6],
    ['800_66.667.in',       '800_MHz'+sep+'66.667.in_sparky',
66.6666,  800e6],
    ['800_133.33.in',       '800_MHz'+sep+'133.33.in_sparky',
133.3333,  800e6],
    ['800_133.33.in.bis',   '800_MHz'+sep+'133.33.in.bis_sparky',
133.3333,  800e6],
    ['800_200.in',          '800_MHz'+sep+'200.in_sparky',
200.0000,  800e6],
    ['800_266.67.in',       '800_MHz'+sep+'266.67.in_sparky',
266.6666,  800e6],
    ['800_333.33.in',       '800_MHz'+sep+'333.33.in_sparky',
333.3333,  800e6],
    ['800_400.in',          '800_MHz'+sep+'400.in_sparky',
400.0000,  800e6],
    ['800_466.67.in',       '800_MHz'+sep+'466.67.in_sparky',
466.6666,  800e6],
    ['800_533.33.in',       '800_MHz'+sep+'533.33.in_sparky',
533.3333,  800e6],
    ['800_533.33.in.bis',   '800_MHz'+sep+'533.33.in.bis_sparky',
533.3333,  800e6],
    ['800_600.in',          '800_MHz'+sep+'600.in_sparky',
600.0000,  800e6],
    ['800_666.67.in',       '800_MHz'+sep+'666.67.in_sparky',
666.6666,  800e6],
    ['800_733.33.in',       '800_MHz'+sep+'733.33.in_sparky',
733.3333,  800e6],
    ['800_800.in',          '800_MHz'+sep+'800.in_sparky',
800.0000,  800e6],
    ['800_866.67.in',       '800_MHz'+sep+'866.67.in_sparky',
866.6666,  800e6],
    ['800_933.33.in',       '800_MHz'+sep+'933.33.in_sparky',
933.3333,  800e6],
    ['800_933.33.in.bis',   '800_MHz'+sep+'933.33.in.bis_sparky',
933.3333,  800e6],
    ['800_1000.in',         '800_MHz'+sep+'1000.in_sparky',
1000.0000,  800e6]
]

# Loop over the spectra.
for id, file, cpmg_frq, H_frq in data:
    # Load the peak intensities.
    spectrum.read_intensities(file=file, dir=DATA_PATH, spectrum_id=id,
int_method='height')

    # Set the relaxation dispersion experiment type.
    relax_disp.exp_type(spectrum_id=id, exp_type='SQ CPMG')

    # Set the relaxation dispersion CPMG frequencies.
    relax_disp.cpmg_frq(spectrum_id=id, cpmg_frq=cpmg_frq)

    # Set the NMR field strength of the spectrum.
    spectrometer.frequency(id=id, frq=H_frq)

    # Relaxation dispersion CPMG constant time delay T (in s).
    relax_disp.relax_time(spectrum_id=id, time=0.030)

# Specify the duplicated spectra.
spectrum.replicated(spectrum_ids=['500_133.33.in', '500_133.33.in.bis'])
spectrum.replicated(spectrum_ids=['500_533.33.in', '500_533.33.in.bis'])
spectrum.replicated(spectrum_ids=['500_933.33.in', '500_933.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_133.33.in', '800_133.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_533.33.in', '800_533.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_933.33.in', '800_933.33.in.bis'])

# Peak intensity error analysis.
spectrum.error_analysis(subset=['500_reference.in', '500_66.667.in',
'500_133.33.in', '500_133.33.in.bis', '500_200.in', '500_266.67.in',
'500_333.33.in', '500_400.in', '500_466.67.in', '500_533.33.in',
'500_533.33.in.bis', '500_600.in', '500_666.67.in', '500_733.33.in',
'500_800.in', '500_866.67.in', '500_933.33.in', '500_933.33.in.bis',
'500_1000.in'])
spectrum.error_analysis(subset=['800_reference.in', '800_66.667.in',
'800_133.33.in', '800_133.33.in.bis', '800_200.in', '800_266.67.in',
'800_333.33.in', '800_400.in', '800_466.67.in', '800_533.33.in',
'800_533.33.in.bis', '800_600.in', '800_666.67.in', '800_733.33.in',
'800_800.in', '800_866.67.in', '800_933.33.in', '800_933.33.in.bis',
'800_1000.in'])

# Deselect unresolved spins.
deselect.read(file='unresolved', dir=DATA_PATH+sep+'500_MHz', res_num_col=1)
deselect.read(file='unresolved', dir=DATA_PATH+sep+'800_MHz', res_num_col=1)



# Auto-analysis execution.
##########################

# Do not change!
Relax_disp(pipe_name=pipe_name, pipe_bundle=pipe_bundle,
results_dir=RESULTS_DIR, models=MODELS, grid_inc=GRID_INC,
mc_sim_num=MC_NUM, modsel=MODSEL, pre_run_dir=PRE_RUN_DIR,
insignificance=INSIGNIFICANCE, numeric_only=NUMERIC_ONLY,
mc_sim_all_models=MC_SIM_ALL_MODELS)
----------------------------------------------------------------------------------------------------
debug> Execution lock:  Acquisition by 'script UI' ('script' mode).
debug> Execution lock:  Release by 'script UI' ('script' mode).
Traceback (most recent call last):
  File "multi\processor.py", line 494, in run
    self.callback.init_master(self)
  File "multi\__init__.py", line 318, in default_init_master
    self.master.run()
  File "C:\relax-3.1.7\\relax.py", line 194, in run
    self.interpreter.run(self.script_file)
  File "prompt\interpreter.py", line 275, in run
    return run_script(intro=self.__intro_string, local=locals(),
script_file=script_file, show_script=self.__show_script,
raise_relax_error=self.__raise_relax_error)
  File "prompt\interpreter.py", line 578, in run_script
    return console.interact(intro, local, script_file,
show_script=show_script, raise_relax_error=raise_relax_error)
  File "prompt\interpreter.py", line 477, in interact_script
    exec_script(script_file, local)

  File "prompt\interpreter.py", line 352, in exec_script
    runpy.run_module(module, globals)
  File "C:\Python27\lib\runpy.py", line 180, in run_module
    fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\xmj\cpmg_analysis.py", line 29, in <module>
    from auto_analyses.relax_disp import Relax_disp
  File "C:\relax-3.1.7\auto_analyses\relax_disp.py", line 33, in <module>
    from lib.list import unique_elements
ImportError: No module named list




Thank you.

Best regards,

Mengjun

Quoting Edward d'Auvergne <edward@xxxxxxxxxxxxx>:

Hi Mengjun,

I have tried to replicate everything you have done, placing relax
3.1.7 into C:\Program files\Relax-3.1.7, copying the sample script,
and modifying the data path to be 'C:\Program
files\Relax-3.1.7\\test_suite\
shared_data\dispersion\Hansen', but I just cannot reproduce this issue.

One other issue could be that you do not have system administrator
privilages on your system.  In this case, access to the files in
C:\Program files\Relax-3.1.7 will be restricted.  Note that you should
never place scripts or other files into that directory.  Maybe you
could try to copy the sample script into one of your own directories
and try again.

Regards,

Edward



On 23 April 2014 23:25, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:

Hi,

One failure source in Python with paths is sometimes if there is a
space in a file or directory name.  Is it possible to copy the entire
relax-3.1.7 directory to C:\ so it is not in 'Program files', and then
run this again?  I'll look into the relax lib\io.py file tomorrow to
see if that could be a problem.

Cheers,

Edward



On 23 April 2014 21:11,  <mengjun.xue@xxxxxxxxxxxxxxxxxxxx> wrote:

Hi Edward,

I have downloaded relax-3.1.7 again, and copy the new cpmg_analysis.py,
which include # Load the sequence.
sequence.read('fake_sequence.in', dir=DATA_PATH, res_num_col=1,
res_name_col=2), and run again, C:\program files\relax-3.1.7\relax


--debug --tee log_debug cpmg_analysis.py,



still there are some errors, please see the debug file:




                                  relax 3.1.7

                    Molecular dynamics by NMR data analysis

                   Copyright (C) 2001-2006 Edward d'Auvergne
              Copyright (C) 2006-2014 the relax development team

This is free software which you are welcome to modify and redistribute
under
the conditions of the GNU General Public License (GPL).  This program,
including all modules, is licensed under the GPL and comes with
absolutely
no
warranty.  For details type 'GPL' within the relax prompt.

Assistance in using the relax prompt and scripting interface can be
accessed
by
typing 'help' within the prompt.

Processor fabric:  Uni-processor.

script = 'cpmg_analysis.py'

----------------------------------------------------------------------------------------------------

###############################################################################
#
#
# Copyright (C) 2013 Edward d'Auvergne
#
#
#
# This file is part of the program relax (http://www.nmr-relax.com).
#
#
#
# This program is free software: you can redistribute it and/or modify
#
# it under the terms of the GNU General Public License as published by
#
# the Free Software Foundation, either version 3 of the License, or
#
# (at your option) any later version.
#
#
#
# This program is distributed in the hope that it will be useful,
#
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#
# GNU General Public License for more details.
#
#
#
# You should have received a copy of the GNU General Public License
#
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#
#

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

"""Script for performing a full relaxation dispersion analysis using
CPMG-type data."""


# Python module imports.
from os import sep

# relax module imports.
from auto_analyses.relax_disp import Relax_disp


# Analysis variables.
#####################

# The dispersion models.
MODELS = ['R2eff', 'No Rex', 'CR72', 'NS CPMG 2-site expanded']

# The grid search size (the number of increments per dimension).
GRID_INC = 11

# The number of Monte Carlo simulations to be used for error analysis at
the
end of the analysis.
MC_NUM = 500

# A flag which if True will activate Monte Carlo simulations for all
models.
Note this will hugely increase the computation time.
MC_SIM_ALL_MODELS = False

# The results directory.
RESULTS_DIR = '.'

# The directory of results of an earlier analysis without clustering.
PRE_RUN_DIR = None

# The model selection technique to use.
MODSEL = 'AIC'

# The flag for only using numeric models in the final model selection.
NUMERIC_ONLY = False

# The R2eff value in rad/s by which to judge insignificance.  If the
maximum
difference between two points on all dispersion curves for a spin is
less
than this value, that spin will be deselected.
INSIGNIFICANCE = 1.0



# Set up the data pipe.
#######################

# The path to the data files.

DATA_PATH = 'C:\Program
files\Relax-3.1.7\\test_suite\shared_data\dispersion\Hansen'

# Create the data pipe.
pipe_name = 'base pipe'
pipe_bundle = 'relax_disp'
pipe.create(pipe_name=pipe_name, bundle=pipe_bundle,
pipe_type='relax_disp')

# Load the sequence.

sequence.read('fake_sequence.in', dir=DATA_PATH, res_num_col=1,
res_name_col=2)

# Name the spins so they can be matched to the assignments, and the
isotope
for field strength scaling.
spin.name(name='N')
spin.isotope(isotope='15N')

# The spectral data - spectrum ID, peak list file name, CPMG frequency
(Hz),
spectrometer frequency in Hertz.
data = [
    ['500_reference.in',    '500_MHz'+sep+'reference.in_sparky',
None,  500e6],
    ['500_66.667.in',       '500_MHz'+sep+'66.667.in_sparky',
66.6666,  500e6],
    ['500_133.33.in',       '500_MHz'+sep+'133.33.in_sparky',
133.3333,  500e6],
    ['500_133.33.in.bis',   '500_MHz'+sep+'133.33.in.bis_sparky',
133.3333,  500e6],
    ['500_200.in',          '500_MHz'+sep+'200.in_sparky',
200.0000,  500e6],
    ['500_266.67.in',       '500_MHz'+sep+'266.67.in_sparky',
266.6666,  500e6],
    ['500_333.33.in',       '500_MHz'+sep+'333.33.in_sparky',
333.3333,  500e6],
    ['500_400.in',          '500_MHz'+sep+'400.in_sparky',
400.0000,  500e6],
    ['500_466.67.in',       '500_MHz'+sep+'466.67.in_sparky',
466.6666,  500e6],
    ['500_533.33.in',       '500_MHz'+sep+'533.33.in_sparky',
533.3333,  500e6],
    ['500_533.33.in.bis',   '500_MHz'+sep+'533.33.in.bis_sparky',
533.3333,  500e6],
    ['500_600.in',          '500_MHz'+sep+'600.in_sparky',
600.0000,  500e6],
    ['500_666.67.in',       '500_MHz'+sep+'666.67.in_sparky',
666.6666,  500e6],
    ['500_733.33.in',       '500_MHz'+sep+'733.33.in_sparky',
733.3333,  500e6],
    ['500_800.in',          '500_MHz'+sep+'800.in_sparky',
800.0000,  500e6],
    ['500_866.67.in',       '500_MHz'+sep+'866.67.in_sparky',
866.6666,  500e6],
    ['500_933.33.in',       '500_MHz'+sep+'933.33.in_sparky',
933.3333,  500e6],
    ['500_933.33.in.bis',   '500_MHz'+sep+'933.33.in.bis_sparky',
933.3333,  500e6],
    ['500_1000.in',         '500_MHz'+sep+'1000.in_sparky',
1000.0000,  500e6],
    ['800_reference.in',    '800_MHz'+sep+'reference.in_sparky',
None,  800e6],
    ['800_66.667.in',       '800_MHz'+sep+'66.667.in_sparky',
66.6666,  800e6],
    ['800_133.33.in',       '800_MHz'+sep+'133.33.in_sparky',
133.3333,  800e6],
    ['800_133.33.in.bis',   '800_MHz'+sep+'133.33.in.bis_sparky',
133.3333,  800e6],
    ['800_200.in',          '800_MHz'+sep+'200.in_sparky',
200.0000,  800e6],
    ['800_266.67.in',       '800_MHz'+sep+'266.67.in_sparky',
266.6666,  800e6],
    ['800_333.33.in',       '800_MHz'+sep+'333.33.in_sparky',
333.3333,  800e6],
    ['800_400.in',          '800_MHz'+sep+'400.in_sparky',
400.0000,  800e6],
    ['800_466.67.in',       '800_MHz'+sep+'466.67.in_sparky',
466.6666,  800e6],
    ['800_533.33.in',       '800_MHz'+sep+'533.33.in_sparky',
533.3333,  800e6],
    ['800_533.33.in.bis',   '800_MHz'+sep+'533.33.in.bis_sparky',
533.3333,  800e6],
    ['800_600.in',          '800_MHz'+sep+'600.in_sparky',
600.0000,  800e6],
    ['800_666.67.in',       '800_MHz'+sep+'666.67.in_sparky',
666.6666,  800e6],
    ['800_733.33.in',       '800_MHz'+sep+'733.33.in_sparky',
733.3333,  800e6],
    ['800_800.in',          '800_MHz'+sep+'800.in_sparky',
800.0000,  800e6],
    ['800_866.67.in',       '800_MHz'+sep+'866.67.in_sparky',
866.6666,  800e6],
    ['800_933.33.in',       '800_MHz'+sep+'933.33.in_sparky',
933.3333,  800e6],
    ['800_933.33.in.bis',   '800_MHz'+sep+'933.33.in.bis_sparky',
933.3333,  800e6],
    ['800_1000.in',         '800_MHz'+sep+'1000.in_sparky',
1000.0000,  800e6]
]

# Loop over the spectra.
for id, file, cpmg_frq, H_frq in data:
    # Load the peak intensities.

    spectrum.read_intensities(file=file, dir=DATA_PATH, spectrum_id=id,
int_method='height')

    # Set the relaxation dispersion experiment type.
    relax_disp.exp_type(spectrum_id=id, exp_type='SQ CPMG')

    # Set the relaxation dispersion CPMG frequencies.
    relax_disp.cpmg_frq(spectrum_id=id, cpmg_frq=cpmg_frq)

    # Set the NMR field strength of the spectrum.
    spectrometer.frequency(id=id, frq=H_frq)

    # Relaxation dispersion CPMG constant time delay T (in s).
    relax_disp.relax_time(spectrum_id=id, time=0.030)

# Specify the duplicated spectra.
spectrum.replicated(spectrum_ids=['500_133.33.in', '500_133.33.in.bis'])
spectrum.replicated(spectrum_ids=['500_533.33.in', '500_533.33.in.bis'])
spectrum.replicated(spectrum_ids=['500_933.33.in', '500_933.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_133.33.in', '800_133.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_533.33.in', '800_533.33.in.bis'])
spectrum.replicated(spectrum_ids=['800_933.33.in', '800_933.33.in.bis'])

# Peak intensity error analysis.
spectrum.error_analysis(subset=['500_reference.in', '500_66.667.in',
'500_133.33.in', '500_133.33.in.bis', '500_200.in', '500_266.67.in',
'500_333.33.in', '500_400.in', '500_466.67.in', '500_533.33.in',
'500_533.33.in.bis', '500_600.in', '500_666.67.in', '500_733.33.in',
'500_800.in', '500_866.67.in', '500_933.33.in', '500_933.33.in.bis',
'500_1000.in'])
spectrum.error_analysis(subset=['800_reference.in', '800_66.667.in',
'800_133.33.in', '800_133.33.in.bis', '800_200.in', '800_266.67.in',
'800_333.33.in', '800_400.in', '800_466.67.in', '800_533.33.in',
'800_533.33.in.bis', '800_600.in', '800_666.67.in', '800_733.33.in',
'800_800.in', '800_866.67.in', '800_933.33.in', '800_933.33.in.bis',
'800_1000.in'])

# Deselect unresolved spins.
deselect.read(file='unresolved', dir=DATA_PATH+sep+'500_MHz',
res_num_col=1)
deselect.read(file='unresolved', dir=DATA_PATH+sep+'800_MHz',
res_num_col=1)



# Auto-analysis execution.
##########################

# Do not change!
Relax_disp(pipe_name=pipe_name, pipe_bundle=pipe_bundle,
results_dir=RESULTS_DIR, models=MODELS, grid_inc=GRID_INC,
mc_sim_num=MC_NUM, modsel=MODSEL, pre_run_dir=PRE_RUN_DIR,
insignificance=INSIGNIFICANCE, numeric_only=NUMERIC_ONLY,
mc_sim_all_models=MC_SIM_ALL_MODELS)


----------------------------------------------------------------------------------------------------
debug> Execution lock:  Acquisition by 'script UI' ('script' mode).

relax> pipe.create(pipe_name='base pipe', pipe_type='relax_disp',
bundle='relax_disp')
debug> Lock 'pipe_lock':  Acquisition by 'create'.
debug> Lock 'pipe_lock':  Release by 'create'.

relax> sequence.read(file='fake_sequence.in', dir='C:\\Program
files\\Relax-3.1.7\\test_suite\\shared_data\\dispersion\\Hansen',
spin_id_col=None, mol_name_col=None, res_num_col=1, res_name_col=2,
spin_num_col=None, spin_name_col=None, sep=None, spin_id=None)

debug> Execution lock:  Release by 'script UI' ('script' mode).
Traceback (most recent call last):
  File "prompt\interpreter.py", line 352, in exec_script
    runpy.run_module(module, globals)
  File "C:\Python27\lib\runpy.py", line 180, in run_module
    fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Program Files\relax-3.1.7\cpmg_analysis.py", line 76, in
<module>

    sequence.read('fake_sequence.in', dir=DATA_PATH, res_num_col=1,
res_name_col=2)
  File "prompt\uf_objects.py", line 221, in __call__
    self._backend(*new_args, **uf_kargs)
  File "pipe_control\sequence.py", line 339, in read
    for mol_name, res_num, res_name, spin_num, spin_name in
read_spin_data(file=file, dir=dir, file_data=file_data,
spin_id_col=spin_id_col, mol_name_col=mol_name_col,
res_num_col=res_num_col,
res_name_col=res_name_col, spin_num_col=spin_num_col,
spin_name_col=spin_name_col, sep=sep, spin_id=spin_id):
  File "lib\io.py", line 542, in read_spin_data
    file_data = extract_data(file, dir)
  File "lib\io.py", line 143, in extract_data
    file = open_read_file(file_name=file, dir=dir)
  File "lib\io.py", line 350, in open_read_file
    compress_type, file_path = determine_compression(file_path)
  File "lib\io.py", line 114, in determine_compression
    raise RelaxFileError(file_path)
RelaxFileError: RelaxError: The file 'C:\\Program

files\\Relax-3.1.7\\test_suite\\shared_data\\dispersion\\Hansen\\fake_sequence.in'
does not exist.


Thank you.

Best regards,

Mengjun



Quoting Edward d'Auvergne <edward@xxxxxxxxxxxxx>:

Hi Mengjun,

Looking at which user functions have been run, I can now see that the
following one is missing:

sequence.read('fake_sequence.in', dir=DATA_PATH, res_num_col=1,
res_name_col=2)

From the log files attached to https://gna.org/bugs/?21959, I can see
that this line has been deleted from the relax script (the log files
contain a pure copy of the script run).  It might be best if you copy
the script again, just in case other parts have been deleted.

Regards,

Edward




On 23 April 2014 17:00,  <mengjun.xue@xxxxxxxxxxxxxxxxxxxx> wrote:


Hi Edward,


I have set data path in cpmg_analysis.py to:
 DATA_PATH = 'C:\Program
files\Relax-3.1.7\test_suite\shared_data\dispersion\Hansen'

and run the cpmg_analysis.py under cmd,C:\program
files\relax-3.1.7\relax
--debug --tee log_debug cpmg_analysis.py,

please see following output of log file:



----------------------------------------------------------------------------------------------------
debug> Execution lock:  Acquisition by 'script UI' ('script' mode).

relax> pipe.create(pipe_name='base pipe', pipe_type='relax_disp',
bundle='relax_disp')
debug> Lock 'pipe_lock':  Acquisition by 'create'.
debug> Lock 'pipe_lock':  Release by 'create'.

relax> spin.name(name='N', spin_id=None, force=False)
debug> Lock 'spin_lock':  Acquisition by 'name_spin'.
debug> Lock 'spin_lock':  Release by 'name_spin'.

relax> spin.isotope(isotope='15N', spin_id=None, force=False)


relax> spectrum.read_intensities(file='500_MHz\\reference.in_sparky',
dir='C:\\Program
files\\Relax-3.1.7\test_suite\\shared_data\\dispersion\\Hansen',
spectrum_id='500_reference.in', dim=1, int_method='height',
int_col=None,
spin_id_col=None, mol_name_col=None, res_num_col=None,
res_name_col=None,
spin_num_col=None, spin_name_col=None, sep=None, spin_id=None,
ncproc=None)
debug> Execution lock:  Release by 'script UI' ('script' mode).
Traceback (most recent call last):
  File "prompt\interpreter.py", line 352, in exec_script
    runpy.run_module(module, globals)
  File "C:\Python27\lib\runpy.py", line 180, in run_module
    fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Program Files\relax-3.1.7\cpmg_analysis.py", line 124, in
<module>
    spectrum.read_intensities(file=file, dir=DATA_PATH,
spectrum_id=id,
int_method='height')
  File "prompt\uf_objects.py", line 221, in __call__
    self._backend(*new_args, **uf_kargs)
  File "pipe_control\spectrum.py", line 504, in read
    check_mol_res_spin_data()
  File "pipe_control\mol_res_spin.py", line 193, in
check_mol_res_spin_data
    raise RelaxNoSequenceError
RelaxNoSequenceError: RelaxError: The sequence data does not exist.


If set data path to DATA_PATH = 'C:\Program
files\Relax-3.1.7\\test_suite\shared_data\dispersion\Hansen', the out
put
is
following:



----------------------------------------------------------------------------------------------------
debug> Execution lock:  Acquisition by 'script UI' ('script' mode).

relax> pipe.create(pipe_name='base pipe', pipe_type='relax_disp',
bundle='relax_disp')
debug> Lock 'pipe_lock':  Acquisition by 'create'.
debug> Lock 'pipe_lock':  Release by 'create'.

relax> spin.name(name='N', spin_id=None, force=False)
debug> Lock 'spin_lock':  Acquisition by 'name_spin'.
debug> Lock 'spin_lock':  Release by 'name_spin'.

relax> spin.isotope(isotope='15N', spin_id=None, force=False)


relax> spectrum.read_intensities(file='500_MHz\\reference.in_sparky',
dir='C:\\Program
files\\Relax-3.1.7\\test_suite\\shared_data\\dispersion\\Hansen',
spectrum_id='500_reference.in', dim=1, int_method='height',
int_col=None,
spin_id_col=None, mol_name_col=None, res_num_col=None,
res_name_col=None,
spin_num_col=None, spin_name_col=None, sep=None, spin_id=None,
ncproc=None)
debug> Execution lock:  Release by 'script UI' ('script' mode).
Traceback (most recent call last):
  File "prompt\interpreter.py", line 352, in exec_script
    runpy.run_module(module, globals)
  File "C:\Python27\lib\runpy.py", line 180, in run_module
    fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Program Files\relax-3.1.7\cpmg_analysis.py", line 124, in
<module>
    spectrum.read_intensities(file=file, dir=DATA_PATH,
spectrum_id=id,
int_method='height')
  File "prompt\uf_objects.py", line 221, in __call__
    self._backend(*new_args, **uf_kargs)
  File "pipe_control\spectrum.py", line 504, in read
    check_mol_res_spin_data()
  File "pipe_control\mol_res_spin.py", line 193, in
check_mol_res_spin_data
    raise RelaxNoSequenceError
RelaxNoSequenceError: RelaxError: The sequence data does not exist.


Thank you.

Best regards,

Mengjun





Quoting Edward d'Auvergne <edward@xxxxxxxxxxxxx>:

Hi,

That should work.  It will record the source of the error.

Cheers,

Edward



On 23 April 2014 15:56,  <mengjun.xue@xxxxxxxxxxxxxxxxxxxx> wrote:



Hi Edward,

Thank you. Should I run debug command in this way:

 C:\program files\relax-3.1.7\relax --debug --tee log_debug
cpmg_analysis.py,?


Best regards,

Mengjun



Quoting Edward d'Auvergne <edward@xxxxxxxxxxxxx>:

Hi Mengjun,

Could you also run the script in debugging mode - with the
"--debug"
command line option and create a new log file?  The debugging
option
might point to the problem.  I have also seen such strangeness
sometimes just before a fatal hard disk failure occurs - but I hope
that is not your problem.

Cheers,

Edward



On 23 April 2014 15:13, Edward d'Auvergne <edward@xxxxxxxxxxxxx>
wrote:




Hi Mengjun,

I also just checked the contents of the officially released relax
3.1.7 MS Windows distribution zip file.  The reference.in_sparky
file
is in that directory.  Note that 'fake_sequence.in' is not in that
directory - it is in the parent
"test_suite/shared_data/dispersion/Hansen/" directory.  And that
'500_reference.in' is used as the spectrum ID and is not a file.

Regards,

Edward



On 23 April 2014 15:03, Edward d'Auvergne <edward@xxxxxxxxxxxxx>
wrote:




Hi,

Could you list the entire contents of the '500_MHz' folder?  I
must
absolutely contain that file!  You can do this by running "dir >
log"
and opening the 'log' text file.  I have done this on a virtual
machine and see:

    Directory:



C:\Users\edward\relax\tags\3.1.7\test_suite\shared_data\dispersion\Hansen\500_MHz


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        17/03/2014   3:11 PM       2038 1000.in
-a---        17/03/2014   3:11 PM       3143 1000.in_sparky
-a---        17/03/2014   3:11 PM        188 1000.in_trunc
-a---        17/03/2014   3:11 PM       2038 133.33.in
-a---        17/03/2014   3:11 PM       2038 133.33.in.bis
-a---        17/03/2014   3:11 PM       3141 133.33.in.bis_sparky
-a---        17/03/2014   3:11 PM        186 133.33.in.bis_trunc
-a---        17/03/2014   3:11 PM       3141 133.33.in_sparky
-a---        17/03/2014   3:11 PM        186 133.33.in_trunc
-a---        17/03/2014   3:11 PM       2038 200.in
-a---        17/03/2014   3:11 PM       3141 200.in_sparky
-a---        17/03/2014   3:11 PM        186 200.in_trunc
-a---        17/03/2014   3:11 PM       2038 266.67.in
-a---        17/03/2014   3:11 PM       3141 266.67.in_sparky
-a---        17/03/2014   3:11 PM        186 266.67.in_trunc
-a---        17/03/2014   3:11 PM       2038 333.33.in
-a---        17/03/2014   3:11 PM       3141 333.33.in_sparky
-a---        17/03/2014   3:11 PM        186 333.33.in_trunc
-a---        17/03/2014   3:11 PM       2038 400.in
-a---        17/03/2014   3:11 PM       3141 400.in_sparky
-a---        17/03/2014   3:11 PM        186 400.in_trunc
-a---        17/03/2014   3:11 PM       2038 466.67.in
-a---        17/03/2014   3:11 PM       3141 466.67.in_sparky
-a---        17/03/2014   3:11 PM        186 466.67.in_trunc
-a---        17/03/2014   3:11 PM       2038 533.33.in
-a---        17/03/2014   3:11 PM       2038 533.33.in.bis
-a---        17/03/2014   3:11 PM       3141 533.33.in.bis_sparky
-a---        17/03/2014   3:11 PM        186 533.33.in.bis_trunc
-a---        17/03/2014   3:11 PM       3141 533.33.in_sparky
-a---        17/03/2014   3:11 PM        186 533.33.in_trunc
-a---        17/03/2014   3:11 PM       2038 600.in
-a---        17/03/2014   3:11 PM       3141 600.in_sparky
-a---        17/03/2014   3:11 PM        186 600.in_trunc
-a---        17/03/2014   3:11 PM       2038 66.667.in
-a---        17/03/2014   3:11 PM       3141 66.667.in_sparky
-a---        17/03/2014   3:11 PM        186 66.667.in_trunc
-a---        17/03/2014   3:11 PM       2038 666.67.in
-a---        17/03/2014   3:11 PM       3141 666.67.in_sparky
-a---        17/03/2014   3:11 PM        186 666.67.in_trunc
-a---        17/03/2014   3:11 PM       2038 733.33.in
-a---        17/03/2014   3:11 PM       3141 733.33.in_sparky
-a---        17/03/2014   3:11 PM        186 733.33.in_trunc
-a---        17/03/2014   3:11 PM       2038 800.in
-a---        17/03/2014   3:11 PM       3141 800.in_sparky
-a---        17/03/2014   3:11 PM        186 800.in_trunc
-a---        17/03/2014   3:11 PM       2038 866.67.in
-a---        17/03/2014   3:11 PM       3141 866.67.in_sparky
-a---        17/03/2014   3:11 PM        186 866.67.in_trunc
-a---        17/03/2014   3:11 PM       2038 933.33.in
-a---        17/03/2014   3:11 PM       2038 933.33.in.bis
-a---        17/03/2014   3:11 PM       3141 933.33.in.bis_sparky
-a---        17/03/2014   3:11 PM        186 933.33.in.bis_trunc
-a---        17/03/2014   3:11 PM       3141 933.33.in_sparky
-a---        17/03/2014   3:11 PM        186 933.33.in_trunc
-a---        23/04/2014   2:00 PM      13766 log
-a---        17/03/2014   3:11 PM       2038 reference.in
-a---        17/03/2014   3:11 PM       3141 reference.in_sparky
-a---        17/03/2014   3:11 PM        186 reference.in_trunc
-a---        17/03/2014   3:11 PM         20 unresolved

You must see the same files!  If not, could you check your relax
installation file to see if it is complete?  There are a number
of
md5sum programs which can be downloaded and installed for
Windows,
and
then you can check that the relax distribution archive you have
used
is correct.  Maybe your download was interrupted and the zip file
only
extracted a portion of all of the relax files.

Regards,

Edward



On 23 April 2014 14:47,  <mengjun.xue@xxxxxxxxxxxxxxxxxxxx>
wrote:




Hi Edward,

Thank you so much for the detailed information about setting
data
path,
as
you suggested I have set data path in cpmg_analysis.py to:

DATA_PATH = 'C:\Program
files\Relax-3.1.7\\test_suite\shared_data\dispersion\Hansen' or

DATA_PATH = 'C:\Program
files\Relax-3.1.7\test_suite\shared_data\dispersion\Hansen'

and copy cpmg_analysis.py to the base relax directory, and then
run
the
cpmg_analysis.py under cmd, C:\program files\relax-3.1.7\relax
cpmg_analysis.py, still there are errors:

spectrum.read_intensities(file='500_MHz\\reference.in_sparky',
dir='C:\\Program

files\\Relax-3.1.7\\test_suite\\shared_data\\dispersion\\Hansen',
spectrum_id='500_reference.in', dim=1, int_method='height',
int_col=None,
spin_id_col=None, mol_name_col=None, res_num_col=None,
res_name_col=None,
spin_num_col=None, spin_name_col=None, sep=None, spin_id=None,
ncproc=None)

RelaxError: The sequence data does not exist.

relax>
spectrum.read_intensities(file='500_MHz\\reference.in_sparky',
dir='C:\\Program
files\\Relax-3.1.7\test_suite\\shared_data\\dispersion\\Hansen',
spectrum_id='500_reference.in', dim=1, int_method='height',
int_col=None,
spin_id_col=None, mol_name_col=None, res_num_col=None,
res_name_col=None,
spin_num_col=None, spin_name_col=None, sep=None, spin_id=None,
ncproc=None)

RelaxError: The sequence data does not exist.


In the folder of '500_MHz', I can not find reference.in_sparky
and
500_reference.in, I can find the sequence file
'fake_sequence.in'.


Thank you.

Best regards,

Mengjun




Quoting Edward d'Auvergne <edward@xxxxxxxxxxxxx>:

Hi Mengjun,

This is a simple case of handling file system paths and
directories
correctly and understanding what the current directory is.
When
you
run a relax script, the current working directory (CWD) will be
set
to
the directory that contains the script.  As you copied the
script
into
the base relax directory, the base directory will be the CWD.

If you have a look at the DATA_PATH variable, that is what is
called
a
relative path.  There is no root directory at the start ('C:\'
in
Windows, "/" in Linux and Macs) so it is not an absolute path.
A
relative path will then be relative to the CWD.  That means
that
DATA_PATH is added to CWD.  So if CWD is "C:\Program
files\relax"
and
DATA_PATH is "..\..\test_suite\shared_data\dispersion\Hansen",
then
the absolute path used to find the file will be "C:\Program
files\relax\..\..\test_suite\shared_data\dispersion\Hansen".

Now, the '..' directory has a special meaning - it is the
parent
directory.  This is the same on Windows, Linux and Mac.  It is
present
in the absolute path twice.  So the absolute path says to first
walk
into the "Program files" directory ("C:\Program files"), then
into
the
"relax" directory ("C:\Program files\relax"), then back up into
the
parent directory (which is "C:\Program files"), and once more
back
up
into the parent directory.  So you will now be at "C:\".
Therefore
the absolute path collapses to
"C:\test_suite\shared_data\dispersion\Hansen", which is a
directory
that most like does not exist on your system.

So to get the script to run, you need to take all of this into
account
and change DATA_PATH to be relative to the directory the script
is
in,
or change DATA_PATH to be the absolute path.  I hope this
explains
the
issue.

Regards,

Edward




On 23 April 2014 11:43, anonymous
<NO-REPLY.INVALID-ADDRESS@xxxxxxx>
wrote:





URL:
  <http://gna.org/bugs/?21959>

                 Summary: cpmg_analysis
                 Project: relax
            Submitted by: None
            Submitted on: Wed 23 Apr 2014 09:43:15 AM UTC
                Category: relax sample scripts
Specific analysis category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
             Assigned to: None
         Originator Name:
        Originator Email: mengjun.xue@xxxxxxxxxxxxxxxxxxxx
             Open/Closed: Open
                 Release: 3.1.7
         Discussion Lock: Any
        Operating System: 32-bit MS Windows

    _______________________________________________________

Details:

Dear Edward and Troels,

Thank you so much for your response. I have tried the script
again
as
you
suggested, but it does not work on my computer, I have
attached
the
log
file.

log_cpmg_analysis_04222014: I set the DATA_PATH =
'..\..\test_suite\shared_data\dispersion\Hansen' in
cpmg_analysis.py,
I
copy
the cpmg_analysis.py to the base relax directory, and then run
the
cpmg_analysis.py under cmd,C:\program files\relax-3.1.7\relax
cpmg_analysis.py

log_cpmg_analysis_04232014a: I set the DATA_PATH =
'..\\..\\test_suite\\shared_data\\dispersion\\Hansen' in
cpmg_analysis.py,  I
copy the cpmg_analysis.py to the base relax directory, and
then
run
the
cpmg_analysis.py under cmd, C:\program files\relax-3.1.7\relax
cpmg_analysis.py

log_cpmg_analysis_04232014b: I set the DATA_PATH =
'..\..\test_suite\shared_data\dispersion\Hansen' in
cpmg_analysis.py,
and
run
the cpmg_analysis.py under cmd, C:\program
files\relax-3.1.7\relax
sample_scripts\relax_disp\cpmg_analysis.py

Thank you.

Best regards,

Mengjun


Hi,

There's no need to separate them now.  I've fixed both in
relax.
For
the error you see now, if I run:

$ ./relax sample_scripts/relax_disp/cpmg_analysis.py

from the base relax directory, then it will find the data in
the
test
suite directories and perform the test analysis.  Also in the
Windows
PowerShell:
.\relax sample_scripts\relax_disp\cpmg_analysis.py
Both work for me.  But Troels' response




(http://thread.gmane.org/gmane.science.nmr.relax.devel/5296/focus=5326)
is exactly correct.  The '\t' is the Python tab character, so
the
missing '\' will really cause problems.  Python gets around
such
problems by using the os.sep and os.pardir variables, as I
have
used
in the updated scripts





(http://svn.gna.org/viewcvs/*checkout*/relax/trunk/sample_scripts/relax_disp/cpmg_analysis.py?content-type=text%2Fplain).

Regards,

Edward


Hi Mengjun.

There is missing a \
.\\..\test_suite

should be
.\\..\\test_suite

2014-04-23 10:23 GMT+02:00 <mengjun.xue@xxxxxxxxxxxxxxxxxxxx>:
Hi Edward,

Thank you very much for your suggestions. Should I separate
the
the
questions
about test suite and cmpg_analysis.py and resubmit them ? For
the
cpmy_analysis.py, I have change it to
'..\..\test_suite\shared_data\dispersion\Hansen' as your
suggestion,
and
try
to run the script again, but there are following relaxerror,

relax>
spectrum.read_intensities(file='500_MHz\\reference.in_sparky',
dir='..\\..\test_suite\\shared_data\\dispersion\\Hansen',
spectrum_id='500_reference.in', dim=1, int_method='height',
int_col=None,
spin_id_col=None, mol_name_col=None, res_num_col=None,
res_name_col=None,
spin_num_col=None, spin_name_col=None, sep=None, spin_id=None,
ncproc=None)
RelaxError: The sequence data does not exist.

Thank you.

Best regards,

Mengjun




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 23 Apr 2014 09:43:15 AM UTC  Name:
log_cpmg_analyis_04232014
Size:
11kB   By: None

<http://gna.org/bugs/download.php?file_id=20565>
-------------------------------------------------------
Date: Wed 23 Apr 2014 09:43:15 AM UTC  Name:
log_cpmg_analysis_04232014a
Size: 11kB   By: None

<http://gna.org/bugs/download.php?file_id=20566>
-------------------------------------------------------
Date: Wed 23 Apr 2014 09:43:15 AM UTC  Name:
log_cpmg_analysis_04232014b
Size: 11kB   By: None

<http://gna.org/bugs/download.php?file_id=20567>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?21959>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel

































Related Messages


Powered by MHonArc, Updated Thu Apr 24 16:00:15 2014