Skip to main content

Annotation

Struct Annotation 

Source
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

Source

pub fn new() -> Self

Initializes an empty annotation store.

Source

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.
Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.