Skip to content

Commit

Permalink
Fix error which occurs if no FIMO matches are detected
Browse files Browse the repository at this point in the history
  • Loading branch information
HDash committed Jun 5, 2024
1 parent b538c15 commit 5ff0b8f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/summit_to_motif.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ summit_to_motif <- function(peak_input,
bfile = bfile,
thresh = fimo_threshold,
...)

# Return NULL lists if FIMO matches are detected
if (is.null(fimo_df)) return(
list(peak_set = NULL,
distance_to_summit = NULL)
)

index_to_repeat <- base::match(as.vector(GenomicRanges::seqnames(fimo_df)),
names(peaks))
expanded_peaks <- peaks[index_to_repeat]
Expand Down

0 comments on commit 5ff0b8f

Please sign in to comment.