Skip to content

Sphae tutorial

Anita Tarasenko edited this page Aug 26, 2024 · 5 revisions

Sphae Usage Guide

Username Personalisation

  • [your_username@hpc-head01 ~] is a placeholder for the username. Replace your_username with your personalised username.

Common Bash Commands Used

  • List files in the current directory `(sphae) [your_username@hpc-head01 ~]$ ls```

  • Concatenate and display the content of a file (sphae) [your_username@hpc-head01 sphae]$ cat [file_name]

  • View the content of a file one page at a time (sphae) [your_username@hpc-head01 sphae]$ less [file_name]

  • Change to a directory (sphae) [your_username@hpc-head01 sphae]$ cd [directory_name]

  • Go up one level in the directory structure (sphae) [your_username@hpc-head01 sphae]$ cd ..

How to Run Sphae

  • Log onto the Deepthough HPC your_username@Your_Computer ~ % ssh your_email_with_access_to_hpc (your_username@deepthought) Password: Your personal password

  • Activate the Sphae Environment (base) [your_username@hpc-head01 ~]$ conda activate sphae

  • Update the Sphae Program (sphae) [your_username@hpc-head01 ~]$ pip install --upgrade sphae

  • Change to the Sphae Directory (sphae) [your_username@hpc-head01 ~]$ cd sphae

  • Create and Edit a Job Script for Running Sphae (sphae) [your_username@hpc-head01 sphae]$ nano

Example Sphae Job Script

#!/bin/bash

#SBATCH --job-name=sphae-medaka #SBATCH --mail-type=ALL #SBATCH --output=%x-%j.out.txt #SBATCH --error=%x-%j.err.txt #SBATCH --time=1-0 #SBATCH --ntasks=1 #SBATCH --cpus-per-task=64 #SBATCH --mem=500G #SBATCH --partition=high-capacity #SBATCH --qos=hc-concurrent-jobs

#sphae install #sphae run --input tests/data/illumina-subset --threads 64 -k #sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k #sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k --no_medaka #sphae annotate --genome tests/data/genome --threads 64

  • Save the file: control + x
  • Confirm save: yes or no
  • Name the file (e.g. sphae.sh) and remember this name for future use

Open and Edit the Saved Script

(sphae) [your_username@hpc-head01 sphae]$ nano sphae.sh

For Illumina Reads

#!/bin/bash

#SBATCH --job-name=sphae-medaka #SBATCH --mail-type=ALL #SBATCH --output=%x-%j.out.txt #SBATCH --error=%x-%j.err.txt #SBATCH --time=1-0 #SBATCH --ntasks=1 #SBATCH --cpus-per-task=64 #SBATCH --mem=500G #SBATCH --partition=high-capacity #SBATCH --qos=hc-concurrent-jobs

#sphae install sphae run --input tests/data/illumina-subset --threads 64 -k #sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k #sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k --no_medaka #sphae annotate --genome tests/data/genome --threads 64

  • Save the file: control + x
  • Confirm save: yes or no
  • Name the file (e.g. sphae.sh)

Submit the Job

(sphae) [your_username@hpc-head01 sphae]$ sbatch sphae.sh

Check Job Queue

(sphae) [your_username@hpc-head01 sphae]$ squeue

For Nanopore Reads

#!/bin/bash

#SBATCH --job-name=sphae-medaka #SBATCH --mail-type=ALL #SBATCH --output=%x-%j.out.txt #SBATCH --error=%x-%j.err.txt #SBATCH --time=1-0 #SBATCH --ntasks=1 #SBATCH --cpus-per-task=64 #SBATCH --mem=500G #SBATCH --partition=high-capacity #SBATCH --qos=hc-concurrent-jobs

#sphae install #sphae run --input tests/data/illumina-subset --threads 64 -k sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k #sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k --no_medaka #sphae annotate --genome tests/data/genome --threads 64

  • Save the file: control + x
  • Confirm save: yes or no
  • Name the file (e.g. sphae.sh)

Submit the Job

(sphae) [your_username@hpc-head01 sphae]$ sbatch sphae.sh

Check Job Queue

(sphae) [your_username@hpc-head01 sphae]$ squeue

For Newer ONT Sequencing

#!/bin/bash

#SBATCH --job-name=sphae-medaka #SBATCH --mail-type=ALL #SBATCH --output=%x-%j.out.txt #SBATCH --error=%x-%j.err.txt #SBATCH --time=1-0 #SBATCH --ntasks=1 #SBATCH --cpus-per-task=64 #SBATCH --mem=500G #SBATCH --partition=high-capacity #SBATCH --qos=hc-concurrent-jobs

#sphae install #sphae run --input tests/data/illumina-subset --threads 64 -k #sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k --no_medaka #sphae annotate --genome tests/data/genome --threads 64

  • Save the file: control + x
  • Confirm save: yes or no
  • Name the file (e.g. sphae.sh)

Submit the Job

(sphae) [your_username@hpc-head01 sphae]$ sbatch sphae.sh

Check Job Queue

(sphae) [your_username@hpc-head01 sphae]$ squeue

Run Genome Annotation for Already Assembled Genomes

#!/bin/bash

#SBATCH --job-name=sphae-medaka #SBATCH --mail-type=ALL #SBATCH --output=%x-%j.out.txt #SBATCH --error=%x-%j.err.txt #SBATCH --time=1-0 #SBATCH --ntasks=1 #SBATCH --cpus-per-task=64 #SBATCH --mem=500G #SBATCH --partition=high-capacity #SBATCH --qos=hc-concurrent-jobs

#sphae install #sphae run --input tests/data/illumina-subset --threads 64 -k #sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k #sphae run --input tests/data/nanopore-subset --sequencing longread --threads 64 -k --no_medaka sphae annotate --genome tests/data/genome --threads 64

  • Save the file: control + x
  • Confirm save yes or no
  • Name the file (e.g. sphae.sh)

Submit the Job

(sphae) [your_username@hpc-head01 sphae]$ sbatch sphae.sh

Check Job Queue

(sphae) [your_username@hpc-head01 sphae]$ squeue

Navigating and Viewing Files in the ‘sphae.out/RESULTS’ Directory

  • Display the Names of Files and Directories (sphae) [your_username@hpc-head01 sphae]$ ls

  • List files in the ‘RESULTS’ Directory (sphae) [your_username@hpc-head01 sphae]$ cd sphae.out (sphae) [your_username@hpc-head01 sphae]$ ls (sphae) [your_username@hpc-head01 sphae]$ cd sphae.out/RESULTS (sphae) [your_username@hpc-head01 sphae]$ ls

  • Open and View the ’nanoreads-sr’ File in the ‘sphae.out/RESULTS’ Directory (sphae) [your_username@hpc-head01 RESULTS]$ cd nanoreads-sr (sphae) [your_username@hpc-head01 nanoreads-sr]$ ls

  • Open and View the Content of the nanoreads_summary.txt File (sphae) [your_username@hpc-head01 nanoreads-sr]$ less nanoreads_summary.txt

  • View Content of nanoreads_1_summary.functions File (sphae) [your_username@hpc-head01 nanoreads-sr]$ less nanoreads_1_summary.functions