Skip to content

MAF Summary

Parts of a SEGUL commandThe command segul maf summary --dir maf/ --prefix primates has five parts: the program segul, the command maf for the task group, the subcommand summary for the task, the input --dir maf/ (folder or files), and the option --prefix primates (optional).segulProgrammafCommandtask groupsummarySubcommandtask--dir maf/Inputfolder or files--prefix primatesOptionsoptional

Summarize Multiple Alignment Format (MAF) files: the number of blocks, the alignment length, how much of the reference genome each species covers, and the proportion of gaps. Use it to check whole-genome alignments before converting them.

Using the genome.maf file from the MAF conversion example:

Terminal window
segul maf summary --input genome.maf

SEGUL writes two files to Maf-Summary. maf_summary_per_species.csv has one row per species:

path,name,blocks_present,block_proportion,aligned_columns,bases,gaps,gap_proportion,n_count,ref_bases_covered,ref_coverage
genome.maf,hg38,2,1.0000,17,15,2,0.1176,0,15,1.0000
genome.maf,mm10,2,1.0000,17,15,2,0.1176,0,15,1.0000
genome.maf,panTro6,1,0.5000,12,12,0,0.0000,0,10,0.6667

panTro6 is in one of the two blocks and aligns to 10 of the 15 reference bases.

SEGUL reads blocks the same way as the conversion: it names samples after their assembly (hg38.chr1 becomes hg38), uses the forward strand of the reference, and reads gzipped files directly. See how SEGUL reads MAF blocks.

maf_summary_per_file.csv has one row per MAF file:

ColumnDescription
pathMAF file
ref_speciesReference species
blocksBlocks with a reference sequence
blocks_no_refBlocks without a reference sequence (not included in other columns)
speciesNumber of species
ref_chromosomesNumber of reference chromosomes
ref_chrom_size_totalTotal length of those chromosomes
ref_basesReference bases in all blocks
ref_genome_coverageref_bases divided by ref_chrom_size_total
aligned_columnsTotal alignment length of all blocks
mean_block_columnsMean alignment length of a block
min_block_columnsShortest block alignment
max_block_columnsLongest block alignment
mean_block_ref_lenMean reference bases in a block
mean_species_per_blockMean number of species in a block
mean_scoreMean score of blocks with a score. Empty if no block has a score
gap_proportionGaps (-) divided by all characters
duplicate_rowsRows dropped because a species appeared more than once in a block

Overlapping blocks are counted each time they appear, so ref_genome_coverage can be higher than the share of the genome that is covered. Very small values are written in scientific notation, such as 3.5952e-7.

maf_summary_per_species.csv has one row per species in each file. The reference comes first, followed by the other species in alphabetical order.

ColumnDescription
pathMAF file, or all for every file combined
nameSpecies
blocks_presentBlocks with the species
block_proportionblocks_present divided by the number of blocks
aligned_columnsTotal alignment length of the blocks with the species
basesCharacters other than gaps
gapsGaps (-)
gap_proportiongaps divided by aligned_columns
n_countUnknown bases (N and ?)
ref_bases_coveredReference bases aligned to a base of the species
ref_coverageref_bases_covered divided by the reference bases of all blocks

With more than one input file, SEGUL adds rows with path set to all that combine every file.

OptionDescription
-d, --dirDirectory with .maf and .maf.gz files. Subdirectories are not searched
-i, --inputMAF files
--ref-speciesReference species. Default: the first species in the first block
--speciesSpecies to report, comma-separated
--species-fileFile of species to report, one per line
--full-source-nameUse full MAF source names as sample names
-o, --outputOutput directory. Default: Maf-Summary
--prefixPrefix of the output files. Default: maf_summary
--forceOverwrite an existing output directory
--logLog file path. Default: segul.log

For example, to summarize every MAF file in a directory and name the output files primates_per_file.csv and primates_per_species.csv:

Terminal window
segul maf summary --dir maf/ --prefix primates

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.