Code: Select all
@echo off
setlocal EnableDelayedExpansion
set debug=OFF
if "%debug%"=="ON" (set "echod=echo") else (set "echod=rem")
for /f %%a in ('copy /Z "%~dpf0" nul') do set "CR=%%a"
set "run=dna-search-Needleman–Wunsch_BLAST.exe --param240:AGCT"
set /a maxvalue=20
set /a numparam=0
call :cancella_var
call :addparameter "--key 314","--key 1.61"
call :addparameter "--mne 4","--mne 8","--mne 16","--mne 24"
call :addparameter "--em aaa","--em bbb","--em ccc"
call :addparameter "--grat sp","--grat ao"
call :addparameter "--no-wt","--wt"
call :addparameter "--wp 0l","--wpl 1","--wpl 2"
call :addparameter "--ttt","--no-ttt"
call :addparameter "--q-emen 0","--q-emen 1","--q-emen 2"
call :addparameter "--blayer 0","--blayer 1","--blayer 2","--blayer 3","--blayer 4","--blayer 5","--blayer 6"
call :addparameter "--ps none","--ps i","--ps p","--ps b","--ps i,q","--ps i,b","--ps p,b","--ps i,i","--ps i,p,b","--ps i,i,p","--ps i,i,b","--ps p,b,i,i","--pn all"
call :addparameter "--rd 0","--rd 10","--rd 20","--rd 40","--rd 60"
call :addparameter "--rf 1","--rf 2","--rf 4","--rf 6"
call :addparameter "--no-ms","--ms"
call :addparameter "--se 0","--se 1","--se 2","--se 3","--se 4","--se 5","--se 6","--se 7","--se 8","--se 9","--se 10"
call :addparameter "--ts 0","--ts 1","--ts 2"
call :addparameter "--ae 0","--ae 1","--ae 2"
call :addparameter "--no-cc","--cc"
call :addparameter "--no-k","--k 0:0"
call :addparameter "--no-be","--be"
for /L %%i in (1,1,%numparam%) do (
for /L %%k in (1,1,%maxvalue%) do (
if defined param[%%i].%%k %echod% param[%%i].%%k=!param[%%i].%%k!
)
)
if "%debug%"=="ON" (pause>nul&echo.)
set level=0
Rem for speeding call set/echo
set path=
set "PathExt=$"
call :iterativa_small
endlocal
goto :eof
::::::::::::::::::::::::::::::::::::::::::::::::::::::
:addparameter
set /a numparam+=1
set /a ind=1
:loop
if "%~1" equ "" goto :eof
set "param[%numparam%].%ind%=%~1"
%echod% "param[%numparam%].%ind%=%~1"
shift
set /a ind+=1
goto :loop
goto :eof
::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::
:cancella_var
for /f "delims==" %%f in ('set param') do (
set "%%f="
rem echo %%f
rem set %%f
)
for /f "delims==" %%f in ('set var') do (
set "%%f="
rem echo %%f
rem set %%f
)
for /f "delims==" %%f in ('set cont') do (
set "%%f="
rem echo %%f
rem set %%f
)
goto :eof
::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::
:iterativa_small (i,j)
setlocal
Echo Entering...
Set /a indice=1
For /L %%k in (1,1,%Numparam%) do set /a cont[%%k]=1
For /L %%k in (1,1,%Numparam%) do (
rem echo param[%%k].!cont[%%k]!
call set param=%%param[%%k].!cont[%%k]!%%
rem echo !param!
if "%debug%"=="ON" <nul set /p "=!param! "
)
%echod%(
<nul set /p "=INDICE:!indice! !CR!"
%echod%(
set /a i=1
set t0=!time!
for /L %%l in (1,0,1) do (
if "%debug%"=="ON" (pause)
set /a cont[!i!]+=1
call set cont=%%cont[!i!]%%
call set param=%%param[!i!].!cont!%%
%echod% I:!i! cont[!i!]=!cont! DEF? param[!i!].!cont!=!param!
if defined param (
%echod% I:!i! cont[!i!]=!cont! DEF param[!i!].!cont!=!param!
if !i! gtr 1 (
set /a i-=1
For /L %%k in (!i!,-1,1) do (
rem set /a i-=1
set /a cont[%%k]=1
%echod% I:!i! LOOP:%%k cont[%%k]=!cont[%%k]!
)
set /a i=1
)
For /L %%k in (1,1,%Numparam%) do (
rem %echod% param[%%k].!cont[%%k]!
call set param=%%param[%%k].!cont[%%k]!%%
rem echo !param!
if "%debug%"=="ON" <nul set /p "=!param! "
)
%echod%(
set t1=!time!
set /a d=1!t1:~6,2!-1!t0:~6,2!,m=1!t1:~3,2!-1!t0:~3,2!,md=d+m*60+1,vel=!indice!/md
set /a indice+=1
<nul set /p "=INDICE:!indice! !vel!/s !CR!"
if !indice! gtr 100000 %run% %params%
) else (
%echod% NDEF, INC I
set /a i+=1
)
Rem This not work well... there is a way to exit without calling the for?
if !i! GTR %numparam% call :halt
)
endlocal
goto :eof
:Halt
echo Exiting...
pause
call :_halt 2> NUL
:_halt
()
goto :eof
with the optimizing path i double the speed. But i need more speed...