LassaSeq is a command-line tool that simplifies the process of analyzing Lassa virus sequences. It automates the complete workflow from downloading sequences to creating phylogenetic trees, with special handling for Lassa’s bi-segmented genome.
Genome Segments
Lassa virus has a bi-segmented RNA genome consisting of:
L segment: (~7.2kb) Encodes the RNA-dependent RNA polymerase and Z protein
S segment: (~3.4kb) Encodes the nucleoprotein (NP) and glycoprotein precursor (GPC)
git clone https://github.com/DaanJansen94/LassaSeq.git
cd LassaSeq
pip install .
Re-installation (when updates are available):
conda activate lassaseq # Make sure you're in the right environment
cd LassaSeq
git pull # Get the latest updates from GitHub
pip uninstall lassaseq
pip install .
Note: Any time you modify the code or pull updates from GitHub, you need to reinstall the package using these commands for the changes to take effect.
Usage
First, make sure your conda environment is activated:
conda activate lassaseq
To see all available options:
lassaseq --help
This will display:
usage: lassaseq [-h] -o [--genome {1,2,3}] [--completeness ] [--host {1,2,3,4}] [--metadata {1,2,3,4}] [--countries ("country1, country2") ] [--remove] [--phylogeny] [--consensus_L] [--consensus_S] [--lineage] [--sublineage] [--l_sublineage] [--s_sublineage]
Download and filter Lassa virus sequences
options:
-h, --help show this help message and exit
-o Output directory for sequences
--genome {1,2,3} Genome completeness filter:
1 = Complete genomes only (>99 percent of reference length)
2 = Partial genomes (specify minimum percent with --completeness)
3 = No completeness filter
--completeness Minimum sequence completeness (1-100 percent)
Required when --genome=2
--host {1,2,3,4} Host filter:
1 = Human sequences only
2 = Rodent sequences only
3 = Both human and rodent sequences
4 = No host filter
--metadata {1,2,3,4} Metadata completeness filter:
1 = Keep only sequences with known location
2 = Keep only sequences with known date
3 = Keep only sequences with both known location and date
4 = No metadata filter
--countries (Optional) Comma-separated list of countries to filter sequences
If not specified, sequences from all countries will be included
Examples: "Sierra Leone, Guinea" or "Nigeria, Mali"
Available: Nigeria, Sierra Leone, Liberia, Guinea, Mali, Ghana, Benin, Burkina Faso, Ivory Coast, Togo
--remove (Optional) File containing accession numbers to remove
One accession number per line, lines starting with # are ignored
--phylogeny (Optional) Create concatenated FASTA files and perform phylogenetic analysis
Includes sequence alignment, trimming, and tree building
--consensus_L (Optional) Path to custom consensus sequences for L segment
--consensus_S (Optional) Path to custom consensus sequences for S segment
--lineage (Optional) Filter sequences by lineage
--sublineage (Optional) Filter sequences by sublineage for both segments
--l_sublineage (Optional) Filter L segment sequences by sublineage
--s_sublineage (Optional) Filter S segment sequences by sublineage
Lassaseq can be run in two modes:
Interactive Mode (default) - for interactive use
Non-Interactive Mode - for HPC submissions or automated runs
Interactive Mode
If optional arguments are not provided, the program will run in interactive mode and prompt for choices:
lassaseq -o output_directory
Command Line Mode
All options can be specified directly:
# Download complete genomes from human hosts with known location and date
lassaseq -o lassa_output --genome 1 --host 1 --metadata 3
# Download sequences with ≥80% completeness from both human and rodent hosts
lassaseq -o lassa_output --genome 2 --completeness 80 --host 3 --metadata 4
# Download sequences from specific countries and lineage
lassaseq -o lassa_output --genome 1 --host 1 --metadata 3 --countries "Sierra Leone, Guinea" --lineage IV
# Filter for different sublineages in L and S segments
lassaseq -o lassa_output --genome 1 --l_sublineage III --s_sublineage II
# Download sequences and perform phylogenetic analysis with segment-specific sublineages
lassaseq -o lassa_output --genome 1 --host 1 --metadata 3 --phylogeny --lineage IV --l_sublineage III --s_sublineage II
Lineage Information
The tool includes lineage information for Lassa virus sequences in the lineages directory. The lineages are in line with current literature, and sublineages for lineage IV were determined using fastbaps software. Users can modify or update the lineage files (l_lineages.txt and s_lineages.txt) to include their own lineage assignments. Each file follows a tab-delimited format with columns for accession numbers, lineages, and sublineages.
Summary File Content
The summary_Lassa.txt file provides detailed information about:
Detailed host distribution with sequence counts for:
When the --phylogeny flag is used, LassaSeq performs the following steps:
Sequence Concatenation: Combines downloaded sequences with reference and outgroup sequences, removing duplicates.
Multiple Sequence Alignment: Uses MAFFT with optimized parameters:
Alignment Trimming: Uses TrimAl with -automated1 for automated trimming
Tree Building: Uses IQ-TREE2 with ultra-fast bootstrap and 10,000 replicates
Tree Visualization
The phylogenetic trees generated by LassaSeq (.treefile files) can be visualuzed using various software packages (e.g., FigTree) and annotated using the metadata files provided by LassaSeq.
Load the tree file (e.g., l_trimmed.fasta.treefile or s_trimmed.fasta.treefile)
Import the corresponding metadata file (l_metadata.txt or s_metadata.txt)
Use the metadata columns to color and annotate your tree:
Location: Country of origin (e.g., SierraLeone, Nigeria)
Location2: City or specific location (e.g., Kenema, Nzerekore, Unknown)
Host: Host species (Human, Rodent, Other)
Date: Collection date in decimal format (e.g., 1969.000)
Handling Recombination Events
Due to the computationally intensive nature of recombination detection, this analysis is not included in LassaSeq itself. However, it is highly recommended to perform recombination analysis as a separate step before conducting phylogenetic analyses, as recombinant sequences can interfere with accurate tree reconstruction. Here’s the recommended workflow:
Recombination Analysis:
Before running LassaSeq’s phylogenetic analysis, perform recombination detection using your preferred tool. For example, HYPHY GARD can be installed and used as follows:
# Example using HYPHY GARD
conda install bioconda::hyphy
hyphy gard --rv Gamma --mode Faster --alignment trimmed_alignment.fasta --output gard_output.json
Note: Recombination analysis can be time-consuming depending on your dataset size and chosen tool.
Remove Recombinant Sequences:
Once you’ve identified recombinant sequences using your chosen analysis tool, add their accession numbers to a remove.txt file. Use this file with LassaSeq’s --remove option to exclude these sequences from the analysis:
This optional but recommended step is crucial for obtaining reliable phylogenetic trees, as recombinant sequences can lead to incorrect evolutionary relationships and branch patterns.
Dependencies
Python ≥ 3.6
BioPython ≥ 1.79
NumPy ≥ 1.21.0
MAFFT
TrimAl
IQTree2
Citation
If you use Lassaseq in your research, please cite:
Jansen, D., Laumen, J., Siebenmann, E., & Vercauteren, K. (2025). LassaSeq: A Command-Line Tool for Downloading, Processing and Analyzing Lassa Virus Sequences for Phylogenetic Analysis (v0.1.2). Zenodo. https://doi.org/10.5281/zenodo.14936276
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
If you encounter any problems or have questions, please open an issue on GitHub.
LassaSeq
LassaSeq is a command-line tool that simplifies the process of analyzing Lassa virus sequences. It automates the complete workflow from downloading sequences to creating phylogenetic trees, with special handling for Lassa’s bi-segmented genome.
Genome Segments
Lassa virus has a bi-segmented RNA genome consisting of:
Installation
Prerequisites
First, install conda if you haven’t already:
Then, ensure you have the required channels:
Option 1: Using Conda (Recommended)
Install LassaSeq via Conda:
Option 2: From Source Code
Create and activate a new conda environment:
Install lassaseq:
Re-installation (when updates are available):
Note: Any time you modify the code or pull updates from GitHub, you need to reinstall the package using these commands for the changes to take effect.
Usage
First, make sure your conda environment is activated:
To see all available options:
This will display:
Lassaseq can be run in two modes:
Interactive Mode
If optional arguments are not provided, the program will run in interactive mode and prompt for choices:
Command Line Mode
All options can be specified directly:
Lineage Information
The tool includes lineage information for Lassa virus sequences in the
lineagesdirectory. The lineages are in line with current literature, and sublineages for lineage IV were determined using fastbaps software. Users can modify or update the lineage files (l_lineages.txtands_lineages.txt) to include their own lineage assignments. Each file follows a tab-delimited format with columns for accession numbers, lineages, and sublineages.Summary File Content
The summary_Lassa.txt file provides detailed information about:
Phylogenetic Analysis
When the
--phylogenyflag is used, LassaSeq performs the following steps:-automated1for automated trimmingTree Visualization
The phylogenetic trees generated by LassaSeq (
.treefilefiles) can be visualuzed using various software packages (e.g., FigTree) and annotated using the metadata files provided by LassaSeq.Install FigTree:
Visualizing Trees:
l_trimmed.fasta.treefileors_trimmed.fasta.treefile)l_metadata.txtors_metadata.txt)Handling Recombination Events
Due to the computationally intensive nature of recombination detection, this analysis is not included in LassaSeq itself. However, it is highly recommended to perform recombination analysis as a separate step before conducting phylogenetic analyses, as recombinant sequences can interfere with accurate tree reconstruction. Here’s the recommended workflow:
remove.txtfile. Use this file with LassaSeq’s--removeoption to exclude these sequences from the analysis:This optional but recommended step is crucial for obtaining reliable phylogenetic trees, as recombinant sequences can lead to incorrect evolutionary relationships and branch patterns.
Dependencies
Citation
If you use Lassaseq in your research, please cite:
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
If you encounter any problems or have questions, please open an issue on GitHub.