Skip to contents

Get match results as a column of counts appended to a differential expression results data.frame

Usage

.get_counts_column(
  res,
  target.seq,
  seqs,
  seed.name,
  col.name = NULL,
  shared_genes = TRUE,
  max.mismatch = 0,
  with.indels = F,
  fixed = F
)

Arguments

res

Input differential expression results data.frame

target.seq

Pattern to search for in seqs

seqs

The DNAStringSet to be search for instances of the target.seq

seed.name

The seed name to be reported in the data.frame column called seed

col.name

The optional name of the column of match counts. Will default to seed.name if not set

shared_genes

If true, the tx set is reduced to overlapping features in both the sequences db and in the DE data.

max.mismatch

Number of allowed mismatches or the total edit distance

with.indels

If True, include indels

fixed

Require that each sequence symbol matches when searching. Should be FALSE if using wobbles.

Value

A column of match counts for each gene in res

Examples

if (FALSE) { # interactive()

guide.seq = "UUAUAGAGCAAGAACACUGUUUU"

get_example_data("sirna")

sirna.data = load_example_data("sirna")

res <- sirna.data$Schlegel_2022_Ttr_D1_30mkg

#Load test data
res <- Schlegel_2022_Ttr_D1_30mkg

# Filter results for SeedMatchR
res = filter_res(res, fdr.cutoff=1, fc.cutoff=0, rm.na.log2fc = TRUE)

seed.seq = get_seed(guide.seq = guide.seq, seed.name = "mer7m8")

anno.db = load_annotations("rnor7")

SeedMatchR:::.get_counts_column(res = res, target.seq = seed.seq$Target.Seq,
seqs = anno.db$seqs, seed.name = "mer7m8")
}