diff --git a/src/cpp/dpm_sampler.cpp b/src/cpp/dpm_sampler.cpp index 2f9dfd6..58b237f 100644 --- a/src/cpp/dpm_sampler.cpp +++ b/src/cpp/dpm_sampler.cpp @@ -1321,11 +1321,13 @@ ssret* sample_class(unsigned int i, unsigned int step) // if it's in the head if (c_ptr[i] == NULL && mxt->size == 1) { - rn = mxt->next->rlist; + if (mxt->next != NULL) { + rn = mxt->next->rlist; - while (rn != NULL) { - c_ptr[rn->ri] = NULL; - rn = rn->next; + while (rn != NULL) { + c_ptr[rn->ri] = NULL; + rn = rn->next; + } } remove_comp(&mxt); diff --git a/src/shorah/shotgun.py b/src/shorah/shotgun.py index 4a09031..bb75de6 100644 --- a/src/shorah/shotgun.py +++ b/src/shorah/shotgun.py @@ -281,7 +281,7 @@ def get_prop(filename): else: return 'not found' - prop = 0 + prop = 'not found' for l in h: if l.startswith('#made'): prop = int(l.split()[1]) @@ -334,6 +334,9 @@ def win_to_run(alpha_w, seed): def merge_corrected_reads(aligned_read): + if aligned_read is None: + print("empty window found", file=sys.stderr) + return (none, []) ID = aligned_read[0] seq = aligned_read[1][4]