pub struct Annotation {
pub chr_exon_start_map: HashMap<String, String>,
pub chr_exon_end_map: HashMap<String, String>,
pub chr_exon_start_index: HashMap<String, HashMap<i32, (String, char)>>,
pub chr_exon_end_index: HashMap<String, HashMap<i32, (String, char)>>,
pub gene_exon_map: HashMap<String, Vec<(i32, i32)>>,
pub gene_transcript_exon_map: HashMap<String, Vec<Vec<(i32, i32)>>>,
pub transcript_splice_map: HashSet<String>,
pub transcript_splice_index: HashMap<String, HashMap<char, HashSet<(i32, i32)>>>,
pub chr_gene_map: HashMap<String, Vec<GeneSpan>>,
}Expand description
Parsed GTF-derived lookup tables used during BSJ validation and final labeling.
The current representation is intentionally string-keyed because Scan1 hot
paths already build Java-shaped "chr\tpos" keys; keeping that contract avoids
repeated format conversions during parity-sensitive checks.
Fields§
§chr_exon_start_map: HashMap<String, String>Maps from genomic coordinate string (“Chr\tStart”) to its exon metadata (“GeneID\tStrand”).
chr_exon_end_map: HashMap<String, String>Maps from genomic coordinate string (“Chr\tEnd”) to its exon metadata (“GeneID\tStrand”).
chr_exon_start_index: HashMap<String, HashMap<i32, (String, char)>>Numeric exon-start lookup for post-Summary CIRI-AS boundary correction.
Scan1/Scan2 keep using the Java-shaped string maps above for parity.
Segments reconstruction tests thousands of nearby splice-site candidates,
so it uses this side index to avoid formatting "chr\tpos" strings in
the hot loop.
chr_exon_end_index: HashMap<String, HashMap<i32, (String, char)>>Numeric exon-end lookup for post-Summary CIRI-AS boundary correction.
gene_exon_map: HashMap<String, Vec<(i32, i32)>>Maps from Gene ID to a vector of its exons (as start and end pairs).
gene_transcript_exon_map: HashMap<String, Vec<Vec<(i32, i32)>>>Transcript-consistent exon chains grouped by gene ID.
gene_exon_map keeps the historical gene-level union used by Summary
fallback labels. Full-length sidecar reconstruction needs a stricter
projection source, because mixing all transcript exons from one gene can
create impossible exon chains inside unsupported blocks.
transcript_splice_map: HashSet<String>Transcript-consistent introns keyed as chr\tleft_exon_end\tright_exon_start\tstrand.
This is intentionally a side lookup rather than a replacement for the Java-shaped exon-boundary maps above: CIRI3 parity paths still need the boundary-only behavior, while CIRI-AS read-level segments can use adjacent exon pairs from the same transcript to resolve ambiguous splice offsets.
transcript_splice_index: HashMap<String, HashMap<char, HashSet<(i32, i32)>>>Numeric transcript-consistent splice-pair index for CIRI-AS hot loops.
chr_gene_map: HashMap<String, Vec<GeneSpan>>Groups genes by chromosome with their outer exon span for Summary’s exon/intron/intergenic fallback labeling.
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn read_gtf(&mut self, annotation_file: &str) -> Result<()>
pub fn read_gtf(&mut self, annotation_file: &str) -> Result<()>
Reads a GTF file and populates the exon-boundary lookup tables.
Only exon features are retained because the rest of the pipeline only
needs exon boundary membership and gene IDs for parity with CIRI3.
§Arguments
annotation_file- Path to the input GTF file.
Sourcepub fn find_exon_match(
&self,
chr: &str,
tmp_site1: i32,
tmp_site2: i32,
adjt_bp: i32,
) -> Option<(i32, String, String, String)>
pub fn find_exon_match( &self, chr: &str, tmp_site1: i32, tmp_site2: i32, adjt_bp: i32, ) -> Option<(i32, String, String, String)>
Checks whether a shifted junction pair matches known exon boundaries.
This helper is mainly useful for tests and experiments; Scan1’s hot path now performs the same lookup inline to stay closer to Java branch order.
§Arguments
chr- Chromosome name.tmp_site1- Predicted upstream junction coordinate.tmp_site2- Predicted downstream junction coordinate.adjt_bp- Range of shift offsets to check.
§Returns
Some(shift, strand, donor_placeholder, acceptor_placeholder) if a match is found.
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more