REM Dos Batch Script to run the TOXD MR Test REM KJS : I couldn't for the life of me work out how to fix REM the variables to work properly inside the text files. REM There should be no issue except ccp4tmp has to be set to default. echo off echo. >NUL 2>TmpRVXDHW1.dat echo. >NUL 2>TmpRVXDHW2.dat echo. >NUL 2>TmpRVXDHW3.dat call:EofCat ToxDRARun TmpRVXDHW1.dat call:EofCat ToxDRBRun TmpRVXDHW2.dat call:EofCat ToxDRCRun TmpRVXDHW3.dat phaser < TmpRVXDHW1.dat phaser < TmpRVXDHW2.dat phaser < TmpRVXDHW2.dat del TmpRVXDHW*.dat exit /b REM Rotation Search goto:ToxDRARun MODE MR_FRF HKLIN ..\toxd\toxd.mtz LABIN F = FTOXD3 SIGF = SIGFTOXD3 ENSEMBLE toxd PDBFILE ..\data\1D0D_B.pdb IDENTITY 0.364 COMPOSITION PROTEIN MW 7139 NUM 1 SEARCH ENSEMBLE toxd ROOT C:\ccp4tmp\ROT_toxd :ToxDRARun REM Rotation Ensemble Search goto:ToxDRBRun MODE MR_FRF HKLIN ..\toxd\toxd.mtz LABIN F = FTOXD3 SIGF = SIGFTOXD3 ENSEMBLE toxd PDBFILE ..\data\1D0D_B.pdb IDENTITY 0.364 & PDBFILE ..\data\1BIK_2_1D0D_B.pdb IDENTITY 0.377 COMPOSITION PROTEIN MW 7139 NUM 1 SEARCH ENSEMBLE toxd ROOT C:\ccp4tmp\ROT_toxd :ToxDRBRun REM Translation Ensemble Search goto:ToxDRCRun MODE MR_FTF HKLIN ..\toxd\toxd.mtz LABIN F = FTOXD3SIGF = SIGFTOXD3 ENSEMBLE toxd PDBFILE ..\data\1D0D_B.pdb IDENTITY 0.364 & PDBFILE ..\data\1BIK_2_1D0D_B.pdb IDENTITY 0.377 COMPOSITION PROTEIN MW 7139 NUM 1 SOLUTION TRIAL ENSEMBLE toxd EULER 138.405 18.970 207.570 RFZ 5.70 ROOT C:\ccp4tmp\TRA_toxd :ToxDRCRun :EofCat ::Should call this function with 2 args, MYDELIM and outFile.txt ::where is to be catted to outFile.txt ::and text starts with goto:MYDELIM ::and ends with :MYDELIM set searchStart=goto:%~1 set searchStop=:%~1 set outFile=%~2 set startLine=0 set endLine=0 for /f "delims=:" %%a in ('findstr -b -n %searchStart% %~dpnx0') do set "startLine=%%a" for /f "delims=:" %%a in ('findstr -b -n %searchStop% %~dpnx0') do set "endLine=%%a" set /a linesLeftToRead=%endLine% - %startLine% del %outFile% if "%linesLeftToRead%" LEQ "0" ( echo Error finding start and end delmieters for %searchStop% in catMyChunk routine exit /B 1 ) setlocal DisableDelayedExpansion for /f "usebackq skip=%startLine% delims=" %%a in (`"findstr /n ^^ %~dpnx0"`) do ( set "oneLine=%%a" set /a linesLeftToRead-=1 setlocal EnableDelayedExpansion set "oneLine=!oneLine:*:=!" if !linesLeftToRead! LEQ 0 exit /B echo(!oneLine!>>%outFile% endlocal ) endlocal goto: EOF