Skip to content

Strandness information of signal and targte GRanges seems ignored in the calculation of normalizeToMatrix #76

@SoManyPepople

Description

@SoManyPepople

Hi,
Thanks for development of this nice tool.
I found no parameter to set strandness in the function "normalizeToMatrix", so I try a test to know whether the strandness of the input GRange objects were adopted in the calculation.

Briefly, I switch the strandness of target GRanges object (GR.utr3), and found the results seem just reversed (window 1 = window20, window2 = window18).
#save the original GR
GR.utr3_back <- GR.utr3
#set the strand of GR to the opposite
strand(GR.utr3) <- if_else(as.character(strand(GR.utr3))=="+","-","+")
#obtain the normalized matrix for new GR

mat <- normalizeToMatrix(GRL.m6A_peaks[[s]], GR.utr3, value_column = "EnrichFold",mean_mode = "w0",extend = 0,k=20,background = 0, smooth=FALSE, target_ratio = 1)
mat.dt <- as.data.table(mat,keep.rownames = "tx") %>% group_by(tx) %>% mutate_at(paste0("t",1:20), mean) %>% distinct() %>% as.data.table()
mat.dt[tx == "ENST00000395764.5",]

tx t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20
1: ENST00000395764.5 7.047711 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795

#obtain the normalized matrix for original GR

mat <- normalizeToMatrix(GRL.m6A_peaks[[s]], GR.utr3_back, value_column = "EnrichFold",mean_mode = "w0",extend = 0,k=20,background = 0, smooth=FALSE, target_ratio = 1)
mat.dt <- as.data.table(mat,keep.rownames = "tx") %>% group_by(tx) %>% mutate_at(paste0("t",1:20), mean) %>% distinct() %>% as.data.table()
mat.dt[tx == "ENST00000395764.5",]

tx t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20
1: ENST00000395764.5 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 9.866795 7.047711

The only solution seems to seperate the signal and target GRanges by their strandness and perform normalizeToMatrix speperately and merged together.

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