yeastgenome / AGAPE

AGAPE (Automated Genome Analysis PipelinE) for yeast pan-genome analysis
3 stars 9 forks source link

strcomp Abort: 6 in gene quicksort algo #2

Open kastman opened 6 years ago

kastman commented 6 years ago

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:

https://github.com/yeastgenome/AGAPE/blob/9825c208853a696631c93fcfe6b041e16cf7db0f/src/CHAP_infer_annot/util_genes.c#L79

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).