vampire.anno.pp.read_anno

Contents

vampire.anno.pp.read_anno#

vampire.anno.pp.read_anno(file, use_raw=False, match_score=2, mismatch_penalty=4, gap_open_penalty=7, gap_extend_penalty=4)[source]#

Read a vampire annotation result file using pysam and polars.

Parameters:
  • file (str) – Path to the input annotation result file. e.g. example.annotation.tsv

  • use_raw (bool) – Whether to read the real sequences instead of annotated motifs. This may dramatically increase the number of motifs. Default is False.

Returns:

An AnnData object containing the annotation result. Each row (obs) is a sample, each column (var) is a motif.

Return type:

AnnData

Notes

Indexing:
  • obs index corresponds to samples (chrom)

  • var index corresponds to motifs

  • X[i, j] aligns with obs[i] and var[j]

Structure:

X:
    (n_obs × n_var) motif abundance / copy-number matrix
    X[i, j] = copy number of motif j in chromosome i

obs:
    Sample metadata (n_obs × metadata)
    - length : int
    - copy_number : float
    - score : int

var:
    Motif metadata (n_var × metadata)
    - motif : str
    - motif_length : int
    - copy_number : float
    - label : str

varp:
    Motif-level pairwise relations (n_var × n_var)
    - motif_distance : int
    - rc_motif_distance : int

uns:
    Unstructured genomic annotations (not aligned to X)
    - sequence : dict[str, str]
    - motif_array : dict[str, list[str]]
    - orientation_array : dict[str, list[str]]