Package: pangtreebuild
PangtreeeBuildThis repository contains tool for multiple sequence alignment analysis. It implements the idea of pan-genome (Ref. 1) by representing the multialignment as a PO-MSA structure (Partial Order Alignment Graph -Ref. 2). The main purpose of this software is to construct anAffinity Tree- a phylogenetic-like tree, with an agreed sequence (consensus sequence) assigned for each node. The result is saved in JSON file (see its schema in pangtree/pangtreebuild/serialization/affinity_tree_schema.json). Its content can be visualised usingPangtreeVis.This software is a part of the article: P.Dziadkiewicz, N.Dojer 'Getting insight into the pan-genome structure with Pangtree' that will be published soon in BMC Genomics.Getting StartedPrerequisitesRunning:Python 3.8BioPythonnumpyjsonpicklenetworkxTesting:DDTInstallingpip install pangtreebuildQuick installation checkThis line builds a pan-genome model for an example alignment of 160 Ebola virus sequences and saves it to a JSON file.python3 -m pangtreebuild --multialignment example_data/Ebola/multialignment.mafUsageImport packagepangtreebuildto your Python program and use it according to the documentation.orUsepangtreebuildvia command line with following arguments:python3 -m pangtreebuild [args]NameCLIRequiredDescriptionArguments affecting PO-MSA construction:MULTIALIGNMENT--multialignmentYesPath to the mulitalignment file (.maf or .po)METADATA--metadataNoOptional information about sequences in csv format. The only required column: 'seqid' and its value must match multialignment files identifiers as described inSequence Naming Convention(below). Example: example_data/Ebola/metadata.csvRAW_MAF--raw_mafNo, default=FalseBuild PO-MSA without transforming multialignment (MAF file) to DAG. PO-MSA built in this way does not reflect real life sequences.FASTA_PROVIDER--fasta_providerNoNucleotides source if any residues are missed in the multialignment file. Possible values: 'ncbi', 'file'. If not specified: MISSING_NUCLEOTIDE is used.MISSING_SYMBOL--missing_symbolNo, default='?'Symbol for missing nucleotides used if no FASTA_PROVIDER is given.CACHE--cacheNoIf set, sequences downloaded from NCBI are stored on local disc and reused between program calls, used if FASTA_PROVIDER is 'ncbi'FASTA_PATH-fasta_pathYes if FASTA_PROVIDER='FILE'Path to fasta file or zipped fasta files with whole sequences present in multialignment, used if FASTA_PROVIDER is 'FILE'.Arguments affecting Affinity Tree construction:AFFINITY-affinityNoPossible values: 'TREE' (default algorithm, descibed in Documentation.md), 'POA' (simplified version, based solely on Ref. 2)BLOSUM--blosumNo, default=bin\blosum80.matPath to the blosum filem. Blosum file must include MISSING_NUCLEOTIDE.HBMIN--hbminNo, default=0.9'POA' parameter. The minimum value of sequence compatibility to generated consensus.STOP--stopNo, default=0.99'TREE' parameter. Minimum value of compatibility in tree leaves.P-pNo, default=1'TREE' parameter. It changes the linear meaning of compatiblities during cutoff finding because the compatibilities are raised to the power o P. For P from range [0,1] it decreases distances between small compatibilities and increases distances between the bigger ones. For p > 1 it increases distances between small compatibilities and decreases distances between the bigger ones.Arguments affecting output generation:OUTPUT_DIR--output_dir, -oNo, default=timestamped folder in current working directoryOutput directory path.OUTPUT_FULL--output_fullNo, default=FalseSet, if list of pangenome nodes for sequences and consensuses should be included in pangenome.json.VERBOSE--verbose, -vNo, default=FalseSet if detailed log files must be produced.QUIET--quiet, -qNo, default=FalseSet to turn off console logging.FASTA--output_fastaNo, default=FalseSet to create fasta files with consensuses.PO-output_poNo, default=FalseSet to create po file with multialignment (without consensuses).Sequence Naming Convention[seqid].[anything after first dot is ignored]Example use casesBuild PO-MSA using default settings (transform to DAG, download missing nucleotides from NCBI) and save to .po file :python -m pangtreebuild --multialignment example_data/Ebola/multialignment.maf -powill produce:pangenome.jsonpoagraph.poGenerate Affinity Tree, use metadata, detailed logging and default algorithm settings.python3 -m pangtreebuild --multialignemnt example_data/Ebola/multialignment.maf -metadata example_data/Ebola/metadata.csv -affinity tree -vwill produce:pangenome.jsondetails.logaffinitytree/tresholds.csv.po files from internal calls to poa softwareTestspython3 -m unittest discover -s pangtreebuild -p tests_*ornosetests pangtreebuildAuthorsThis software is developed with support ofOPUS 11 scientific project of National Science Centre:  Incorporating genomic variation information
into DNA sequencing data analysisLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsBibliographyComputational pan-genomics: status, promises and challengesThe Computational Pan-Genomics Consortium. Briefings in Bioinformatics, Volume 19, Issue 1, January 2018, Pages 118–135.Generating consensus sequences from partial order multiple sequence alignment graphsC. Lee, Bioinformatics, Volume 19, Issue 8, 22 May 2003, Pages 999–1008