cogeqc
Workflows
Standard Workflow
Assess genome assembly and annotation quality by comparing custom statistics against NCBI genomes and evaluating gene space completeness with BUSCO.
library(cogeqc)
# 1. Retrieve and compare genome assembly statistics
maize_stats <- get_genome_stats(taxon = "Zea mays")
my_stats <- data.frame(
accession = "my_lovely_maize",
sequence_length = 2.4 * 1e9,
gene_count_total = 50000,
CC_ratio = 2
)
comparison <- compare_genome_stats(ncbi_stats = maize_stats, user_stats = my_stats)
plot_genome_stats(ncbi_stats = maize_stats, user_stats = my_stats)
# 2. Read and plot BUSCO summary statistics
output_dir <- system.file("extdata", package = "cogeqc")
busco_summary <- read_busco(output_dir)
plot_busco(busco_summary)
Input: Custom genome assembly statistics and BUSCO output directories; Output: Quality control comparison tables and summary visualization plots.
When to Use
- Assessing genome assembly and annotation quality by comparing custom statistics against NCBI genomes using
get_genome_stats, compare_genome_stats, and plot_genome_stats.
- Assessing gene space completeness using BUSCO via
run_busco, read_busco, and plot_busco.
- Assessing orthogroup inference (e.g., from OrthoFinder or OrthoMCL) using a protein domain-based approach with
read_orthogroups and assess_orthogroups.
When NOT to Use
- For performing the actual genome assembly, gene annotation, or orthogroup clustering itself. Use external tools like Flye, Liftoff, or OrthoFinder, then use
cogeqc for downstream quality control.
Data Requirements
- For genome stats: A data frame of user-defined assembly statistics containing at least an
accession column and other matching NCBI fields (e.g., sequence_length, gene_count_total, CC_ratio).
- For BUSCO: A directory containing BUSCO output files or pre-parsed BUSCO summary data frames.
- For orthogroups: An OrthoFinder
Orthogroups.tsv file or a parsed data frame with columns Orthogroup, Species, and Gene.
Key Parameters
- taxon (NULL): Taxon name or NCBI Taxonomy ID to retrieve statistics for in
get_genome_stats.
- filters (NULL): List of key-value pairs to filter NCBI Datasets API results in
get_genome_stats.
- ncbi_stats (NULL): Reference data frame of NCBI genome statistics in
compare_genome_stats and plot_genome_stats.
- user_stats (NULL): Data frame of user-observed genome statistics to compare or highlight.
- lineage (NULL): Lineage dataset name for BUSCO in
run_busco.
- mode (NULL): BUSCO run mode (e.g., "genome") in
run_busco.
- outpath (NULL): Path to directory where BUSCO output will be stored in
run_busco.
- download_path (NULL): Path to directory where BUSCO datasets will be downloaded in
run_busco.
Best Practices
- Use the
CC_ratio (ratio of contigs to chromosome pairs) as a robust measurement of contiguity that allows cross-species comparisons.
- Filter NCBI reference genomes to match your assembly level (e.g., chromosome-scale) and annotation status using the
filters parameter in get_genome_stats.
- Check if BUSCO is installed in your PATH using
busco_is_installed before calling run_busco.
- Consider genomes with >90% complete BUSCOs as high quality when visualizing with
plot_busco.
Common Pitfalls
run_busco failing due to missing system dependencies. Fix: Ensure BUSCO is installed and in your system PATH, or check with busco_is_installed().
- Column mismatch when comparing custom stats with NCBI stats. Fix: Ensure the column names in your custom data frame exactly match the column names returned by
get_genome_stats (e.g., sequence_length instead of genome_size).
Alternatives
quast (external tool) for general genome assembly quality metrics.
OrthoFinder (external tool) for orthogroup inference.
Citations
- Simão FA, Waterhouse RM, Ioannidis P, Kriventseva EV, Zdobnov EM (2015). BUSCO: Assessing Genome Assembly and Annotation Completeness with Single-Copy Orthologs. Bioinformatics.
- Wang P, Wang F (2022). A Proposed Metric Set for Evaluation of Genome Assembly Quality. Trends in Genetics.
References
1---2name: cogeqc3description: cogeqc4---56# cogeqc78## Workflows910### Standard Workflow1112Assess genome assembly and annotation quality by comparing custom statistics against NCBI genomes and evaluating gene space completeness with BUSCO.1314```r15library(cogeqc)1617# 1. Retrieve and compare genome assembly statistics18maize_stats <- get_genome_stats(taxon = "Zea mays")19my_stats <- data.frame(20 accession = "my_lovely_maize",21 sequence_length = 2.4 * 1e9,22 gene_count_total = 50000,23 CC_ratio = 224)25comparison <- compare_genome_stats(ncbi_stats = maize_stats, user_stats = my_stats)26plot_genome_stats(ncbi_stats = maize_stats, user_stats = my_stats)2728# 2. Read and plot BUSCO summary statistics29output_dir <- system.file("extdata", package = "cogeqc")30busco_summary <- read_busco(output_dir)31plot_busco(busco_summary)32```3334*Input: Custom genome assembly statistics and BUSCO output directories; Output: Quality control comparison tables and summary visualization plots.*3536## When to Use37- Assessing genome assembly and annotation quality by comparing custom statistics against NCBI genomes using `get_genome_stats`, `compare_genome_stats`, and `plot_genome_stats`.38- Assessing gene space completeness using BUSCO via `run_busco`, `read_busco`, and `plot_busco`.39- Assessing orthogroup inference (e.g., from OrthoFinder or OrthoMCL) using a protein domain-based approach with `read_orthogroups` and `assess_orthogroups`.4041## When NOT to Use42- For performing the actual genome assembly, gene annotation, or orthogroup clustering itself. Use external tools like Flye, Liftoff, or OrthoFinder, then use `cogeqc` for downstream quality control.4344## Data Requirements45- For genome stats: A data frame of user-defined assembly statistics containing at least an `accession` column and other matching NCBI fields (e.g., `sequence_length`, `gene_count_total`, `CC_ratio`).46- For BUSCO: A directory containing BUSCO output files or pre-parsed BUSCO summary data frames.47- For orthogroups: An OrthoFinder `Orthogroups.tsv` file or a parsed data frame with columns `Orthogroup`, `Species`, and `Gene`.4849## Key Parameters50- **taxon** (NULL): Taxon name or NCBI Taxonomy ID to retrieve statistics for in `get_genome_stats`.51- **filters** (NULL): List of key-value pairs to filter NCBI Datasets API results in `get_genome_stats`.52- **ncbi_stats** (NULL): Reference data frame of NCBI genome statistics in `compare_genome_stats` and `plot_genome_stats`.53- **user_stats** (NULL): Data frame of user-observed genome statistics to compare or highlight.54- **lineage** (NULL): Lineage dataset name for BUSCO in `run_busco`.55- **mode** (NULL): BUSCO run mode (e.g., "genome") in `run_busco`.56- **outpath** (NULL): Path to directory where BUSCO output will be stored in `run_busco`.57- **download_path** (NULL): Path to directory where BUSCO datasets will be downloaded in `run_busco`.5859## Best Practices60- Use the `CC_ratio` (ratio of contigs to chromosome pairs) as a robust measurement of contiguity that allows cross-species comparisons.61- Filter NCBI reference genomes to match your assembly level (e.g., chromosome-scale) and annotation status using the `filters` parameter in `get_genome_stats`.62- Check if BUSCO is installed in your PATH using `busco_is_installed` before calling `run_busco`.63- Consider genomes with >90% complete BUSCOs as high quality when visualizing with `plot_busco`.6465## Common Pitfalls66- `run_busco` failing due to missing system dependencies. Fix: Ensure BUSCO is installed and in your system PATH, or check with `busco_is_installed()`.67- Column mismatch when comparing custom stats with NCBI stats. Fix: Ensure the column names in your custom data frame exactly match the column names returned by `get_genome_stats` (e.g., `sequence_length` instead of `genome_size`).6869## Alternatives70- `quast` (external tool) for general genome assembly quality metrics.71- `OrthoFinder` (external tool) for orthogroup inference.7273## Citations74- Simão FA, Waterhouse RM, Ioannidis P, Kriventseva EV, Zdobnov EM (2015). BUSCO: Assessing Genome Assembly and Annotation Completeness with Single-Copy Orthologs. Bioinformatics.75- Wang P, Wang F (2022). A Proposed Metric Set for Evaluation of Genome Assembly Quality. Trends in Genetics.7677## References78- Homepage: bioconductor.org/packages/cogeqc79- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/cogeqc/inst/doc/genome_assembly_annotation_completeness.html