Mercurial > repos > iuc > brew3r_r
comparison brew3r.r_script.R @ 1:3198f52bffaa draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/brew3r_r commit fa525468780f3dea175da15852b1b8c17e1a80d3
author | iuc |
---|---|
date | Tue, 18 Jun 2024 05:36:32 +0000 |
parents | 928a52b5c938 |
children | d3b0390f325f |
comparison
equal
deleted
inserted
replaced
0:928a52b5c938 | 1:3198f52bffaa |
---|---|
89 ov.simple <- unique(ov[, c("queryHits", "strand")]) | 89 ov.simple <- unique(ov[, c("queryHits", "strand")]) |
90 # If the queryHits is duplicated it means there are different strands | 90 # If the queryHits is duplicated it means there are different strands |
91 multi.strand.query <- ov.simple$queryHits[duplicated(ov.simple$queryHits)] | 91 multi.strand.query <- ov.simple$queryHits[duplicated(ov.simple$queryHits)] |
92 to.remove <- unstranded.intervals[multi.strand.query] | 92 to.remove <- unstranded.intervals[multi.strand.query] |
93 # Remove these potentially error-prone intervals from the template | 93 # Remove these potentially error-prone intervals from the template |
94 input_gr_template <- input_gr_template[-to.remove] | 94 if (length(to.remove) > 0) { |
95 input_gr_template <- input_gr_template[-to.remove] | |
96 } | |
95 } | 97 } |
96 } | 98 } |
97 | 99 |
98 # Run BREW3R.r main function | 100 # Run BREW3R.r main function |
99 new_gr_exons <- extend_granges( | 101 if (length(input_gr_template) > 0) { |
100 input_gr_to_extend = input_gr_to_extend, | 102 new_gr_exons <- extend_granges( |
101 input_gr_to_overlap = input_gr_template, | 103 input_gr_to_extend = input_gr_to_extend, |
102 add_new_exons = is.null(opt$no_add), | 104 input_gr_to_overlap = input_gr_template, |
103 overlap_resolution_fn = opt$sup_output | 105 add_new_exons = is.null(opt$no_add), |
104 ) | 106 overlap_resolution_fn = opt$sup_output |
107 ) | |
108 } else { | |
109 new_gr_exons <- subset(input_gr_to_extend, type == "exon") | |
110 } | |
105 # Prevent extension using pattern | 111 # Prevent extension using pattern |
106 if (!is.null(opt$exclude_pattern)) { | 112 if (!is.null(opt$exclude_pattern)) { |
107 input_gr_pattern <- subset( | 113 input_gr_pattern <- subset( |
108 input_gr_to_extend, | 114 input_gr_to_extend, |
109 type == "exon" & grepl(opt$exclude_pattern, gene_name) | 115 type == "exon" & grepl(opt$exclude_pattern, gene_name) |