# ORF-level mapping of the 15 host-region viral-contig candidates (R2-V32-001 investigation)
# (formerly labelled "Ambiguous"; now Table S20 category NoTR_HostRegion_ORF_in_ViralRegion)
# Date: 2026-11-06. Sources (all on VM, no laptop files needed):
#  - CheckV contamination.tsv (uploaded by user): region_coords_bp + region_coords_genes
#    per contig (host vs viral regions, from CheckV's contamination module).
#  - Table_S20_provenance.tsv: the 15 Protein_IDs in category NoTR_HostRegion_ORF_in_ViralRegion (ACC_N, N = gene index).
#  - prophage_all.tsv col6 (n_genes): geNomad gene count per contig.
#
# VALIDATION of the gene-index alignment:
# geNomad n_genes == CheckV total_genes for ALL 12 host-region contigs
# (25/25, 4/4, 3/3, 3/3, 54/54, 4/4, 56/56, 26/26, 3/3, 34/34, 67/67, 59/59).
# Both callers found the same number of genes in the same order on each contig,
# so the sequential gene numbering aligns and the gene-index mapping is sound.
# Caveat: this is a gene-index mapping, not nucleotide-coordinate mapping.
# Nucleotide coordinates would need the geNomad gene file or the contig FASTA
# (laptop); the identical gene counts make the index mapping reliable.
#
# RESULT: all 15 lysin ORFs fall inside the CheckV viral region.
# None falls in a host region.
#
# Protein_ID                    Contig                    Gene  CheckV regions (genes)        Verdict
# ----------------------------  ------------------------  ----  ----------------------------  -------
AAAEIF010000063.1_5             AAAEIF010000063.1         5     host 1-2, viral 3-25         VIRAL
AADPTC010000258.1_3             AADPTC010000258.1         3     host 1-1, viral 2-4          VIRAL
AAWMXL010000042.1_3             AAWMXL010000042.1         3     host 1-1, viral 2-3          VIRAL
ABAOAT010000055.1_3             ABAOAT010000055.1         3     host 1-1, viral 2-3          VIRAL
ABJIWS010000045.1_25            ABJIWS010000045.1         25    viral 1-50, host 51-54       VIRAL
DAASMK010000221.1_2             DAASMK010000221.1         2     viral 1-3, host 4-4          VIRAL
DBAJLR010000020.1_28            DBAJLR010000020.1         28    viral 1-51, host 52-56       VIRAL
DBAJLR010000020.1_8             DBAJLR010000020.1         8     viral 1-51, host 52-56       VIRAL
DBBBDJ010000073.1_5             DBBBDJ010000073.1         5     host 1-2, viral 3-26         VIRAL
DBBDTU010000100.1_3             DBBDTU010000100.1         3     host 1-1, viral 2-3          VIRAL
DBNTQM010000031.1_2             DBNTQM010000031.1         2     viral 1-29, host 30-34       VIRAL
DBNTQM010000031.1_20            DBNTQM010000031.1         20    viral 1-29, host 30-34       VIRAL
JBUATD010000007.1_14            JBUATD010000007.1         14    viral 1-65, host 66-67       VIRAL
RLPJ01000032.1_29               RLPJ01000032.1            29    viral 1-54, host 55-59       VIRAL
RLPJ01000032.1_10               RLPJ01000032.1            10    viral 1-54, host 55-59       VIRAL
#
# CONCLUSION (applied in v3.3; updated in v3.4):
# The 15 candidates are ORF-verified inside CheckV viral regions and are
# labelled NoTR_HostRegion_ORF_in_ViralRegion in Table S20 and in the manuscript;
# they are NOT host-derived. The former "Ambiguous" set is therefore empty except
# the single Unresolved 255-bp fragment (JBRBKV010000082.1_2).
# 531 of the 532 viral-contig candidates are CheckV-classified (516 with no host
# region detected + 15 verified inside viral regions); only the 1 fragment remains
# Unresolved. This strengthens the two-population story.
# Caveat (unchanged): the mapping is by gene index, not nucleotide coordinates;
# nucleotide coordinates would need the geNomad gene file or the contig FASTA.
# Do NOT call all 532 independently validated: 531 are CheckV-classified and 1
# (the 255-bp fragment) is unresolved.
