-
Notifications
You must be signed in to change notification settings - Fork 14
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 #22 from wtsi-npg/devel
devel to master merge
- Loading branch information
Showing
254 changed files
with
1,272 additions
and
331 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
ACLOCAL_AMFLAGS= -I m4 | ||
TESTS = test/posfile/t_posfile test/filterfile/t_filterfile test/bclfile/t_bclfile test/decode/t_decode test/i2b/t_i2b | ||
SUBDIRS = src test/posfile test/bclfile test/filterfile test/decode test/i2b | ||
#DIST_SUBDIRS = test/decode/data test/decode/out test/i2b/data test/i2b/out | ||
dist_doc_DATA = README.md LICENSE | ||
AM_COLOR_TESTS=always |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
AC_INIT([bambi], m4_esyscmd_s([git describe --dirty --always --tags]), [[email protected]]) | ||
AC_ARG_VAR(HTSDIR,Directory to look for hts) | ||
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) | ||
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects tar-pax no-dependencies]) | ||
AC_PROG_CC | ||
|
||
LT_INIT | ||
|
@@ -17,6 +17,7 @@ CPPFLAGS="$HTSLIB_CPPFLAGS" | |
LDFLAGS="$HTSLIB_LDFLAGS" | ||
AC_CHECK_HEADERS([cram/sam_header.h]) | ||
AC_CHECK_LIB([hts], [bam_aux_update_str], [AC_DEFINE([HAVE_BAM_AUX_UPDATE_STR],[1],[Does htslib contain bam_aux_update_str()?])]) | ||
AC_CHECK_LIB([hts], [sam_hdr_del], [AC_DEFINE([HAVE_SAM_HDR_DEL],[1],[Does htslib contain sam_hdr_del()?])]) | ||
CPPFLAGS="$saved_CPPFLAGS" | ||
LDFLAGS="$saved_LDFLAGS" | ||
|
||
|
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,97 @@ | ||
/* array.c -- simple array handling functions. | ||
Copyright (C) 2016 Genome Research Ltd. | ||
Author: Jennifer Liddle <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "array.h" | ||
|
||
/* | ||
* integer array functions | ||
*/ | ||
|
||
int ia_compare(const void *ia1, const void *ia2) | ||
{ | ||
return *(int *)ia1 - *(int *)ia2; | ||
} | ||
|
||
void ia_sort(ia_t *ia) | ||
{ | ||
qsort(ia->entries, ia->end, sizeof(int), ia_compare); | ||
} | ||
|
||
void ia_push(ia_t *ia, int i) | ||
{ | ||
if (ia->end == ia->max) { | ||
// expand the array | ||
ia->max *= 2; | ||
ia->entries = realloc(ia->entries, ia->max * sizeof(int)); | ||
} | ||
ia->entries[ia->end] = i; | ||
ia->end++; | ||
} | ||
|
||
void ia_free(ia_t *ia) | ||
{ | ||
free(ia->entries); | ||
free(ia); | ||
} | ||
|
||
ia_t *ia_init(int max) | ||
{ | ||
ia_t *ia = calloc(1, sizeof(ia_t)); | ||
ia->end = 0; | ||
ia->max = max; | ||
ia->entries = calloc(ia->max, sizeof(int)); | ||
return ia; | ||
} | ||
|
||
|
||
/* | ||
* generic arrays | ||
*/ | ||
|
||
va_t *va_init(int max, void(*free_entry)(void*)) | ||
{ | ||
va_t *va = calloc(1,sizeof(va_t)); | ||
va->end = 0; | ||
va->max = max; | ||
va->free_entry = free_entry; | ||
va->entries = calloc(va->max, sizeof(void *)); | ||
return va; | ||
} | ||
|
||
void va_push(va_t *va, void *ent) | ||
{ | ||
if (va->end == va->max) { | ||
// expand the array | ||
va->max *= 2; | ||
va->entries = realloc(va->entries, va->max * sizeof(void *)); | ||
} | ||
va->entries[va->end] = ent; | ||
va->end++; | ||
} | ||
|
||
void va_free(va_t *va) | ||
{ | ||
int n; | ||
if (!va) return; | ||
for (n=0; n < va->end; n++) { | ||
va->free_entry(va->entries[n]); | ||
} | ||
free(va->entries); | ||
free(va); | ||
} | ||
|
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,60 @@ | ||
/* array.h -- simple array handling functions. | ||
Copyright (C) 2016 Genome Research Ltd. | ||
Author: Jennifer Liddle <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef __ARRAY_H__ | ||
#define __ARRAY_H__ | ||
|
||
#include <stdbool.h> | ||
#include <stdlib.h> | ||
|
||
/* | ||
* integer array functions | ||
*/ | ||
|
||
typedef struct { | ||
int end; | ||
int max; | ||
int *entries; | ||
} ia_t; | ||
|
||
ia_t *ia_init(int max); | ||
int ia_compare(const void *ia1, const void *ia2); | ||
void ia_sort(ia_t *ia); | ||
void ia_push(ia_t *ia, int i); | ||
void ia_free(ia_t *ia); | ||
static inline bool ia_isEmpty(ia_t *ia) { return (ia->end == 0); } | ||
|
||
|
||
/* | ||
* generic arrays | ||
*/ | ||
|
||
typedef struct { | ||
int end; | ||
int max; | ||
void (*free_entry)(void *); | ||
void **entries; | ||
} va_t; | ||
|
||
va_t *va_init(int max, void(*free_entry)(void*)); | ||
void va_push(va_t *va, void *ent); | ||
void va_free(va_t *va); | ||
static inline bool va_isEmpty(va_t *va) { return va->end == 0; } | ||
|
||
#endif | ||
|
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
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
Oops, something went wrong.