Skip to content
Angus Ball edited this page Oct 8, 2026 · 6 revisions

Intro

Why does UPP2 get it's own page? idk Im afraid. \

Installation

We need

Python: Version >= 3.6. SEPP: Version > 3.0. PASTA: Version > 1.0.

Sepp comes with UPP2, so all we need to explicitly download is PASTA and some random packages

pip install numpy==1.21.6
pip install dendropy==4.5.2

PASTA and pplacer

First try:

conda install bioconda::pasta
conda install -c bioconda pplacer

UPP2

Upp2 we need to download from first principles, SINCE we are using a fork from the main package

mkdir Upp2 
cd Upp2 
git clone https://github.com/gillichu/sepp.git

Might have to move into the git folder

python setup.py develop  --user

Comamnds

From the UPP2 wiki: \

[commandline] sequence_file= alignment= tree= alignmentSize= molecule=<amino/dna/rna> cpu=16 tempdir=./tmp/ outdir=./output/

[upp2] decomp_only=True bitscore_adjust=True hier_upp=True early_stop=<True/False>

Code

The bare code would be:

python run_upp.py -c <Config file>

Where the config file looks like

[commandline]
sequence_file=<query sequence file>
alignment=<backbone alignment>
tree=<backbone tree>
alignmentSize=<decomposition size>
molecule=<amino/dna/rna>
cpu=16
tempdir=./tmp/
outdir=./output/

[upp2]
decomp_only=True
bitscore_adjust=True
hier_upp=True
early_stop=<True/False>

Early stop is really important as it is whats actually getting us the runtime bonus
alignmentSize=, is set to 10 or 2, 2 increasing runtime, 10 saw no increase in alignment error, using 10 \

Therefore the actual code is... \

python run_upp.py -c upp2_greengenes_config.file

where the config file is

[commandline]
sequence_file=Oopsall_asvs_norc.fasta
alignment=greengenes2_MSA.fasta
tree=greengenes2_tree.nwk
alignmentSize=10
molecule=dna
cpu=30
tempdir=./tmp/
outdir=./output_greengenes/
checkpoint=./output_greengenes/test_500.chk

[upp2]
decomp_only=True
bitscore_adjust=True
hier_upp=True
early_stop=True

[exhaustive]
strategy = centroid
minsubsetsize = 2
placementminsubsetsizefacotr = 4
placer = pplacer
weight_placement_by_alignment = True

[pplacer]
path=/home/coder/project/R/nonR_libraries/miniconda3/envs/py310/bin/pplacer

[hmmalign]
path=/home/coder/project/R/nonR_libraries/miniconda3/envs/py310/bin/hmmalign

[hmmsearch]
path=/home/coder/project/R/nonR_libraries/miniconda3/envs/py310/bin/hmmsearch
piped=False
elim=10000
filters=True

[hmmbuild]
path=/home/coder/project/R/nonR_libraries/miniconda3/envs/py310/bin/hmmbuild

[jsonmerger]
path=./tools/merge/seppJsonMerger.jar

All the extra bs hmmbuild stuff is just links to where those commands can be found \

UPP2 help command

python run_upp.py --help
[07:35:34] config.py (line 337):  WARNING: Main configuration file was not found at: /home/coder/project/R/nonR_libraries/UPP2/sepp/.sepp/upp.config
Proceeding without the main configuration...
usage: run_upp.py [--help] [-v] [-F N] [-D DISTANCE] [--diameter DIAMETER] [-p DIR] [-rt] [-o OUTPUT] [-d OUTPUT_DIR] [--molecule MOLECULE]
                  [--ignore-overlap] [-x N] [-cp CHCK_FILE] [-cpi N] [-seed N] [-A N] [-R "Nmin Nmax"] [-M N] [-T N] [-B N] [-S DECOMP]
                  [-s SEQ] [-c CONFIG] [-t TREE] [-a ALIGN] [-b SEQ] [-l N] [-j DCOMP] [-h HIER] [-z BSADJUST] [-e EARLYSTOP]
                  [-m ENSEMBLEPATH] [-P N] [-r RAXML] [-f FRAG]

This script runs the UPP algorithm on set of sequences. A backbone alignment and tree can be given as input. If none is provided, a backbone
will be automatically generated.

options:
  --help                show this help message and exit
  -v, --version         show program's version number and exit

DECOMPOSITION OPTIONS:
  These options determine the alignment decomposition size, backbone size, and how to decompose the backbone set.

  -F N, --fragmentChunkSize N
                        maximum fragment chunk size of N. Helps controlling memory. [default: 999999999]
  -D DISTANCE, --distance DISTANCE
                        minimum p-distance before stopping the decomposition[default: 1]
  --diameter DIAMETER   maximum tree diameter before stopping the decomposition[default: None]
  -A N, --alignmentSize N
                        max alignment subset size of N [default: 10]
  -R "Nmin Nmax", --full_length_range "Nmin Nmax"
                        Only consider sequences with lengths within Nmin and Nmax
  -M N, --median_full_length N
                        Consider all fragments that are 25% longer or shorter than N to be excluded from the backbone. If value is -1, then
                        UPP will use the median of the sequences as the median full length [default: None]
  -T N, --backbone_threshold N
                        Only consider sequences with lengths within (1-N)*M and (1+N)*M as full-length, where M is the median length of the
                        full-length sequence given by the -M option and N is the percentage given by the -T option.[default: 0.25]
  -B N, --backboneSize N
                        (Optional) size of backbone set. If no backbone tree and alignment is given, the sequence file will be randomly
                        split into a backbone set (size set to N) and query set (remaining sequences), [default: min(1000,input size)]
  -S DECOMP, --decomp_strategy DECOMP
                        decomposition strategy [default: ensemble of HMMs (hierarchical)]

OUTPUT OPTIONS:
  These options control output.

  -p DIR, --tempdir DIR
                        Tempfile files will be written to DIR. Full-path required. [default: /tmp/sepp]
  -rt, --remtemp        Remove tempfile directory. [default: disabled]
  -o OUTPUT, --output OUTPUT
                        output files with prefix OUTPUT. [default: output]
  -d OUTPUT_DIR, --outdir OUTPUT_DIR
                        output to OUTPUT_DIR directory. full-path required. [default: .]

INPUT OPTIONS:
  These options control input. To run SEPP the following is required. A backbone tree (in newick format), a RAxML_info file (this is the
  file generated by RAxML during estimation of the backbone tree. Pplacer uses this info file to set model parameters), a backbone
  alignment file (in fasta format), and a fasta file including fragments. The input sequences are assumed to be DNA unless specified
  otherwise.

  --molecule MOLECULE   Molecule type of sequences. Can be amino, dna, or rna [default: dna]
  --ignore-overlap      When a query sequence has the same name as a backbone sequence, ignore the query sequences and keep the backbone
                        sequence[default: False]
  -s SEQ, --sequence_file SEQ
                        Unaligned sequence file. If no backbone tree and alignment is given, the sequence file will be randomly split into a
                        backbone set (size set to B) and query set (remaining sequences), [default: None]
  -c CONFIG, --config CONFIG
                        A config file, including options used to run UPP. Options provided as command line arguments overwrite config file
                        values for those options. [default: None]
  -t TREE, --tree TREE  Input tree file (newick format) [default: None]
  -a ALIGN, --alignment ALIGN
                        Aligned fasta file [default: None]
  -b SEQ, --backtranslation SEQ
                        Fasta file containing unaligned DNA sequences corresponding every reference and query sequence [default: None]

OTHER OPTIONS:
  These options control how SEPP is run

  -x N, --cpu N         Use N cpus [default: number of cpus available on the machine]
  -cp CHCK_FILE, --checkpoint CHCK_FILE
                        checkpoint file [default: no checkpointing]
  -cpi N, --interval N  Interval (in seconds) between checkpoint writes. Has effect only with -cp provided. [default: 3600]
  -seed N, --randomseed N
                        random seed number. [default: 297834]

UPP OPTIONS:
  These options set settings specific to UPP

  -l N, --longbranchfilter N
                        Branches longer than N times the median branch length are filtered from backbone and added to fragments. [default:
                        None (no filtering)]

UPP2 OPTIONS:
  These options set settings specific to UPP2

  -j DCOMP, --decomp_only DCOMP
                        Only run the decomposition step of UPP. [default: False]
  -h HIER, --hier_upp HIER
                        Run the hierarchical search through the UPP HMMs. [default: False]
  -z BSADJUST, --bitscore_adjust BSADJUST
                        Run with adjusted bitscore weighting. [default: False]
  -e EARLYSTOP, --early_stop EARLYSTOP
                        Run with early stop in hierarchical search. [default: False]
  -m ENSEMBLEPATH, --ensemble_path ENSEMBLEPATH
                        Path to ensemble data from a previous run of UPP2[default: False]

SEPP OPTIONS:
  These options set settings specific to SEPP and are not used for UPP.

  -P N, --placementSize N
                        max placement subset size of N [default: 10% of the total number of taxa]
  -r RAXML, --raxml RAXML
                        RAxML_info file including model parameters, generated by RAxML.[default: None]
  -f FRAG, --fragment FRAG
                        fragment file [default: None]

Clone this wiki locally