data dedicated folder to put the sequence data files.
data/reads.fq - example sequence fastq file to align
ref dedicated folder to store reference databases.
ref/references.fa example reference database file.
out dedicated folder to organize output files.
qsub dedicated folder to store all qsub scripts.
qsub/bwa_job.qsub - Batch script example
qlog dedicated folder to store all qsub output logs.
Notes
To view all available bwa versions on SCC, execute: [scc1 ] module avail bwa
To run bwa index command at the command line: [scc1 ] module load bwa/0.7.17 # please specify version [scc1 ] bwa index ref/reference.fa -p ref/example_ref # build index. Note: you can specify index prefix using '-p' option
The above command will output on screen as recorded in out/bwa_index.out.
And also create the following index files in ref/:
ref/example_ref.amb
ref/example_ref.ann
ref/example_ref.bwt
ref/example_ref.pac
ref/example_ref.sa
To run bwa alignment tool, use the following command:(assume we are using 8 cores) [scc1 ] bwa aln -I -t 8 ref/example_ref data/reads.fq > out/example_aln.sai # align read to reference
The above command will output on screen as recorded in out/bwa_aln.out.
And the alignment file out/example_aln.sai is in bwa binary format (.sai):
You may want to use bwa samse tool to convert .sai file to sam file: [scc1 ] bwa samse ref/example_ref out/example_aln.sai data/reads.fq > out/example_aln.sam # convert sai to sam
The above command will output on screen as recorded in out/bwa_samse.out.
And the sam alignment file out/example_aln.sam will be generated.:
You can write a qsub to combine the above steps for a batch submission:
As prepared in qsub/bwa_job.qsub [scc1 ] cd qsub # get into the qsub script location [scc1 ] qsub bwa_job.qsub
After the above job's completion, there will be two files in qlog/ looks like:
qlog/bwa_example.oxxxxxxx
qlog/bwa_example.poxxxxxxx # 'xxxxxxx' stands for job number
Note: RCS example programs are provided "as is" without any warranty of any kind. The user assumes the intire risk of quality, performance, and repair of any defect. You are welcome to copy and modify any of the given examples for your own use.