<jupyter_start><jupyter_text>Table of Contents1&nbsp;&nbsp;Goal2&nbsp;&nbsp;Var3&nbsp;&nbsp;Init4&nbsp;&nbsp;Load5&nbsp;&nbsp;n1005.1&nbsp;&nbsp;Struo15.1.1&nbsp;&nbsp;Kraken/Bracken + UniRef505.1.1.1&nbsp;&nbsp;Config5.1.1.2&nbsp;&nbsp;Run5.1.2&nbsp;&nbsp;UniRef905.1.2.1&nbsp;&nbsp;Config5.1.2.2&nbsp;&nbsp;Run5.2&nbsp;&nbsp;Struo25.2.1&nbsp;&nbsp;Config5.2.2&nbsp;&nbsp;Run6&nbsp;&nbsp;n5006.1&nbsp;&nbsp;Struo16.1.1&nbsp;&nbsp;Kraken/Bracken + UniRef506.1.1.1&nbsp;&nbsp;Config6.1.1.2&nbsp;&nbsp;Run6.1.2&nbsp;&nbsp;UniRef906.1.2.1&nbsp;&nbsp;Config6.1.2.2&nbsp;&nbsp;Run6.2&nbsp;&nbsp;Struo26.2.1&nbsp;&nbsp;Config6.2.2&nbsp;&nbsp;Run7&nbsp;&nbsp;n10007.1&nbsp;&nbsp;Struo17.1.1&nbsp;&nbsp;Kraken/Bracken + UniRef507.1.1.1&nbsp;&nbsp;Config7.1.1.2&nbsp;&nbsp;Run7.1.2&nbsp;&nbsp;UniRef907.1.2.1&nbsp;&nbsp;Config7.1.2.2&nbsp;&nbsp;Run7.2&nbsp;&nbsp;Struo27.2.1&nbsp;&nbsp;Config7.2.2&nbsp;&nbsp;Run8&nbsp;&nbsp;Summary8.1&nbsp;&nbsp;CPU hours8.2&nbsp;&nbsp;Genes annotated8.2.1&nbsp;&nbsp;Struo18.2.2&nbsp;&nbsp;Struo29&nbsp;&nbsp;sessionInfo  Goal* Comparing how long Struo v1 & Struo v2 take to annotate both UniRef50 + UniRef90 sequences  Var<jupyter_code>work_dir = '/ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/'

# GTDB metadata (1 genome per species)
metadata_file = '/ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/metadata_1per-GTDB-Spec_gte50comp-lt5cont_wtaxID_wPath.tsv'

# mapping
map_dir = '/ebio/abt3_projects/databases_no-backup/humann3/201901/utility_mapping/'
map_pfam_file = file.path(map_dir, 'map_pfam_uniref50.txt.gz')
map_eggnog_file = file.path(map_dir, 'map_eggnog_uniref50.txt.gz')
map_go_file = file.path(map_dir, 'map_go_uniref50.txt.gz')

# params
threads = 8<jupyter_output><empty_output><jupyter_text>Init<jupyter_code>library(dplyr)
library(tidyr)
library(ggplot2)
library(data.table)
library(tidytable)
library(LeyLabRMisc)
set.seed(6471)
setDTthreads(threads)
make_dir(work_dir)
df.dims()<jupyter_output>Directory already exists: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/<jupyter_text>Load<jupyter_code>meta = Fread(metadata_file)
meta<jupyter_output><empty_output><jupyter_text>n100<jupyter_code>to_keep = sample(1:nrow(meta), 100)
meta_f = meta %>%
    slice.(rows=to_keep)
meta_f
F = file.path(work_dir, 'n100', 'genome_meta_n100.tsv')
meta_f %>% write_table(F)<jupyter_output>File written: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/genome_meta_n100.tsv<jupyter_text>Struo1  Kraken/Bracken + UniRef50  Config<jupyter_code>config_file = file.path(work_dir, 'n100', 'struo1', 'config_uniref50.yaml')
cat_file(config_file)<jupyter_output>#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/genome_meta_n100.tsv 

## column names in samples table
samples_col: 'ncbi_organism_name'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'ncbi_species_taxid'    
taxonomy_col: 'ncbi_taxonomy'   

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/struo1/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Create
  bracken: Create
  humann2_bowtie2: Create
  humann2_diamond: Create

# output database name
db_name: GTDB-custom

#-- keep intermediate files required for re-creating DBs (eg., w/ more genomes) --#
# If "True", the in[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/Struo$ screen -L -S struo-bmk ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/struo1/config_uniref50.yaml 50 -F```  UniRef90  Config<jupyter_code>config_file = file.path(work_dir, 'n100', 'struo1', 'config_uniref90.yaml')
cat_file(config_file)<jupyter_output>#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/genome_meta_n100.tsv 

## column names in samples table
samples_col: 'ncbi_organism_name'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'ncbi_species_taxid'    
taxonomy_col: 'ncbi_taxonomy'   

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/struo1/uniref90/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Skip #Create
  bracken: Skip #Create
  humann2_bowtie2: Create
  humann2_diamond: Create

# output database name
db_name: GTDB-custom

#-- keep intermediate files required for re-creating DBs (eg., w/ more genomes) --[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/Struo$ screen -L -S struo-bmk ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/struo1/config_uniref90.yaml 50 -F```  Struo2  Config<jupyter_code>config_file = file.path(work_dir, 'n100', 'struo2', 'config_db-create.yaml')
cat_file(config_file)<jupyter_output>#-- email notifications of pipeline success/failure (use "Skip" to deactivate) --#
email: <EMAIL>

#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/genome_meta_n100.tsv

## column names in samples table
samples_col: 'ncbi_organism_name'
accession_col: 'accession'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'gtdb_taxid'          # or 'ncbi_species_taxid'
taxonomy_col: 'gtdb_taxonomy'    # or 'ncbi_taxonomy' 

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/struo2/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Create
  bracken: Create
  genes: Cr[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/struo2_1$ screen -L -S struo2-bmk-n100 ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n100/struo2/config_db-create.yaml 50 -F```  n500<jupyter_code>#' selecting genomes
to_keep = sample(1:nrow(meta), 500)
meta_f = meta %>%
    slice.(rows=to_keep)
meta_f
F = file.path(work_dir, 'n500')
make_dir(F)
F = file.path(work_dir, 'n500', 'genome_meta_n500.tsv')
meta_f %>% write_table(F)<jupyter_output>Created directory: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500 
File written: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/genome_meta_n500.tsv<jupyter_text>Struo1  Kraken/Bracken + UniRef50  Config<jupyter_code>config_file = file.path(work_dir, 'n500', 'struo1', 'config_uniref50.yaml')
cat_file(config_file)<jupyter_output>#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/genome_meta_n500.tsv 

## column names in samples table
samples_col: 'ncbi_organism_name'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'ncbi_species_taxid'    
taxonomy_col: 'ncbi_taxonomy'   

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/struo1/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Create
  bracken: Create
  humann2_bowtie2: Create
  humann2_diamond: Create

# output database name
db_name: GTDB-custom

#-- keep intermediate files required for re-creating DBs (eg., w/ more genomes) --#
# If "True", the in[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/Struo$ screen -L -S struo1-bmk-n500 ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/struo1/config_uniref50.yaml 50 -F```  UniRef90  Config<jupyter_code>config_file = file.path(work_dir, 'n500', 'struo1', 'config_uniref90.yaml')
cat_file(config_file)<jupyter_output>#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/genome_meta_n500.tsv 

## column names in samples table
samples_col: 'ncbi_organism_name'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'gtdb_taxid'    
taxonomy_col: 'gtdb_taxonomy'   

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/struo1/uniref90/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Skip #Create
  bracken: Skip #Create
  humann2_bowtie2: Create
  humann2_diamond: Create

# output database name
db_name: GTDB-custom

#-- keep intermediate files required for re-creating DBs (eg., w/ more genomes) --#
# If "[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/Struo$ screen -L -S struo1-bmk-n500 ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/struo1/config_uniref90.yaml 50 -F```  Struo2  Config<jupyter_code>config_file = file.path(work_dir, 'n500', 'struo2', 'config_db-create.yaml')
cat_file(config_file)<jupyter_output>#-- email notifications of pipeline success/failure (use "Skip" to deactivate) --#
email: <EMAIL>

#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/genome_meta_n500.tsv

## column names in samples table
samples_col: 'ncbi_organism_name'
accession_col: 'accession'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'gtdb_taxid'          # or 'ncbi_species_taxid'
taxonomy_col: 'gtdb_taxonomy'    # or 'ncbi_taxonomy' 

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/struo2/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Create
  bracken: Create
  genes: Cr[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/struo2_1$ screen -L -S struo2-bmk-n500 ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n500/struo2/config_db-create.yaml 50 -F```  n1000<jupyter_code>to_keep = sample(1:nrow(meta), 1000)
meta_f = meta %>%
    slice.(rows=to_keep)
meta_f
F = file.path(work_dir, 'n1000', 'genome_meta_n1000.tsv')
meta_f %>% write_table(F)<jupyter_output>File written: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/genome_meta_n1000.tsv<jupyter_text>Struo1  Kraken/Bracken + UniRef50  Config<jupyter_code>file.path(work_dir, 'n1000', 'struo1', 'config_uniref50.yaml')
config_file = file.path(work_dir, 'n1000', 'struo1', 'config_uniref50.yaml')
cat_file(config_file)<jupyter_output>#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/genome_meta_n1000.tsv 

## column names in samples table
samples_col: 'ncbi_organism_name'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'gtdb_taxid'    
taxonomy_col: 'gtdb_taxonomy'   

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/struo1/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Create
  bracken: Create
  humann2_bowtie2: Create
  humann2_diamond: Create

# output database name
db_name: GTDB-custom

#-- keep intermediate files required for re-creating DBs (eg., w/ more genomes) --#
# If "True", the interme[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/Struo$ screen -L -S struo1-bmk-n1k ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/struo1/config_uniref50.yaml 50 -F```  UniRef90  Config<jupyter_code>config_file = file.path(work_dir, 'n1000', 'struo1', 'config_uniref90.yaml')
cat_file(config_file)<jupyter_output>#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/genome_meta_n1000.tsv 

## column names in samples table
samples_col: 'ncbi_organism_name'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'gtdb_taxid'    
taxonomy_col: 'gtdb_taxonomy'   

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/struo1/uniref90/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Skip #Create
  bracken: Skip #Create
  humann2_bowtie2: Create
  humann2_diamond: Create

# output database name
db_name: GTDB-custom

#-- keep intermediate files required for re-creating DBs (eg., w/ more genomes) --#
# I[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/Struo$ screen -L -S struo1-bmk-n1000 ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/struo1/config_uniref90.yaml 50 -F```  Struo2  Config<jupyter_code>config_file = file.path(work_dir, 'n1000', 'struo2', 'config_db-create.yaml')
cat_file(config_file)<jupyter_output>#-- email notifications of pipeline success/failure (use "Skip" to deactivate) --#
email: <EMAIL>

#-- I/O --#
# file listing samples and associated data
samples_file: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/genome_meta_n1000.tsv

## column names in samples table
samples_col: 'ncbi_organism_name'
accession_col: 'accession'
fasta_file_path_col: 'fasta_file_path'
taxID_col: 'gtdb_taxid'          # or 'ncbi_species_taxid'
taxonomy_col: 'gtdb_taxonomy'    # or 'ncbi_taxonomy' 

# output location
output_dir: /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/struo2/

# temporary file directory (your username will be added automatically)
tmp_dir: /ebio/abt3_scratch/

#-- databases to create --#
# Replace "Create" with "Skip" to skip creation of any of these
# Note that braken relies on the kraken2 database
databases:
  kraken2: Create
  bracken: Create
  genes:[...]<jupyter_text>Run```(snakemake) @ rick:/ebio/abt3_projects/databases_no-backup/bin/struo2_1$ screen -L -S struo2-bmk-n1k ./snakemake_sge.sh /ebio/abt3_projects/databases_no-backup/GTDB/release95/Struo/benchmarking/db_create/UniRef50-90/n1000/struo2/config_db-create.yaml 50 -F```  Summary  CPU hours<jupyter_code>#' reading in benchmark all files 
read_bmk = function(F){
    df = read.delim(F, sep='\t')
    df$file = basename(F)
    df$rule = basename(dirname(F))
    return(df)
}
#' listing & reading in all benchmark files from a base path
read_bmks = function(F){
    df = list_files(F, '*.txt') %>%
        lapply(read_bmk) %>%
        do.call(rbind, .)
    if(grepl('uniref[0-9]+/benchmarks', F)){
        df$dataset = F %>% dirname %>% dirname %>% dirname %>% basename
        df$pipeline = F %>% dirname %>% dirname %>% basename
    } else {
        df$dataset = F %>% dirname %>% dirname %>% basename
        df$pipeline = F %>% dirname %>% basename
    }

    return(df)
}
# reading in all benchmark files
L = list(
    file.path(work_dir, 'n100', 'struo1', 'benchmarks'),
    file.path(work_dir, 'n100', 'struo1', 'uniref90', 'benchmarks'),
    file.path(work_dir, 'n500', 'struo1', 'benchmarks'),
    file.path(work_dir, 'n500', 'struo1', 'uniref90', 'benchmarks'),
    file.path(work_dir, 'n1000', 'struo1', 'benchmarks'),
    file.path(work_dir, 'n1000', 'struo1', 'uniref90', 'benchmarks'),
    file.path(work_dir, 'n100', 'struo2', 'benchmarks'),
    file.path(work_dir, 'n500', 'struo2', 'benchmarks'),
    file.path(work_dir, 'n1000', 'struo2', 'benchmarks')
) 
bmk = L %>%
    lapply(read_bmks) %>%
    do.call(rbind, .)
bmk
# records per dataset
bmk %>%
    group_by(dataset, pipeline) %>%
    summarize(n = n(), .groups='drop')
#' cpu hours
bmk_s = bmk %>%
    group_by(dataset, pipeline) %>%
    summarize(cpu_hours = sum(s) / (60 * 60),
              .groups='drop')
df.dims(20)
bmk_s %>% arrange(dataset, pipeline)
df.dims()
#' cpu hours: plotting
p = bmk_s %>%
    mutate(pipeline = gsub('^s', 'S', pipeline),
           dataset = gsub('^n', '', dataset) %>% as.Num) %>%
    ggplot(aes(dataset, cpu_hours, color=pipeline)) +
    geom_smooth(method='lm', level = 0.9, alpha = 0.2, size=0.5, linetype='dashed') +
    geom_point() +    
    scale_color_discrete('Struo\nVersion') +
    scale_x_continuous(breaks=c(100, 500, 1000)) +
    labs(x='No. of genomes', y='CPU hours') +
    theme_bw()

p.dims(5,3)
plot(p)
# linear model
bmk_s %>%
    filter(pipeline == 'struo1') %>%
    mutate(dataset = gsub('^n', '', dataset) %>% as.Num) %>%
    lm(cpu_hours ~ dataset, data=.) %>%
    summary
# time for all GTDBr95 genomes (n = 30989)
45.68 + 2.44119 * 30989
# linear model
bmk_s %>%
    filter(pipeline == 'struo2') %>%
    mutate(dataset = gsub('^n', '', dataset) %>% as.Num) %>%
    lm(cpu_hours ~ dataset, data=.) %>%
    summary
# time for all GTDBr95 genomes (n = 30989)
46.83 + 0.66850 * 30989<jupyter_output><empty_output><jupyter_text>Genes annotated  Struo1<jupyter_code>F = file.path(work_dir, 'n100', 'struo1', 'humann2', 'GTDB-custom', 'all_genes_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')
F = file.path(work_dir, 'n100', 'struo1', 'uniref90', 'humann2', 'GTDB-custom', 'all_genes_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')
F = file.path(work_dir, 'n500', 'struo1', 'humann2', 'GTDB-custom', 'all_genes_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')
F = file.path(work_dir, 'n500', 'struo1', 'uniref90', 'humann2', 'GTDB-custom', 'all_genes_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')
F = file.path(work_dir, 'n1000', 'struo1', 'humann2', 'GTDB-custom', 'all_genes_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')
F = file.path(work_dir, 'n1000', 'struo1', 'uniref90', 'humann2', 'GTDB-custom', 'all_genes_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')<jupyter_output>2227466<jupyter_text>Struo2<jupyter_code>F = file.path(work_dir, 'n100', 'struo2', 'humann3', 'uniref90', 'genome_reps_filt_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')
F = file.path(work_dir, 'n500', 'struo2', 'humann3', 'uniref90', 'genome_reps_filt_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')
F = file.path(work_dir, 'n1000', 'struo2', 'humann3', 'uniref90', 'genome_reps_filt_annot.faa.gz')
cmd = glue::glue("gunzip -c {F} | grep -c '>'", F=F)
bash_job(cmd, conda_env = 'base')
# formatting
df = data.frame(n_genomes = c(100, 500, 1000),
                Struo1 = c(224221, 1109346, 2227466),
                Struo2 = c(228222, 1130013, 2270402)) %>%
    gather(version, genes_annot, -n_genomes)
df
# plotting
p = df %>%
    mutate(n_genomes = n_genomes %>% as.character %>% reorder(n_genomes %>% as.Num)) %>%
    ggplot(aes(n_genomes, genes_annot, fill=version)) +
    geom_bar(stat='identity', position='dodge') +
    scale_fill_discrete('Struo\nversion') +
    labs(y='No. of annotated genes', x='No. of genomes') +
    theme_bw()

p.dims(4,2.2)
plot(p)<jupyter_output><empty_output><jupyter_text>sessionInfo<jupyter_code>pipelineInfo('/ebio/abt3_projects/databases_no-backup/bin/Struo/')
pipelineInfo('/ebio/abt3_projects/databases_no-backup/bin/struo2_1')
sessionInfo()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14534293362872705, 'fraction_numerical': 0.048878427028523956, 'mean_word_length': 5.4141503848431025, 'pattern_counts': {'":': 0, '<': 66, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '19', 'dir': 'jupyter-structured-clean-dedup', 'id': '652792', 'license': 'MIT', 'n_tokens_mistral': 9406, 'n_tokens_neox': 8707, 'n_words': 1458, 'path': 'notebooks/GTDB_release95/02_struo_version_db-create_benchmarking/01_benchmarking_UniRef50-90_db-create.ipynb', 'repo_name': 'leylabmpi/Struo2', 'size': '21726'}