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