Skip to content

Tutorial 1: Build a supermatrix on a phone

This tutorial takes a published phylogenomic dataset from download to a concatenated supermatrix, using only a phone. You will:

  1. Download the dataset.
  2. Summarize the alignments.
  3. Filter out poorly sampled loci.
  4. Trim sites with too much missing data.
  5. Concatenate the loci into a supermatrix with a partition file.

It follows the Build a phylogenomic supermatrix workflow on the SEGUI home screen, with one extra trimming step.

  • A phone or tablet with Android 8.0 or newer, or iOS or iPadOS 15.0 or newer.
  • SEGUI v1.2.0 or newer. See GUI installation.
  • About 700 MB of free storage for SEGUI's working copy of the dataset and the output of each step.

The data are the ultraconserved element (UCE) alignments of shrews from Esselstyn et al. 2021, archived on Zenodo for the SEGUL publication.

Recordzenodo.org/records/6459213
Fileesselstyn_et_al_2021_uce_aln.zip, 14.6 MB
Content4,040 NEXUS alignments, one per UCE locus
Taxa102
LicenseCC BY 4.0
  1. Open zenodo.org/records/6459213 in Chrome.
  2. Scroll to Files and select Download next to esselstyn_et_al_2021_uce_aln.zip.
  3. Chrome saves the file to the Downloads folder. You do not need to open or extract it.

Start with summary statistics, so the filtering thresholds come from the data.

  1. Open SEGUI. On the home screen, select Workflows.

  2. Under Build a phylogenomic supermatrix, select Summarize alignments.

  3. In the Input card, select Browse, then Open archive.

  4. Pick esselstyn_et_al_2021_uce_aln.zip:

    The system file picker opens on Recent, which lists the download. If it is not there, open the menu and select Downloads. Tap the zip file.

  5. Wait while SEGUI extracts the archive. The input card then shows 4040 files selected.

SEGUI home screen on Android with the Workflows tab and the Build a phylogenomic supermatrix workflow
The workflow on the home screen.
SEGUI Select files sheet with Browse files, Browse folder, and Open archive
Choose Open archive.
Android file picker listing esselstyn_et_al_2021_uce_aln.zip under Recent files
Pick the downloaded zip file.
SEGUI input card extracting 589 of 4,040 files
SEGUI extracts the 4,040 alignments.
  1. Scroll to the Output card. Enter a Directory name, such as summary.
  2. Enter an Output Prefix, such as shrews. It starts the name of each output file, and the run button stays off without it.
  3. Under Summary Interval, select 5. The matrix completeness chart then steps by 5%.
  4. Select Summarize.

When the run finishes, SEGUI opens the Workbench tab. Select View report on the Report card.

SEGUI Summarize alignments output card with directory name summary, prefix shrews, and summary interval 5
The output settings before the run.
SEGUI workbench after the summary with 4,040 input files, 4 output files, and the Report card
The workbench after the run, with the Report card.

The Overview tab should show these numbers:

StatisticValue
Taxa102
Loci4,040
Sites5,398,947
Missing data49.4%
Locus length274 to 3,071 bp, mean 1,336 bp
Taxa per locus3 to 92, mean 63.2
Parsimony informative sites248,319

Two things stand out. Half of the matrix is missing data, and some loci have as few as 3 taxa. Scroll to the Matrix completeness chart to see what a taxon filter would keep. Touch a bar to read its value:

Loci with at leastLoci
90% of taxa2
80% of taxa308
75% of taxa983
70% of taxa1,895
50% of taxa3,274
SEGUI alignment report overview with 102 taxa, 4,040 loci, 5,398,947 sites, and 49.4% missing data
The Overview tab of the report.
SEGUI alignment report matrix completeness chart with bars from 100% to 60% of taxa
Matrix completeness: loci kept at each taxon threshold.

This tutorial uses 75%, which keeps 983 loci. Open the Taxa and Distributions tabs to see which taxa are missing from many loci and how locus length varies. See the alignment report guide for every tab.

  1. Select the back arrow to return to the Workbench tab, and scroll to Suggested workflows.
  2. Under Build a phylogenomic supermatrix, select Continue. SEGUI opens Filter alignments with the same 4,040 files as input.
  3. Leave Filter by on Minimal taxa.
  4. Enter 0.75 as the Minimum taxon proportion.
  5. Enter a Directory name, such as filtered.
  6. Under Output format, select NEXUS.
  7. Leave Concatenate output off. You will trim the loci first.
  8. Select Filter.
SEGUI workbench suggested workflows with Build a phylogenomic supermatrix at step 1 of 3 and a Continue button
Continue passes the files to the next tool.
SEGUI Filter alignments form with Minimal taxa, 0.75, directory name filtered, and NEXUS output
The filter settings.
SEGUI workbench after filtering with 4,040 input files and 983 output files
983 alignments pass the filter.

SEGUI keeps the loci with at least 76 of the 102 taxa. The output has 983 alignments with 1,504,374 sites. Missing data is still 48.38%, because the filter removes whole loci and not the gappy sites inside them.

Trimming removes alignment columns where most samples have a gap or missing character. These columns are common at the ends of UCE alignments.

  1. In the Workbench tab, scroll to Other compatible tools and select Show more.
  2. Select Trim alignments. SEGUI passes the 983 filtered alignments to it.
  3. Leave Trim by on Maximal missing data per site.
  4. Enter 0.5 as the Maximum missing data. SEGUI keeps a site when at most half of the samples are missing there.
  5. Enter a Directory name, such as trimmed.
  6. Under Format, select NEXUS.
  7. Select Trim.
SEGUI workbench Other compatible tools list with Trim alignments using 983 output files
Trim alignments under Other compatible tools.
SEGUI Trim alignments form with Maximal missing data per site, 0.5, directory name trimmed, and NEXUS format
The trim settings.
SEGUI workbench after trimming with 983 input files and 984 output files
983 trimmed alignments and a summary table.

The output has 983 trimmed alignments and trimming_summary.csv, which lists the sites of each locus before and after trimming. Open it from the Output tab to sort it in the table viewer.

Before trimmingAfter trimming
Loci983983
Sites1,504,374756,449
Missing data48.38%13.55%
  1. In the Workbench tab, scroll to Other compatible tools and select Concatenate alignments. SEGUI passes the 983 trimmed alignments to it.
  2. Enter a Directory name, such as supermatrix.
  3. Enter a Prefix, such as shrews. It names the output files.
  4. Under Format, select PHYLIP.
  5. Under Partition Format, select RaXML.
  6. Select Concatenate.
SEGUI Concatenate alignments form with directory name supermatrix, prefix shrews, PHYLIP format, and RaXML partition format
The concatenation settings.
SEGUI workbench after concatenation with 983 input files and 2 output files
Two output files from 983 alignments.
SEGUI Output tab listing shrews.phy at 73.59 Mb and shrews_partition.txt
The supermatrix and its partition file.

The Output tab lists two files:

  • shrews.phy: the supermatrix, with 102 taxa and 756,449 sites. It is about 74 MB.
  • shrews_partition.txt: the position of each of the 983 loci, such as DNA, uce-2 = 1-765.

To check the result, tap shrews.phy. The alignment viewer loads large alignments in parts, so it opens on a phone. The line under the grid should read Showing sites 1–22 of 756,449.

SEGUI alignment viewer on Android showing the first 22 of 756,449 sites of shrews.phy with colored bases
The supermatrix in the alignment viewer.

On phones, SEGUI saves output in its own folder. To use the supermatrix elsewhere, such as for tree inference on a cluster:

  1. Select the back arrow to leave the viewer.

  2. Select Quick Share. SEGUI compresses the output into supermatrix.zip and opens the share sheet.

  3. Pick a destination:

    Choose an app such as Drive or Gmail, or Quick Share to send it to a nearby device.

Android share sheet sharing supermatrix.zip with Quick Share, Drive, Bluetooth, and Gmail
The Android share sheet with the zipped output.

To save an archive to a folder instead, use Select and Export in the Output tab. See exporting output.

StepToolLociSitesMissing data
StartSummarize alignments4,0405,398,94749.43%
FilterFilter alignments, minimal taxa 0.759831,504,37448.38%
TrimTrim alignments, missing data 0.5983756,44913.55%
ConcatenateConcatenate alignments1 supermatrix756,44913.55%

The same workflow runs from the command line with segul align summary, filter, trim, and concat, and gives the same numbers.

This material is based upon work supported by the National Science Foundation under grant numbers: DEB-1754393 and DEB-2244754. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.