ArtRand / signalAlign

HMM-HDP models for MinION signal alignments
MIT License
45 stars 12 forks source link

SignalAlign failing to compile correctly #3

Closed scottgigante closed 8 years ago

scottgigante commented 8 years ago

This is almost certainly an error on my part, but I am having significant errors in the compilation of signalAlign. There are many warnings in when I run make, and two test failures in make test.

Running gcc 4.9.3 on x86_64-redhat-linux with atlas 3.8.4 and also tried with atlas 3.10.2.

Omitting parts of make run without error for clarity. I apologise if this is not the right forum for this question; I am not sure where else to find answers.

% make
...
gcc -std=c99 -O3 -g -Wall --pedantic -fopenmp -funroll-loops -DNDEBUG   -I inc -I ././sonLib/lib/ -c impl/*.c
impl/hdp.c: In function ‘sample_gammas’:
impl/hdp.c:2262:37: warning: ‘dp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 take_distr_sample(dp->hdp);
                                     ^
impl/hdp.c: In function ‘snapshot_factor_log_likelihood’:
impl/hdp.c:2411:23: warning: ‘parent_log_prob’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         parent_prob = exp(parent_log_prob - normalizing_const);
                       ^
impl/hdp.c:2424:13: warning: ‘parent_prob’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     return (log(parent_prob) - log(cumul)) / 1000.0;
             ^
impl/hdp.c: In function ‘deserialize_hdp’:
impl/hdp.c:1110:12: warning: ‘dp_ids’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         id = dp_ids[i];
            ^
impl/hdp.c:3061:14: note: ‘dp_ids’ was declared here
     int64_t* dp_ids;
              ^
impl/ranlib.c: In function ‘ignpoi’:
impl/ranlib.c:1549:7: warning: variable ‘m’ set but not used [-Wunused-but-set-variable]
   int m;
       ^
impl/ranlib.c:1650:14: warning: ‘value’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         py = pow ( mu, value ) / fact[value];
              ^
impl/ranlib.c:1682:21: warning: ‘u’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         if ( fy - u * fy <= py * exp ( px - fx ) )
                     ^
impl/ranlib.c:1664:19: warning: ‘fk’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           px = fk * v * v * ((((((( a7 
                   ^
impl/ranlib.c:1675:17: warning: ‘difmuk’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       x = ( 0.5 - difmuk ) / s;
                 ^
impl/rnglib.c: In function ‘cgn_memory’:
impl/rnglib.c:446:7: warning: unused variable ‘j’ [-Wunused-variable]
   int j;
       ^
impl/rnglib.c: In function ‘set_initial_seed’:
impl/rnglib.c:1588:7: warning: unused variable ‘i’ [-Wunused-variable]
   int i;
       ^
impl/rnglib.c: In function ‘set_seed’:
impl/rnglib.c:1687:7: warning: unused variable ‘i’ [-Wunused-variable]
   int i;
       ^
ar rc signalAlignLib.a *.o
ranlib signalAlignLib.a
rm *.o
mv signalAlignLib.a ././sonLib/lib/
cp inc/*.h ././sonLib/lib/
gcc -std=c99 -O3 -g -Wall --pedantic -fopenmp -funroll-loops -DNDEBUG   -I inc -I././sonLib/lib -Wno-error -o .//bin/signalAlignLibTests tests/*.c ././sonLib/lib/signalAlignLib.a ././sonLib/lib/sonLib.a ././sonLib/lib/cuTest.a    -lz -lm
tests/nanoporeHdpTests.c:480:13: warning: ‘test_HdpHmmWithAssignments_flat_model’ defined but not used [-Wunused-function]
 static void test_HdpHmmWithAssignments_flat_model(CuTest *testCase) {
             ^
tests/nanoporeHdpTests.c:505:13: warning: ‘test_HdpHmmWithAssignments_flat_model2’ defined but not used [-Wunused-function]
 static void test_HdpHmmWithAssignments_flat_model2(CuTest *testCase) {
             ^
tests/nanoporeHdpTests.c:532:13: warning: ‘test_HdpHmmWithAssignments_multiset_model’ defined but not used [-Wunused-function]
 static void test_HdpHmmWithAssignments_multiset_model(CuTest *testCase) {
             ^
tests/nanoporeHdpTests.c:559:13: warning: ‘test_HdpHmmWithAssignments_multiset_model2’ defined but not used [-Wunused-function]
 static void test_HdpHmmWithAssignments_multiset_model2(CuTest *testCase) {
             ^
In file included from tests/signalPairwiseAlignerTest.c:9:0:
tests/signalPairwiseAlignerTest.c: In function ‘test_referenceSequence’:
tests/signalPairwiseAlignerTest.c:213:65: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
     CuAssertStrEquals(testCase, (char *)(testSequence->elements + 10), slice->elements);
                                                                 ^
././sonLib/lib/CuTest.h:80:102: note: in definition of macro ‘CuAssertStrEquals’
 #define CuAssertStrEquals(tc,ex,ac)           CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
                                                                                                      ^
tests/signalPairwiseAlignerTest.c: At top level:
tests/signalPairwiseAlignerTest.c:64:13: warning: ‘test_poissonPosteriorProb’ defined but not used [-Wunused-function]
 static void test_poissonPosteriorProb(CuTest *testCase) {
             ^
tests/signalPairwiseAlignerTest.c:80:13: warning: ‘test_getLogGaussPdfMatchProb’ defined but not used [-Wunused-function]
 static void test_getLogGaussPdfMatchProb(CuTest *testCase) {
             ^
tests/signalPairwiseAlignerTest.c:103:13: warning: ‘test_bivariateGaussPdfMatchProb’ defined but not used [-Wunused-function]
 static void test_bivariateGaussPdfMatchProb(CuTest *testCase) {
             ^
tests/signalPairwiseAlignerTest.c:127:13: warning: ‘test_twoDistributionPdf’ defined but not used [-Wunused-function]
 static void test_twoDistributionPdf(CuTest *testCase) {
             ^
tests/signalPairwiseAlignerTest.c:641:13: warning: ‘test_getBlastPairs’ defined but not used [-Wunused-function]
 static void test_getBlastPairs(CuTest *testCase) {
             ^
tests/signalPairwiseAlignerTest.c:663:13: warning: ‘test_filterToRemoveOverlap’ defined but not used [-Wunused-function]
 static void test_filterToRemoveOverlap(CuTest *testCase) {
             ^
tests/signalPairwiseAlignerTest.c:723:13: warning: ‘test_getBlastPairsWithRecursion’ defined but not used [-Wunused-function]
 static void test_getBlastPairsWithRecursion(CuTest *testCase) {
             ^
tests/stateMachineTests.c:476:13: warning: ‘test_makeAndCheckModels’ defined but not used [-Wunused-function]
 static void test_makeAndCheckModels(CuTest *testCase) {
             ^
tests/variableOrderPairwiseAlignerTests.c:15:13: warning: ‘print_stateMachine_transitions’ defined but not used [-Wunused-function]
 static void print_stateMachine_transitions(StateMachine *sM) {
             ^
gcc -std=c99 -O3 -g -Wall --pedantic -fopenmp -funroll-loops -DNDEBUG   -I inc -I././sonLib/lib -o .//bin/compareDistributions compareDistributions.c ././sonLib/lib/signalAlignLib.a ././sonLib/lib/sonLib.a ././sonLib/lib/cuTest.a    -lz -lm
gcc -std=c99 -O3 -g -Wall --pedantic -fopenmp -funroll-loops -DNDEBUG   -I inc -I././sonLib/lib signalMachineUtils.h -o .//bin/signalMachine signalMachine.c ././sonLib/lib/signalAlignLib.a ././sonLib/lib/sonLib.a ././sonLib/lib/cuTest.a    -lz -lm signalMachineUtils.c
signalMachine.c: In function ‘main’:
signalMachine.c:624:13: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t’ [-Wformat=]
             fprintf(stderr, "signalAlign - starting template alignment round %lld\n", i);
             ^
signalMachine.c:635:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat=]
                     readLabel, i, stList_length(templateAlignedPairs), templatePosteriorScore);
                     ^
signalMachine.c:635:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘int64_t’ [-Wformat=]
signalMachine.c:653:13: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t’ [-Wformat=]
             fprintf(stderr, "signalAlign - starting complement alignment round %lld\n", i);
             ^
signalMachine.c:666:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat=]
                     readLabel, i, stList_length(complementAlignedPairs), complementPosteriorScore);
                     ^
signalMachine.c:666:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘int64_t’ [-Wformat=]
cp ./scripts/runSignalAlign.py .//bin/runSignalAlign
chmod +x .//bin/runSignalAlign
cp ./scripts/signalAlignLib.py .//bin/signalAlignLib.py
cp ./scripts/variantCallingLib.py .//bin/variantCallingLib.py
cp ./scripts/alignmentAnalysisLib.py .//bin/alignmentAnalysisLib.py
cp ./scripts/zayante.py .//bin/zayante
chmod +x .//bin/zayante
cp ./scripts/bonnyDoon.py .//bin/bonnyDoon
chmod +x .//bin/bonnyDoon
cp ./scripts/empire.py .//bin/empire
chmod +x .//bin/empire
cp ./scripts/jamison.py .//bin/jamison
chmod +x .//bin/jamison
gcc -std=c99 -O3 -g -Wall --pedantic -fopenmp -funroll-loops -DNDEBUG   -I inc -I././sonLib/lib -o .//bin/buildHdpUtil buildHdpUtil.c ././sonLib/lib/signalAlignLib.a ././sonLib/lib/sonLib.a ././sonLib/lib/cuTest.a    -lz -lm
buildHdpUtil.c: In function ‘main’:
buildHdpUtil.c:49:62: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
     int64_t nbSamples, burnIn, thinning, samplingGridLength, j;
                                                              ^
...
% make test
...
.FF.
======================================================================
FAIL: test_zymo_reads (__main__.signalAlign_alignment_test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./testSignalAlign", line 58, in test_zymo_reads
    self.check_alignments(true_alignments=zymo_true_alignments, reads=ZYMO_C_READS, reference=ZYMO_REFERENCE)
  File "./testSignalAlign", line 53, in check_alignments
    self.assertTrue(expected.equals(obs), msg="{} is not the same".format(alignment_file))
AssertionError: makeson_PC_MA_286_R7.3_ZYMO_C_1_09_11_15_1714_1_ch3_file1_strand.sm.backward.tsv is not the same

======================================================================
FAIL: test_ecoli_reads (__main__.signalAlign_alignment_test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./testSignalAlign", line 65, in test_ecoli_reads
    self.check_alignments(true_alignments=ecoli_true_alignments, reads=ecoli_reads, reference=ecoli_reference)
  File "./testSignalAlign", line 53, in check_alignments
    self.assertTrue(expected.equals(obs), msg="{} is not the same".format(alignment_file))
AssertionError: makeson_PC_MA_286_R7.3_gEcoli_10_26_15_2807_1_ch89_file296_strand.sm.backward.tsv is not the same

----------------------------------------------------------------------
scottgigante commented 8 years ago

I deleted everything, started from scratch and while it still compiles with numerous warnings, I now only have one failure in make test which is marked as OK. Closing this issue.

ArtRand commented 7 years ago

Hello, Sorry about the slow reply. The test that you saw failing generates the test alignments and checks that the are correct. However on some machines it seems that there are small differences in the probabilities. As long as the library tests pass the algorithm should work, but I'm in the process of changing improving that test so that it's more stable. Let me know if you have any more questions.

scottgigante commented 7 years ago

Thank you for the clarification, it is much appreciated!