Flankophile-Sapelo2: Difference between revisions
(Added "load Snakemake module" step to Manual setup section) |
(Removed Flankophile module and removed sections that stated Flankophile was available as a module) |
||
Line 3: | Line 3: | ||
=== Program On === | === Program On === | ||
[https://bitbucket.org/genomicepidemiology/flankophile/src/master/ Bitbucket] | |||
=== Version === | === Version === | ||
Line 17: | Line 17: | ||
=== Running Program === | === Running Program === | ||
Please also refer to [[Running Jobs on Sapelo2]]. | Please also refer to [[Running Jobs on Sapelo2]]. | ||
==== Requirements ==== | ==== Requirements ==== | ||
Line 34: | Line 31: | ||
## Should be located at the root of the ''Flankophile'' repository directory. | ## Should be located at the root of the ''Flankophile'' repository directory. | ||
==== | ==== Setup ==== | ||
The steps to setup ''Flankophile'' are as follows: | |||
The steps to | |||
# '''Enter into an interactive session''' The installation of ''Flankophile'' involves an amount of resource utilization that should be performed by a compute node and not a submit node. | # '''Enter into an interactive session''' The installation of ''Flankophile'' involves an amount of resource utilization that should be performed by a compute node and not a submit node. | ||
Line 66: | Line 49: | ||
==== Example Files ==== | ==== Example Files ==== | ||
As listed above, ''Flankophile'' requires | As listed above, ''Flankophile'' requires <u>input files</u>, a <u>metadata file</u>, and a <u>config file</u> to run. | ||
===== Example Input Files ===== | ===== Example Input Files ===== | ||
Unfortunately, the ''Flankophile'' pipeline does not come with any input files to use as examples. | |||
===== Example ''.tsv'' Metadata File ===== | |||
The following text is an example of a metadata file's contents: | |||
====== <code>/scratch/$USER/flankophile/metadata.tsv</code> ====== | |||
<syntaxhighlight> | |||
#assembly_name path metadata | |||
assembly32 /scratch/$USER/e_coli-assembly32.fa Escherichia | |||
assembly25 /scratch/$USER/p_vulgaris-assembly25.fa Proteus | |||
</syntaxhighlight><u>When creating a</u> ''<code>metadata.tsv</code>'' <u>file for your own data, be sure to take note of its filepath</u><u>.</u> This will be listed after ''<code>input_list:</code>'' in the ''<code>config.yaml</code>'' file, shown below. | |||
===== Example ''. | ===== Example ''.yaml'' Configuration File ===== | ||
The | The following text is an example of a ''Flankophile'' configuration file's contents: | ||
===== | ====== <code>/scratch/$USER/flankophile/config.yaml</code> ====== | ||
<syntaxhighlight lang="yaml"> | |||
# FLANKOPHILE version 0.2.10 | # FLANKOPHILE version 0.2.10 | ||
# Alix Vincent Thorn | # Alix Vincent Thorn | ||
Line 113: | Line 79: | ||
database: "input/example_input_files/ResFinder_08_02_2022.fa" | database: "input/example_input_files/ResFinder_08_02_2022.fa" | ||
input_list: " | input_list: "/scratch/$USER/flankophile/metadata.tsv" # Edit this! | ||
min_coverage_abricate: "98" # Minimum coverage in percentage compared to reference sequence. | min_coverage_abricate: "98" # Minimum coverage in percentage compared to reference sequence. | ||
Line 143: | Line 109: | ||
# 256 Cosine distance | # 256 Cosine distance | ||
# 4096 Chi-square distance | # 4096 Chi-square distance | ||
</syntaxhighlight> | </syntaxhighlight>This configuration file contains the path to the metadata file, which contains the paths to the input data. | ||
This configuration file contains the path to the metadata file, which contains the paths to the input data. | |||
<u>When | <u>When creating a ''<code>config.yaml</code>'' file for your own data, be sure to</u> <u>include the location of the</u> <code>''metadata.tsv''</code> <u>file you created.</u> | ||
==== Starting the Pipeline ==== | ==== Starting the Pipeline ==== | ||
Line 164: | Line 126: | ||
## <code>module load snakemake/6.9.1-Mamba-4.11.0-4</code> | ## <code>module load snakemake/6.9.1-Mamba-4.11.0-4</code> | ||
# '''Identify the name of the ''Conda'' environment to activate.''' | # '''Identify the name of the ''Conda'' environment to activate.''' | ||
## <code>ls .snakemake/conda/</code> | ##<code>ls .snakemake/conda/</code> | ||
## This will be a random series of numbers and letters. | |||
# '''Activate the ''Conda'' environment that ''Flankophile'' will use.''' | # '''Activate the ''Conda'' environment that ''Flankophile'' will use.''' | ||
##<code>source activate /scratch/''$USER''/flankophile/.snakemake/conda/50e62e607e6a24bb70ce9a5a50888445</code> | ##<code>source activate /scratch/''$USER''/flankophile/.snakemake/conda/'''50e62e607e6a24bb70ce9a5a50888445'''</code> | ||
##Make sure to adjust the command according to the name of the environment, identified previously. | |||
# '''Run the pipeline.''' | # '''Run the pipeline.''' | ||
## <code>snakemake --use-conda --cores 16</code> | ## <code>snakemake --use-conda --cores 16</code> | ||
Line 191: | Line 155: | ||
</syntaxhighlight>'''Please note that you need to identify the correct name of the ''Conda'' environment just as you would if running the pipeline from within an interactive session.''' | </syntaxhighlight>'''Please note that you need to identify the correct name of the ''Conda'' environment just as you would if running the pipeline from within an interactive session.''' | ||
Assuming <code>flankophile/</code> was | Assuming <code>flankophile/</code> was cloned into your user's <code>/scratch</code> directory, use the following steps to identify the name of the ''Conda'' environment: | ||
# '''Identify the name of the ''Conda'' environment to activate.''' | # '''Identify the name of the ''Conda'' environment to activate.''' | ||
Line 200: | Line 164: | ||
=== Installation === | === Installation === | ||
* Version 0.2.10: | * Version 0.2.10: Install in your user's scratch directory. | ||
=== System === | === System === | ||
* 64-bit Linux | * 64-bit Linux |
Revision as of 16:50, 7 March 2024
Category
Pipeline
Program On
Version
Author / Distributor
Description
"Flankophile is a bioinformatics pipeline for gene synteny analysis." Bitbucket
Running Program
Please also refer to Running Jobs on Sapelo2.
Requirements
Flankophile requires the following:
- The Flankophile pipeline
- Contains the pipeline's files and all required conda environments.
- Input sequence data in FASTA (.fa) format
- One or more FASTA files that Flankophile should use as input.
- A tab-separated value (.tsv) metadata file
- Describes the assembly names, their filepaths, and the genus for each input FASTA file.
- An analysis configuration file in YAML (.yaml)
- Describes the analysis for Flankophile to perform and the parameters to use during analysis.
- Should be located at the root of the Flankophile repository directory.
Setup
The steps to setup Flankophile are as follows:
- Enter into an interactive session The installation of Flankophile involves an amount of resource utilization that should be performed by a compute node and not a submit node.
interact --cpus-per-task 16 --mem 32GB
- Change the working directory to your user's
/scratch
directory Like other pipelines, the Flankophile installation directory should be in a location suited for large amounts of sustained I/O. Do not install Flankophile in the/home
directory; the filesystem that hosts/home
is not suited for this workload.cd /scratch/$USER
- Clone the Flankophile repository at the desired commit The versions of Flankophile are not labeled with tags in the project's Bitbucket page. Instead, the version is stated in the commit message; this guide will use the commit corresponding to version 0.2.10 (34f286e).
git clone https://bitbucket.org/genomicepidemiology/flankophile/src/34f286e00088d12019dc30cb2c38c103f0efe506/ flankophile
- The
...0efe506/ flankophile
at the end instructsgit
to clone the repository into the directory,flankophile
.
- The
- Change the working directory to the newly cloned flankophile/ repository
cd flankophile
- Load the Snakemake module.
module load snakemake/6.9.1-Mamba-4.11.0-4
- Create the conda environments that Flankophile will use at runtime In some tests, creating the conda environments at runtime causes the pipeline to fail due to missing or incompatible dependencies. To avoid this, create the conda environments ahead of time. This step will take ~15-25 minutes to complete.
snakemake --use-conda --conda-create-envs-only --cores 16
Example Files
As listed above, Flankophile requires input files, a metadata file, and a config file to run.
Example Input Files
Unfortunately, the Flankophile pipeline does not come with any input files to use as examples.
Example .tsv Metadata File
The following text is an example of a metadata file's contents:
/scratch/$USER/flankophile/metadata.tsv
#assembly_name path metadata
assembly32 /scratch/$USER/e_coli-assembly32.fa Escherichia
assembly25 /scratch/$USER/p_vulgaris-assembly25.fa Proteus
When creating a metadata.tsv
file for your own data, be sure to take note of its filepath. This will be listed after input_list:
in the config.yaml
file, shown below.
Example .yaml Configuration File
The following text is an example of a Flankophile configuration file's contents:
/scratch/$USER/flankophile/config.yaml
# FLANKOPHILE version 0.2.10
# Alix Vincent Thorn
## 1 #######################################################################################
database: "input/example_input_files/ResFinder_08_02_2022.fa"
input_list: "/scratch/$USER/flankophile/metadata.tsv" # Edit this!
min_coverage_abricate: "98" # Minimum coverage in percentage compared to reference sequence.
min_identity_abricate: "98" # Minimum percentage identity compared to reference sequence.
## 2 ######################################################################################
flank_length_upstreams: "1500"
flank_length_downstreams: "1500"
## 3 #######################################################################################
cluster_identity_and_length_diff: "0.98" # CD-HIT parameters = c and s. 0.98 = cluster at 98 % identity and a maximum length difference of 98 %
## 4 ######################################################################################
k-mer_size: "16" # Kmersize used by kma index. Try with "16" if in doubt.
distance_measure: "1" # Choose measurement for making distance matrix
# Distance calculation methods:
#
# 1 k-mer hamming distance
# 64 Jaccard distance
# 256 Cosine distance
# 4096 Chi-square distance
This configuration file contains the path to the metadata file, which contains the paths to the input data.
When creating a config.yaml
file for your own data, be sure to include the location of the metadata.tsv
file you created.
Starting the Pipeline
Once the required files are in place, using either the above examples or your own inputs, the pipeline can be started in either an interactive session or within a job submission script.
In an Interactive Session
The procedure to start the Flankophile pipeline in an interactive session is as follows:
- Enter into an interactive session if not already inside one.
interact --cpus-per-task 16 --mem 32GB
- Change the working directory to the location of the
flankophile/
directory. (The following command assumes it is in the base of your/scratch
directory)cd /scratch/$USER/flankophile/
- Load the snakemake module into your environment. (Flankophile requires snakemake 6.9.1 with Miniconda/Mamba 4.11.0)
module load snakemake/6.9.1-Mamba-4.11.0-4
- Identify the name of the Conda environment to activate.
ls .snakemake/conda/
- This will be a random series of numbers and letters.
- Activate the Conda environment that Flankophile will use.
source activate /scratch/$USER/flankophile/.snakemake/conda/50e62e607e6a24bb70ce9a5a50888445
- Make sure to adjust the command according to the name of the environment, identified previously.
- Run the pipeline.
snakemake --use-conda --cores 16
In a Job Submission Script
The following is an example of a job submission script that runs the Flankophile pipeline:
#!/bin/bash
#SBATCH --job-name=Flankophile
#SBATCH --partition=batch
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=16
#SBATCH --mem=32gb
#SBATCH --time=01:00:00
#SBATCH --output=%x.%j.out
#SBATCH --error=%x.%j.err
module load snakemake/6.9.1-Mamba-4.11.0-4
# The following assumes flankophile/ was copied into the base of your user's /scratch
cd /scratch/$USER/flankophile/
source activate /source/$USER/flankophile/.snakemake/conda/50e62e607e6a24bb70ce9a5a50888445
snakemake --use-conda --cores 16
Please note that you need to identify the correct name of the Conda environment just as you would if running the pipeline from within an interactive session.
Assuming flankophile/
was cloned into your user's /scratch
directory, use the following steps to identify the name of the Conda environment:
- Identify the name of the Conda environment to activate.
ls /scratch/$USER/flankophile/.snakemake/conda/
Make sure to adjust the job submission script so that the correct Conda environment is loaded.
Installation
- Version 0.2.10: Install in your user's scratch directory.
System
- 64-bit Linux