diff R/ltr_utils.R @ 9:1aa578e6c8b3 draft

"planemo upload commit 9488b982bae902f1868785ec4ad47134dac50ff3"
author petr-novak
date Wed, 29 Jun 2022 09:25:54 +0000
parents 9de392f2fc02
children a004cd05177d
line wrap: on
line diff
--- a/R/ltr_utils.R	Tue Jun 28 12:33:22 2022 +0000
+++ b/R/ltr_utils.R	Wed Jun 29 09:25:54 2022 +0000
@@ -138,20 +138,20 @@
   gr <- GRanges(seqnames = sapply(gx, function(x)x$seqnames[1]), IRanges(start = S - offset, end = E + offset))
 }
 
-get_ranges_left <- function(gx, offset = OFFSET, offset2 = 10) {
+get_ranges_left <- function(gx, offset = OFFSET, offset2 = 300) {
   ## offset2 - how many nt cen LTR extend to closes protein domain
   ## this is necassary as some detected proteins domains does not have correct bopundaries
   ## if LTR retrotransposons insters to other protein domain.
   S <- sapply(gx, function(x)min(x$start))
-  max_offset <- S - sapply(gx, function(x)min(x$upstream_domain)) + offset2
+  max_offset <- S - sapply(gx, function(x)min(x$upstream_domain)) + 10
   offset_adjusted <- ifelse(max_offset < offset, max_offset, offset)
   gr <- GRanges(seqnames = sapply(gx, function(x)x$seqnames[1]), IRanges(start = S - offset_adjusted, end = S + offset2))
   return(gr)
 }
 
-get_ranges_right <- function(gx, offset = OFFSET, offset2 = 10) {
+get_ranges_right <- function(gx, offset = OFFSET, offset2 = 300) {
   E <- sapply(gx, function(x)max(x$end))
-  max_offset <- sapply(gx, function(x)max(x$downstream_domain)) - E + offset2
+  max_offset <- sapply(gx, function(x)max(x$downstream_domain)) - E + 10
   offset_adjusted <- ifelse(max_offset < offset, max_offset, offset)
   gr <- GRanges(seqnames = sapply(gx, function(x)x$seqnames[1]), IRanges(start = E - offset2, end = E + offset_adjusted))
   return(gr)