Skip to content

Commit

Permalink
[feat, fix] Fix qscore bins add 0.499
Browse files Browse the repository at this point in the history
[fix]

Fix memleak with simulating with depth = inf

Fix qscore calculation, add +0.499. Update test cases expected results.

[feat]

Improve poisson sampler

Add own implementation of beta sampler

Add -printBasePickError -printGlError -printQsError -printQScore options

Add make test-% for detailed tests like vg or all

Add gtDiscordance misc program updated version

Change version to 0.4.3
  • Loading branch information
isinaltinkaya committed Jan 8, 2024
1 parent a4eb562 commit c4e0294
Show file tree
Hide file tree
Showing 25 changed files with 1,782 additions and 499 deletions.
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -204,7 +204,7 @@ FLAGS := $(CPPFLAGS) $(CXXFLAGS)


# Versioning
VERSION = v0.4.1
VERSION = v0.4.3

ifneq ($(wildcard .git),)
VERSION := $(VERSION)-$(shell git describe --always)
Expand Down Expand Up @@ -267,10 +267,13 @@ clean:
## [test]
# - run unit tests

.PHONY: test
.PHONY: test test-%
test:
bash test/runTests.sh

test-%:
bash test/runTests.sh $*

####################################################################################################
## [.activate_module]

Expand Down
20 changes: 3 additions & 17 deletions bcf_utils.cpp
Expand Up @@ -205,18 +205,9 @@ simRecord::simRecord(bcf_hdr_t* in_hdr) {

this->set_hdr(in_hdr);

if (args->mps_depths_fn != NULL) {
this->mps_depths = read_depthsFile(args->mps_depths_fn, this->nSamples);

fprintf(stderr, "\n");
if (args->verbose > 0) {
for (int s = 0; s < this->nSamples; s++) {
fprintf(stderr,
"Individual \'%s\' (index:%d) mean per-site depth is "
"set to %f\n",
bcf_hdr_int2id(this->hdr, BCF_DT_SAMPLE, s),
s, this->mps_depths[s]);
}
if (args->mps_depths != NULL) {
if (args->n_mps_depths != this->nSamples) {
ERROR("Number of depths provided in the depths file (%d) does not match the number of samples (%d) in the input VCF file.", args->n_mps_depths, this->nSamples);
}
}

Expand Down Expand Up @@ -410,11 +401,6 @@ simRecord::~simRecord() {
free(this->current_size_bcf_tag_number);
this->current_size_bcf_tag_number = NULL;

if (NULL != this->mps_depths) {
free(this->mps_depths);
this->mps_depths = NULL;
}

free(this->alleles2acgt);
this->alleles2acgt = NULL;
free(this->acgt2alleles);
Expand Down
2 changes: 0 additions & 2 deletions bcf_utils.h
Expand Up @@ -117,8 +117,6 @@ typedef struct simRecord {
// current sizes in use for enum INFO/FORMAT<Number=bcf_tag_number>
int* current_size_bcf_tag_number = NULL;

double* mps_depths = NULL;

// ---
// always created, only added if addTYPE==1
int32_t* fmt_dp_arr = NULL;
Expand Down
2 changes: 1 addition & 1 deletion gl_methods.cpp
Expand Up @@ -184,8 +184,8 @@ void alleles_calculate_gls_log10_glModel2_precise1(simRecord* sim) {

bo = sim->bases[s][read_i];


e = sim->base_error_probs[s][read_i];

if (0.0 == e) {
homT = 0.0;
het = -0.30103;
Expand Down

0 comments on commit c4e0294

Please sign in to comment.