Skip to content

Commit

Permalink
fixed offset for methylation in flipped matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-Dyer792 committed Jun 5, 2023
1 parent 06e8f6d commit de8f085
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/createFPWM.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ createFPWM <- function( mainTF = NULL,
for( i in 1:length(peak_id_y_list) ){
Motif[1,i][[1]]@MethMotif_x@MMBetaScore <- Motif[1,i][[1]]@MethMotif_x@MMBetaScore[,motif_length:1] # reverse meth info
colnames(Motif[1,i][[1]]@MethMotif_x@MMBetaScore) <- rev(colnames(Motif[1,i][[1]]@MethMotif_x@MMBetaScore)) # reverse meth info colnames
Motif[1,i][[1]]@MethMotif_x@MMBetaScore[,1:(motif_length-1)] <- Motif[1,i][[1]]@MethMotif_x@MMBetaScore[,2:motif_length] # shift the methyation to land on the reverse Cs
Motif[1,i][[1]]@MethMotif_x@MMBetaScore[,motif_length] <- 0 # pad the last row as we don't know the methylation info
Motif[1,i][[1]]@MethMotif_x@MMmotif@motif_matrix <- Motif[1,i][[1]]@MethMotif_x@MMmotif@motif_matrix[motif_length:1,] # reverse
tmp_matrix <- Motif[1,i][[1]]@MethMotif_x@MMmotif@motif_matrix
tmp_matrix[,'A'] <- Motif[1,i][[1]]@MethMotif_x@MMmotif@motif_matrix[,'T'] # complementary
Expand Down

0 comments on commit de8f085

Please # to comment.