Skip to content
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

strcomp Abort: 6 in gene quicksort algo #2

Open
kastman opened this issue Mar 1, 2018 · 0 comments
Open

strcomp Abort: 6 in gene quicksort algo #2

kastman opened this issue Mar 1, 2018 · 0 comments

Comments

@kastman
Copy link

kastman commented Mar 1, 2018

Hi @gtsong,

When I have low numbers of exons or genes (1, 2, or 3) it appears that the gene quicksort in util_genes.c, (which is supposed to place exons in their correct locations, as far as I can tell), is failing.

The problem is in both quicksort_inc and quicksort_dec, where i == j:

strcpy(a[i].gname, a[j].gname);

In this case strcmp is trying to copy a string with the same source and destination, and is giving an error. However, since this is only for the gene and scaffold names, if I comment these lines out it appears that the program passes, but still doesn't sort exons (in my current example from the annotation step they appear to already be sorted, but if I manually move them this "fixed" sort_genes doesn't change the exon order. Finally, since the loop proceeds while i <= j, I'm confused about why this issue where the two counters are equal has never come up before.

I was wondering if you've verified that this quicksort does indeed work? And the state of the software in general; is it currently in production in your lab? Thanks in advance,

(Note, I'm going off of http://www.cplusplus.com/reference/cstring/strcpy/ which says that the dest and src should not be the location in memory for assuming this is the problem).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant