Skip to content
Snippets Groups Projects
Commit b21cacc7 authored by Sascha Meiers's avatar Sascha Meiers
Browse files

Fixing segment coordinates during SV classification

parent 8916a913
No related branches found
No related tags found
No related merge requests found
......@@ -94,11 +94,16 @@ mosaiClassifierPrepare <- function(counts, info, strand, segs, normVector = NULL
##############################################################################
# Expand table to (all cells) x (all segments)
#
# Go from 0-based coordinates to 1-based bin coordinates
segs[, to := bps + 1L]
# add a "from" column which contians the "to" breakpoint from the prev. segment each
segs[, from := data.table::shift(bps,fill = 0) + 1, by = chrom]
segs[, from := (data.table::shift(to,fill = 0L) + 1L), by = chrom]
# remove columns "bps" and "k"
segs[, `:=`(bps = NULL, k = NULL)]
# rename the "bps" column to "to"
segs[, `:=`(to = bps + 1, bps = NULL, k = NULL)]
# Add coordinates
addPositions(segs, counts)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment