__TOC__ = Get the process helper scripts =As of August 2013, one can download the scripts easily, by following this.<source lang="bash">cd scripts# Change shelltcsh# Set array of scripts to downloadset SCRIPTS="CPMG_1_sort_pseudo3D_initialize_files.sh CPMG_2_convert_and_process.sh CPMG_3_fft_all.sh convert_all.com fft_all.com sparky_add.sh stPeakList.pl NMRPipe_to_Sparky.sh" # Download scriptsforeach SCRIPT ( ${SCRIPTS} )curl https://raw.github.com/nmr-relax/relax_scripts/master/shell_scripts/$SCRIPT -o $SCRIPTend # Make them executablechmod +x *.sh *.com *.pl # Add scripts to PATHsetenv PATH ${PWD}:${PATH}</source> If the scripts are not possible to download, they are here for reference. = Helper scripts for Spectral processing === convert_all.com ==<source lang="bash">#!/bin/csh -f set x = 0 while ( $x <= 35 ) mv $x.fid $x.fid.temp mkdir $x.fid cd $x.fid mv ../$x.fid.temp ./fid cp ../fid.com . ./fid.com cd .. @ x = $x + 1end</source> == fft_all.com ==<source lang="bash">#! /bin/csh -f set x = 0 while ( $x <= 35 ) cd $x.fid cp ../fft.com . ./fft.com cd .. @ x = $x + 1end</source> = Scripts used in Tutorial === CPMG_1_sort_pseudo3D_initialize_files.sh ==
<source lang="bash">
#!/bin/bash -e
</source>
== CPMG_2_convert_and_process.sh ==
<source lang="bash">
#!/bin/bash
</source>
== CPMG_3_fft_all.sh ==
<source lang="bash">
#!/bin/bash -e
</source>
= convert_allScript to convert into SPARKY and add to SPARKY lists === NMRPipe_to_Sparky.com sh ==
<source lang="bash">
#!/bin/csh tcsh -feset x FTS= 0`ls -v -d -1 */*.ft2`
while foreach FT ( $x <= 35 FTS) mv set DNAME=`dirname $x.fid FT` set BNAME=`basename $x.fid.tempFT` mkdir set FNAME=`echo $xBNAME | cut -d'.fid' -f1` cd echo $x.fidFT $DNAME $BNAME $FNAME mv .. pipe2ucsf $FT ${DNAME}/$x{FNAME}.fid.temp ./fid cp ../fid.com . ./fid.com cd .. @ x = $x + 1ucsf
end
</source>
= fft_all= sparky_add.com sh ==
<source lang="bash">
#! /bin/csh tcsh -fe if ($#argv < 4) then echo "Change value of column" echo "Usage: $0 file" "'"'$X'"'" "'"'0.1'"' peaks_out.list " echo "sparky_add.sh sparky.list" "'"'$2'"'" "-0.132 peaks_out.list" goto doneendif set PEAKS=$1set PEAKSTEMP=${PEAKS}.tempset COL=$2set COLOFFSET=$3set PEAKSOUT=$4set LINE='$0' awk '$2 ~ /^[0-9]/{print $0}' $PEAKS > $PEAKSTEMPawk "{ ${COL} = ${COL} + $COLOFFSET; print $LINE } " $PEAKSTEMP > $PEAKSOUTrm $PEAKSTEMP done: ; exit 0</source> = Script to input for NMRPipe SeriesTab === stPeakList.pl ==EDIT 2013108: The script was modified for correct calculation of '''X_AXIS Y_AXIS''' for folded peaks. And writing of '''X1 X3 Y1 Y3''' to be able to read peak list in nmrDraw.
set x <source lang= 0"perl">#! /usr/bin/perl # Creates a peak list for seriesTab given a # nmrPipe spektrum and a Sparky peak list## usage: stPeakList [pipe spectrum] [Sparky peak list]## Kaare Teilum 061025# Modified 131008 by Troels E. Linnet
$pipeFile = $ARGV[0];$sparkyList = $ARGV[1]; open HDR, "showhdr $pipeFile |" or die "can't run: showhdr $pipeFile";while ( <HDR>){ if (/OBS MHz/){ /([0-9]+\.[0-9]+)\s+([0-9]+\.[0-9]+)/; $frqX=$x <1; $frqY= 35 $2; }; if (/DATA SIZE/){ /([0-9]+)\s+([0-9]+)/; cd $x.fidsizeX=$1; $sizeY=$2; }; if (/ORIG Hz/){ cp /(-*[0-9]+\.[0-9]+)\s+(-*[0-9]+\.[0-9]+)/; $origX=$1; $origY=$2; }; if (/SW Hz/fft){ /([0-9]+\.com [0-9]+)\s+([0-9]+\.[0-9]+)/; $swX=$1; $swY=$2; };};close(HDR); $stepX=$swX/$frqX/$sizeX; $highX=($origX+$swX)/$frqX;$highX2SW=($origX+2*$swX)/$frqX;$stepY=$swY/$frqY/$sizeY;$highY=($origY+$swY)/$frqY;$highY2SW=($origY+2*$swY)/$frqY;$i=1;print "VARS INDEX X_AXIS Y_AXIS X_PPM Y_PPM VOL ASS X1 X3 Y1 Y3\n";print "FORMAT %5d %9./fft3f %9.com cd 3f %8.3f %8.3f %+e %s %4d %4d %4d %4d\n\n"; open IN, "$sparkyList" or die "Cannot open $sparkyList for read"; while (<IN>){ @process = split (/\s+/, $_); if ($process[0] eq ""){splice (@ x process, 0, 1)}; if ($process[0] ne "Assignment" && $process[0] ne ""){ $ptsX=($highX-$process[2])/$stepX; if ($ptsX < 0){ $ptsX=($highX2SW-$process[2])/$stepX; } $ptsX_X1=$ptsX-1; $ptsX_X3=$ptsX+1; $ptsY=($highY-$process[1])/$stepY; if ($ptsY < 0){ $ptsY=($highY2SW-$process[1])/$stepY; } $ptsY_Y1=$ptsY-1; $ptsY_Y3= $x ptsY+ 1;end printf "%5d %9.3f %9.3f %8.3f %8.3f %+e %s %4.0f %4.0f %4.0f %4.0f\n",$i,$ptsX,$ptsY,$process[2],$process[1],700000,$process[0],$ptsX_X1,$ptsX_X3,$ptsY_Y1,$ptsY_Y3; $i++; }; };close (IN);
</source>
== See also ==
[[Category:Tutorials]]