Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from croth1/distribution_min_motifs
fixes error when plotting motif distributions with too few hits
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/R/plotMotifDistribution.R b/R/plotMotifDistribution.R | ||
index 1f2e990..a55e021 100755 | ||
--- a/R/plotMotifDistribution.R | ||
+++ b/R/plotMotifDistribution.R | ||
@@ -69,12 +69,11 @@ for( file in Sys.glob(full_glob) ){ | ||
filename = file.path(maindir, file_name) | ||
line_number = as.integer(system2("wc", args=c("-l", filename, " | awk '{print $1}'" ), stdout = TRUE)) | ||
|
||
- if( line_number <= 2 ){ | ||
- print("Warning: The input file is empty. Query motif has <3 occurrences in the sequence set.") | ||
- # print out an empty image | ||
- | ||
- picname <- paste(c(file_prefix, motif_id, "_distribution.png"), collapse="") | ||
- picname <- file.path(maindir, picname) | ||
+ if( line_number <= 3 ){ | ||
+ print("Warning: The input file is empty. Query motif has <3 occurrences in the sequence set.") | ||
+ # print out an empty image | ||
+ picname <- paste(c(file_prefix, motif_id, "_distribution.png"), collapse="") | ||
+ picname <- file.path(maindir, picname) | ||
|
||
png(filename=picname, width=png_width, height=png_height) | ||
par(oma=c(0,0,0,0), mar=c(6,6.5,5,2)) |