Skip to content

mark_dominant() deletes normalized_score in experiment@counts$TSSs$raw[sample] #202

Description

@perinom

Hi,

I just realised that setting use_nomalized = TRUE in plot_seqeunce_logo() results in the following error after TSSs aggregation into TSRs:

Error in eval(jsub, SDenv, parent.frame()) : object 'normalized_score' not found

I traced it back to line 34 of extract_counts() where the function tries to extract the normalized_score column that is indeed not present. The score column is present but contains floating point numbers instead of integers. I guess it went through some kind of processing, but it does not coincide with the normalized_score calculated on TSSs before

As the error does not occur when only TSSs are present in the experiment object I checked the functions in between and this seems to happen during the call to mark_dominant()

------- EDIT -------
it only happens when setting use_normalized = T in mark_dominant()

Full traceback:


13. eval(jsub, SDenv, parent.frame())
12. eval(jsub, SDenv, parent.frame())
11. `[.data.table`(x, , `:=`(score, normalized_score))
10. x[, `:=`(score, normalized_score)]
9.  .f(.x[[i]], ...)
8. map(.x, .f, ...)
7. walk(return_samples, function(x) {
    x[, `:=`(score, normalized_score)]
    x[, `:=`(normalized_score, NULL)]
    return(x) ...
6. extract_counts(., "tss", samples, use_normalized)
5. map(signal_data, function(x) {
    x <- x[score >= threshold]
    return(x)
    })
4. preliminary_filter(., dominant, threshold)
3. experiment %>% extract_counts("tss", samples, use_normalized) %>%
    preliminary_filter(dominant, threshold)
2. .tss_sequences(experiment, samples, genome_assembly, threshold,
    use_normalized, distance, dominant, data_conditions)
1. plot_sequence_logo(exp, samples = "all", genome_assembly = assembly,
    threshold = threshold, use_normalized = TRUE, distance = 6,
    dominant = FALSE, data_conditions = NULL, ncol = 3, font_size = 10,
    base_colors = c(A = "#109649", C = "#255C99", G = "#F7B32C", ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions