Hi Edward.
I am digging through old perl scripts, which is preparing data for our analysis in IgorPro.
So I guess my challenge is now to match this to the procedures of relax, and establish the difference.
-----------
$expList="expList.txt";
$peakFile='peaks.dat';
$centerPPM=118.085;
$frq=81.050;
-----------
expList.txt contains lines with: "fit_R1_filename" "spin_lock_offset_HZ" "spin_lock_field_Hz"
----------------------
open IN, "$expList" or die "Cannot open $expList for read";
while (<IN>){
@process = split (/\s+/, $_);
if ($process[0] ne "#"){
$fileName{$i}=$process[0];
$offset{$i}=$process[1];
$omega1{$i}=$process[2];
$i++;
};
};
close (IN);
-------------------
And then it read the peak file to extract ppm for N15.
-------------
open IN , "$peakFile" or die "Cannot open $peakFile for read";
while (<IN>) {
@process = split (/\s+/, $_);
if ($process[0] eq ""){splice (@process, 0, 1)};
if ($process[0] == 1){ $read = 1};
if ($read == 1){
$chemShift{$process[6]}=$process[4];
};
};
close (IN);
-----------
The chemical shifts are stored in a dictionary under the residue name ($process[6]) with the ppm values of N15 ($process[4]).
Then R1r and R1r_err are read in from external exponential fit files.
------------
for ($i = 1; $i <= $numFiles; $i++){
open IN, "$fileName{$i}" or die "Cannot open $fileName{$i} for read";
while (<IN>){
@process = split (/\s+/, $_);
if ($process[0] ne "#"){
$R1r{$process[0]}{$i}=$process[1];
$R1r_err{$process[0]}{$i}=$process[2];
};
};
close(IN);
};
-------------------
Then omega is calculated.
------------
foreach $peakName (keys %chemShift) {
open (OUT, ">../residueFiles/$peakName.dat");
for ($i=1;$i<=$numFiles;$i++){
$OMEGA=($centerPPM-$chemShift{$peakName})*$frq+$offset{$i};
$omegaEFF=sqrt($OMEGA**2+$omega1{$i}**2);
if (($omega1{$i}/$OMEGA) > 0){
$theta=180/$PI*abs(atan($omega1{$i}/$OMEGA));
}else{
$theta=180-180/$PI*abs(atan($omega1{$i}/$OMEGA));
};
printf OUT "%s %s %s %s %s %s\n",$OMEGA,$omega1{$i},$omegaEFF,$theta,$R1r{$peakName}{$i},$R1r_err{$peakName}{$i};
};
close (OUT);
};
--------------
I guess I would need to find out how relax calculates omegaEFF, the effective field in the rotating frame ?
Best
Troels