Skip to content

Commit

Permalink
corrects import fastas to take empty argument as nucl
Browse files Browse the repository at this point in the history
if using *.fasta and *.fas it will do the same file twice
  therefore, changed to only *.fas* just to make sure
  same file is not created twice
  • Loading branch information
averissimo committed May 20, 2016
1 parent 4d09641 commit 5012fa4
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions db_and_queries/import_dbs/import_fastas.bat
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
@echo off

if [%1] == [] (
%1 = nucl
)
if "%1" == "" (
SET arg=nucl

echo "Creating databases with default argument of '%arg%', if files have protein sequence use:"
echo " import_fastas.bat prot"

if NOT "%1" == "nucl" if NOT "%1" == "prot" (
echo "Error: ilegal value, expected 'nucl' or 'prot', not '%1%'"
exit
) else (
SET arg=%1
echo "Creating databases for %arg%."
)

for /r %%i in (*.fasta *.fna *.fas) do @makeblastdb -in %%i -dbtype "%1" -out "%%~ni" -title "%%~ni"
if NOT "%arg%" == "nucl" (
if NOT "%arg%" == "prot" (
echo "Error: ilegal value, expected 'nucl' or 'prot', not '%arg%'"
echo ""
echo "Usage: (by default nucl)"
echo " import_fastas.bat [nucl|prot]"
)
) ELSE (

echo "moving all files to ../db"
move *.nhr ../db
move *.nin ../db
move *.nsq ../db
move *.nal ../db
move *.phr ../db
move *.pin ../db
move *.psq ../db
move *.pal ../db
for /r %%i in (*.fna *.fas*) do @makeblastdb -in %%i -dbtype "%arg%" -out "%%~ni" -title "%%~ni"

echo "moving all files to ../db"
move *.nhr ../db
move *.nin ../db
move *.nsq ../db
move *.nal ../db
move *.phr ../db
move *.pin ../db
move *.psq ../db
move *.pal ../db
)

0 comments on commit 5012fa4

Please sign in to comment.