How wyp1125/mcscanx works
Project type and purpose
• MCScanX is a command-line bioinformatics toolkit for detecting and analyzing syntenic (collinear) gene blocks across genomes.
• It consists of:
• Core C/C++ executables implementing a modified MCScan algorithm (MCScanX, MCScanX_h, duplicate_gene_classifier, plus helper executables like dagchainer, msa, etc.)
• A suite of downstream analysis tools in Java and Perl for plotting and further analyses.
File structure
• Top-level C/C++ source files and headers (*.cc, *.h), makefile, cls.cc/h, dagchainer.cc/h, core modules (mcscan.cc/h, dup_classifier.cc/h, etc.).
• data/ directory holds example input files (.blast, .gff, .tree, .txt).
• downstream_analyses/ directory with Java files (*.java), Perl scripts (*.pl), control files (*.ctl), and its own makefile.
• Configuration: root makefile for building native binaries, .github/workflows/ci.yaml for CI on GitHub.
README insights
• Core executables accept BLASTP output (.blast or .homology) and gene annotation (.gff), generate .synteny text files and HTML alignments.
• Downstream tools consume .synteny, .gff, control files, family/tree files, and produce plots (PNG, JPEG), enriched text outputs.
• Dependencies: Linux/Mac OS, C++ compiler, Java JDK, Perl, BLAST toolkit, BioPerl.
Main components
a. Build Layer
• Source Code (C++ modules, Java, Perl)
• Build Tools: GNU Make, compilers (g++, javac), CI pipeline (GitHub Actions)
b. Core CLI Executables
• MCScanX family (C++ binaries)
• duplicate_gene_classifier (C++ binary)
• Helper tools (detect_collinear_tandem_arrays, dissect_multiple_alignment, etc. in C++)
c. Downstream Analysis Tools
• Java applications (dot_plotter, dual_synteny_plotter, circle_plotter, bar_plotter, family_circle_plotter, family_tree_plotter)
• Perl scripts (add_ka_and_ks_to_synteny.pl, group_collinear_genes.pl, etc.)
d. Data Flow
• Input data: BLASTP outputs (.blast), homology files (.homology), GFF annotations, CDS FASTA, control files (.ctl), gene family files, tree files
• Core algorithm processing → .synteny files + HTML output
• Downstream tools consume .synteny + additional inputs → PNG/JPEG plots, text analytics
e. External Dependencies
• BLAST executables, Java runtime, Perl interpreter, BioPerl, web browser (for HTML).
Relationships and interactions
• The Build Layer compiles sources into native and Java binaries.
• Core executables read .blast/.homology + .gff → produce .synteny + HTML alignments.
• Downstream tools are invoked one by one (or chained in scripts/makefiles), each reading .synteny + control inputs → producing plots or tabular results.
• Data files can be pre-stored in data/ or user-provided; outputs go to user-specified directories.
Architectural patterns and design principles
• Modular CLI pipeline: each tool focuses on a single responsibility (core synteny detection vs. specific analyses/plots).
• Separation of concerns: C++ for performance-critical algorithms, Java for visualization GUIs/plotting logic, Perl for text parsing and statistical analyses.
• Pluggable downstream modules: users can add new Perl/Java scripts that follow the same input/output conventions.
• Build/devops integration: single Makefile for native code, a downstream Makefile for additional tools, CI config for automated builds/tests.
Detail without over-fragmentation
• Interactions (data flows) for representative tools like dot_plotter.java and add_kaks_to_synteny.pl to illustrate the pattern.