-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add genodsp #51488
Merged
Merged
Add genodsp #51488
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
29aadc7
adding genodsp -- General workbench for processing signals along geno…
2f29e7c
adding run_exports
aa5dca4
sentralized safe_strncpy, using install
dfb62bc
forcing null-termination of string
53806fc
Merge branch 'master' into add-genodsp
richard-burhans 65390dd
added rependency on stdlib('c')
2a0a2b5
Merge branch 'add-genodsp' of https://github.com/richard-burhans/bioc…
78e91c5
adding license_file
1c2311b
Update meta.yaml
bgruening aff6a66
Update recipes/genodsp/meta.yaml
bgruening b374cc0
Merge branch 'bioconda:master' into add-genodsp
richard-burhans ec04760
removing hardcoded gcc in the Makefile
29538c8
updating safe_strncpy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash -e | ||
set -uex | ||
|
||
mkdir -vp "${PREFIX}/bin" | ||
|
||
make VERBOSE=1 -j ${CPU_COUNT} | ||
|
||
if ! install -v "$SRC_DIR/genodsp" "$PREFIX/bin/genodsp"; then | ||
echo "Failed to install genodsp binary" >&2 | ||
exit 1 | ||
fi |
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,36 @@ | ||
{% set name = "genodsp" %} | ||
{% set version = "0.0.3" %} | ||
|
||
package: | ||
name: {{ name|lower }} | ||
version: {{ version }} | ||
|
||
source: | ||
url: https://github.com/rsharris/genodsp/archive/refs/tags/v{{ version }}+.zip | ||
sha256: a7fb2218311d1ae5231041863d28adb8b5fffe724fc5ff2422310ce90a9f894a | ||
patches: | ||
- stringop-truncation.patch | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('c') }} | ||
- make | ||
richard-burhans marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
build: | ||
number: 0 | ||
skip: True # [not linux or not x86_64] | ||
run_exports: | ||
- {{ pin_subpackage('genodsp', max_pin="x.x") }} | ||
|
||
test: | ||
commands: | ||
- genodsp --help | ||
- ls -l ${PREFIX}/bin/ | ||
- ${PREFIX}/bin/genodsp --help | ||
|
||
about: | ||
home: https://github.com/rsharris/genodsp | ||
summary: General workbench for processing signals along genomic (chromosomal) intervals | ||
license: GPL-3.0-only | ||
license_file: LICENSE | ||
license_url: https://github.com/rsharris/genodsp/blob/master/LICENSE |
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,182 @@ | ||
diff --git a/Makefile b/Makefile | ||
index cf07368..d1dfb95 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -1,5 +1,4 @@ | ||
CFLAGS = -O3 -Wall -Wextra -Werror | ||
-CC = gcc | ||
LDLIBS = -lm | ||
|
||
operators = sum clump percentile add multiply mask logical minmax morphology map opio variables | ||
diff --git a/add.c b/add.c | ||
index 752dd5d..8fa4bad 100644 | ||
--- a/add.c | ||
+++ b/add.c | ||
@@ -240,7 +240,7 @@ void op_add_apply | ||
v = NULL; | ||
chromSpec = find_chromosome_spec (chrom); | ||
if (chromSpec != NULL) v = chromSpec->valVector; | ||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
if (chromSpec == NULL) continue; | ||
@@ -533,7 +533,7 @@ void op_subtract_apply | ||
v = NULL; | ||
chromSpec = find_chromosome_spec (chrom); | ||
if (chromSpec != NULL) v = chromSpec->valVector; | ||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
if (chromSpec == NULL) continue; | ||
diff --git a/genodsp.c b/genodsp.c | ||
index ac1704e..dffd622 100644 | ||
--- a/genodsp.c | ||
+++ b/genodsp.c | ||
@@ -1229,7 +1229,7 @@ void read_intervals | ||
v = NULL; | ||
chromSpec = find_chromosome_spec (chrom); | ||
if (chromSpec != NULL) v = chromSpec->valVector; | ||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
if (chromSpec == NULL) continue; | ||
diff --git a/logical.c b/logical.c | ||
index fb295e3..45e1c20 100644 | ||
--- a/logical.c | ||
+++ b/logical.c | ||
@@ -497,7 +497,7 @@ void op_or_apply | ||
v = NULL; | ||
chromSpec = find_chromosome_spec (chrom); | ||
if (chromSpec != NULL) v = chromSpec->valVector; | ||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
if (chromSpec == NULL) continue; | ||
@@ -810,7 +810,7 @@ void op_and_apply | ||
if (chromSpec->flag) goto chrom_not_together; | ||
} | ||
|
||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
// if the current chromosome is not of any interest, ignore this | ||
diff --git a/mask.c b/mask.c | ||
index 4fd5ebd..ddd068e 100644 | ||
--- a/mask.c | ||
+++ b/mask.c | ||
@@ -253,7 +253,7 @@ void op_mask_apply | ||
v = NULL; | ||
chromSpec = find_chromosome_spec (chrom); | ||
if (chromSpec != NULL) v = chromSpec->valVector; | ||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
if (chromSpec == NULL) continue; | ||
@@ -548,7 +548,7 @@ void op_mask_not_apply | ||
if (chromSpec->flag) goto chrom_not_together; | ||
} | ||
|
||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
// if the current chromosome is not of any interest, ignore this | ||
diff --git a/minmax.c b/minmax.c | ||
index c222bd0..eae69ab 100644 | ||
--- a/minmax.c | ||
+++ b/minmax.c | ||
@@ -261,7 +261,7 @@ void op_min_in_interval_apply | ||
if (chromSpec->flag) goto chrom_not_together; | ||
} | ||
|
||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
// if the current chromosome is not of any interest, ignore this | ||
@@ -664,7 +664,7 @@ void op_max_in_interval_apply | ||
if (chromSpec->flag) goto chrom_not_together; | ||
} | ||
|
||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
// if the current chromosome is not of any interest, ignore this | ||
@@ -1941,7 +1941,7 @@ void op_min_with_apply | ||
v = NULL; | ||
chromSpec = find_chromosome_spec (chrom); | ||
if (chromSpec != NULL) v = chromSpec->valVector; | ||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
if (chromSpec == NULL) continue; | ||
@@ -2227,7 +2227,7 @@ void op_max_with_apply | ||
v = NULL; | ||
chromSpec = find_chromosome_spec (chrom); | ||
if (chromSpec != NULL) v = chromSpec->valVector; | ||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
if (chromSpec == NULL) continue; | ||
diff --git a/multiply.c b/multiply.c | ||
index 4c1b550..d04cc41 100644 | ||
--- a/multiply.c | ||
+++ b/multiply.c | ||
@@ -260,7 +260,7 @@ void op_multiply_apply | ||
if (chromSpec->flag) goto chrom_not_together; | ||
} | ||
|
||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
// if the current chromosome is not of any interest, ignore this | ||
@@ -654,7 +654,7 @@ void op_divide_apply | ||
if (chromSpec->flag) goto chrom_not_together; | ||
} | ||
|
||
- strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
+ safe_strncpy (prevChrom, chrom, sizeof(prevChrom)); | ||
} | ||
|
||
// if the current chromosome is not of any interest, ignore this | ||
diff --git a/utilities.c b/utilities.c | ||
index 03d2ff1..64e85e6 100644 | ||
--- a/utilities.c | ||
+++ b/utilities.c | ||
@@ -493,3 +493,13 @@ char* ucommatize | ||
return s; | ||
} | ||
|
||
+// | ||
+void safe_strncpy | ||
+ (char *dest, const char *src, size_t n) | ||
+ { | ||
+ #pragma GCC diagnostic push | ||
+ #pragma GCC diagnostic ignored "-Wstringop-truncation" | ||
+ strncpy(dest, src, n); | ||
+ #pragma GCC diagnostic pop | ||
+ dest[n-1] = '\0'; // Ensure null-termination | ||
+ } | ||
richard-burhans marked this conversation as resolved.
Show resolved
Hide resolved
|
||
diff --git a/utilities.h b/utilities.h | ||
index ac9cef7..87cfc2d 100644 | ||
--- a/utilities.h | ||
+++ b/utilities.h | ||
@@ -31,6 +31,8 @@ char* skip_whitespace (char* s); | ||
char* skip_darkspace (char* s); | ||
char* duration_to_string (float seconds); | ||
char* ucommatize (const u32 v); | ||
+void safe_strncpy (char *dest, const char *src, size_t n); | ||
+ | ||
|
||
// miscellany | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the '+' from the source URL.
The '+' in the URL might cause issues when fetching the source. Consider removing it: