Skip to content

Commit

Permalink
Merge pull request #6 from HDash/main
Browse files Browse the repository at this point in the history
Fix error which occurs if no FIMO matches are detected
  • Loading branch information
Tomrrr1 authored Jun 13, 2024
2 parents 842abd6 + b89f271 commit 5e1a6ff
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 no 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 5e1a6ff

Please sign in to comment.