Skip to content
Snippets Groups Projects

Update blast example scripts.

Merged Adam Caprez requested to merge blast-example into master
1 file
+ 6
6
Compare changes
  • Side-by-side
  • Inline
@@ -47,7 +47,7 @@ If you want to create and use a BLAST database that is not mentioned above, chec
@@ -47,7 +47,7 @@ If you want to create and use a BLAST database that is not mentioned above, chec
Basic SLURM example of nucleotide BLAST run against the non-redundant **nt** BLAST database with `8 CPUs` is provided below. When running BLAST alignment, it is recommended to first copy the query and database files to the **/scratch/** directory of the worker node. Moreover, the BLAST output is also saved in this directory (**/scratch/blastn_output.alignments**). After BLAST finishes, the output file is copied from the worker node to your current work directory.
Basic SLURM example of nucleotide BLAST run against the non-redundant **nt** BLAST database with `8 CPUs` is provided below. When running BLAST alignment, it is recommended to first copy the query and database files to the **/scratch/** directory of the worker node. Moreover, the BLAST output is also saved in this directory (**/scratch/blastn_output.alignments**). After BLAST finishes, the output file is copied from the worker node to your current work directory.
{{% notice info %}}
{{% notice info %}}
**Please note that the worker nodes can not write to the */home/* directories and therefore you need to run your job from your */work/* directory.**
**Please note that the worker nodes can not write to the */home/* directories and therefore you need to run your job from your */work/* directory.**
**This example will first copy your database to faster local storage called scratch. This can greatly improve performance!**
**This example will first copy the database and your input file to faster local storage called "scratch", assuming that the input file exists in your current directory. This can greatly improve performance!**
{{% /notice %}}
{{% /notice %}}
{{% panel header="`blastn_alignment.submit`"%}}
{{% panel header="`blastn_alignment.submit`"%}}
@@ -64,13 +64,13 @@ Basic SLURM example of nucleotide BLAST run against the non-redundant **nt** BL
@@ -64,13 +64,13 @@ Basic SLURM example of nucleotide BLAST run against the non-redundant **nt** BL
module load blast/2.10
module load blast/2.10
module load biodata/1.0
module load biodata/1.0
cd $WORK/<project_folder>
# Be sure to use a directory under $WORK for your job
cp $BLAST/nt.* /scratch/
cp $BLAST/nt.* /scratch/
cp input_reads.fasta /scratch/
cp input_reads.fasta /scratch/
blastn -query /scratch/input_reads.fasta -db /scratch/nt -out /scratch/blastn_output.alignments -num_threads $SLURM_NTASKS_PER_NODE
blastn -query /scratch/input_reads.fasta -db /scratch/nt -out /scratch/blastn_output.alignments -num_threads $SLURM_NTASKS_PER_NODE
cp /scratch/blastn_output.alignments $WORK/<project_folder>
cp /scratch/blastn_output.alignments .
{{< /highlight >}}
{{< /highlight >}}
{{% /panel %}}
{{% /panel %}}
@@ -87,7 +87,7 @@ The default BLAST output is in pairwise format. However, BLAST’s parameter **-
@@ -87,7 +87,7 @@ The default BLAST output is in pairwise format. However, BLAST’s parameter **-
Basic SLURM example of protein BLAST run against the non-redundant **nr **BLAST database with tabular output format and `8 CPUs` is shown below. Similarly as before, the query and database files are copied to the **/scratch/** directory. The BLAST output is also saved in this directory (**/scratch/blastx_output.alignments**). After BLAST finishes, the output file is copied from the worker node to your current work directory.
Basic SLURM example of protein BLAST run against the non-redundant **nr **BLAST database with tabular output format and `8 CPUs` is shown below. Similarly as before, the query and database files are copied to the **/scratch/** directory. The BLAST output is also saved in this directory (**/scratch/blastx_output.alignments**). After BLAST finishes, the output file is copied from the worker node to your current work directory.
{{% notice info %}}
{{% notice info %}}
**Please note that the worker nodes can not write to the */home/* directories and therefore you need to run your job from your */work/* directory.**
**Please note that the worker nodes can not write to the */home/* directories and therefore you need to run your job from your */work/* directory.**
**This example will first copy your database to faster local storage called scratch”. This can greatly improve performance!**
**This example will first copy the database and your input file to faster local storage called "scratch", assuming that the input file exists in your current directory. This can greatly improve performance!**
{{% /notice %}}
{{% /notice %}}
{{% panel header="`blastx_alignment.submit`"%}}
{{% panel header="`blastx_alignment.submit`"%}}
@@ -104,12 +104,12 @@ Basic SLURM example of protein BLAST run against the non-redundant **nr **BLAS
@@ -104,12 +104,12 @@ Basic SLURM example of protein BLAST run against the non-redundant **nr **BLAS
module load blast/2.10
module load blast/2.10
module load biodata/1.0
module load biodata/1.0
cd $WORK/<project_folder>
# Be sure to use a directory under $WORK for your job
cp $BLAST/nr.* /scratch/
cp $BLAST/nr.* /scratch/
cp input_reads.fasta /scratch/
cp input_reads.fasta /scratch/
blastx -query /scratch/input_reads.fasta -db /scratch/nr -outfmt 6 -out /scratch/blastx_output.alignments -num_threads $SLURM_NTASKS_PER_NODE
blastx -query /scratch/input_reads.fasta -db /scratch/nr -outfmt 6 -out /scratch/blastx_output.alignments -num_threads $SLURM_NTASKS_PER_NODE
cp /scratch/blastx_output.alignments $WORK/<project_folder>
cp /scratch/blastx_output.alignments .
{{< /highlight >}}
{{< /highlight >}}
{{% /panel %}}
{{% /panel %}}
Loading