I recently had to change from the Linux UI to Windows to run some of my analysis for my Science work.
I'm running a program called Blast on Linux and I use it to run multiple files at a time.
The command I use on Linux is this:
for f in *.log; do blastn -query $f -db dbname -out $f.out -outfmt 6 -evalue 0.000001 &done
Upon which, the program will take all the files with *.log, run the command, then create output files named *.out
However, I've 0 idea on how to convert that into a Powershell command.
I'm currently running it one by one but I have hundred of files.
This is the base command in Powershell.
blastn.exe -query .\filename_log -db ..\dbname -out filename.out -outfmt 6 -evalue 0.00001
I'm considering the following, but it's not working because I am still woefully not sure of how to make it do something. =____=
Get-ChildItem "C:\pathway\Genomes\" -Filter *.log | Foreach-Object { $content = Get-Content $_.FullName
$content | Where-Object {$_ -do blastn.exe -query .\filename_log -db ..\dbname -out filename.out -outfmt 6 -evalue 0.00001'} | Set-Content ($_.BaseName + '.out') }
If creating such a command is not possible, would it be possible to create a script for this?
ls *.log | %{$_.Name} | %{blastn.exe -query $_ -db dbname -out $_.out -outfmt 6 -evalue 0.000001}%_.outwill look for a property in the object with the nameoutinstead of appending it to the end of the$_result