View Single Post
Old 06-14-2011, 05:16 PM   #3
Kennels
Senior Member
 
Location: Sydney

Join Date: Feb 2011
Posts: 149
Default

Without having to learn perl or other languauge, the simplest but probably very clunky way of doing it is to use a shell script.

Create a text file (e.g. with gedit would be simplest), and name it xxx.sh (where .sh stands for shell).

In the file at the top, put in:

Code:
#!/bin/bash

echo `bwa aln -t 24 index file1>1.sam`
echo `bwa aln -t 24 index file2>2.sam`
echo `bwa aln -t 24 index file3>3.sam`
...

exit

This will execute each line as step by step commands. Make sure the quotes is the one generated by the tilde ('~') key at the top left of your keyboard. Of course typing all the lines would be a chore, so you might want to use a spreadsheet to fill in the increments.

One last thing. After you've created this file, you need to give it permission to be executable. In the terminal, cd to where this file is created, and type:

Code:
chmod +x xxx.sh
Then, to execute:

Code:
nohup ./xxx.sh > log.txt
You could also just execute ./xxx.sh, but 'nohup' sends all output of this script to log.txt, so if you run into any errors you can trace it back in the log file.

I understand your position so I've tried my best to help out here (not sure what the general rule here about writing code is for other people, but...). Try googling about shell scripts, and I'm sure you'll pick it up quickly and improve the above too.

Last edited by Kennels; 06-14-2011 at 05:19 PM.
Kennels is offline   Reply With Quote