~ubuntu-branches/debian/experimental/mafft/experimental

« back to all changes in this revision

Viewing changes to core/tbfast.c

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2014-10-05 09:00:33 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20141005090033-jz7hffbtf1xnirrn
Tags: 7.187-1
* New upstream release.
* Conforms to Policy 3.9.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        float *selfscore;
29
29
        float **iscore;
30
30
        char **seq;
 
31
        int **skiptable;
31
32
        Jobtable *jobpospt;
32
33
        pthread_mutex_t *mutex;
33
34
} distancematrixthread_arg_t;
96
97
        tbrweight = 3;
97
98
        checkC = 0;
98
99
        treemethod = 'X';
 
100
        sueff_global = 0.1;
99
101
        contin = 0;
100
102
        scoremtx = 1;
101
103
        kobetsubunkatsu = 0;
280
282
#endif
281
283
                                case 'X':
282
284
                                        treemethod = 'X';
283
 
                                        break;
 
285
                                        sueff_global = atof( *++argv );
 
286
                                        fprintf( stderr, "sueff_global = %f\n", sueff_global );
 
287
                                        --argc;
 
288
                                        goto nextoption;
284
289
                                case 'E':
285
290
                                        treemethod = 'E';
286
291
                                        break;
440
445
        float *selfscore = targ->selfscore;
441
446
        float **iscore = targ->iscore;
442
447
        char **seq = targ->seq;
 
448
        int **skiptable = targ->skiptable;
443
449
        Jobtable *jobpospt = targ->jobpospt;
444
450
 
445
451
        float ssi, ssj, bunbo;
473
479
                if( bunbo == 0.0 )
474
480
                        iscore[i][j-i] = 2.0; // 2013/Oct/17
475
481
                else
476
 
                        iscore[i][j-i] = ( 1.0 - naivepairscore11( seq[i], seq[j], penalty_dist ) / bunbo ) * 2.0; // 2013/Oct/17
 
482
//                      iscore[i][j-i] = ( 1.0 - naivepairscore11( seq[i], seq[j], penalty_dist ) / bunbo ) * 2.0; // 2013/Oct/17
 
483
                        iscore[i][j-i] = ( 1.0 - naivepairscorefast( seq[i], seq[j], skiptable[i], skiptable[j], penalty_dist ) / bunbo ) * 2.0; // 2014/Aug/15 fast
477
484
        }
478
485
}
479
486
 
1278
1285
        static char **mseq1, **mseq2;
1279
1286
        static char **bseq;
1280
1287
        static float **iscore, **iscore_kozo;
 
1288
        int **skiptable;
1281
1289
        static double *eff, *eff_kozo, *eff_kozo_mapped = NULL;
1282
1290
        int i, j, ien, ik, jk;
1283
1291
        static int ***topol, ***topol_kozo;
1480
1488
        
1481
1489
                        fprintf( stderr, "Making a distance matrix .. \n" );
1482
1490
                        fflush( stderr );
 
1491
                        skiptable = AllocateIntMtx( njob, 0 );
 
1492
                        makeskiptable( njob, skiptable, seq ); // allocate suru.
1483
1493
                        ien = njob-1;
1484
1494
                        for( i=0; i<njob; i++ ) 
1485
1495
                        {
1486
 
                                selfscore[i] = naivepairscore11( seq[i], seq[i], penalty_dist );
 
1496
//                              selfscore[i] = naivepairscore11( seq[i], seq[i], penalty_dist );
 
1497
                                selfscore[i] = naivepairscorefast( seq[i], seq[i], skiptable[i], skiptable[i], penalty_dist );
1487
1498
//                              fprintf( stderr, "penalty = %d\n", penalty );
1488
1499
//                              fprintf( stderr, "penalty_dist = %d\n", penalty_dist );
1489
1500
                        }
1509
1520
                                        targ[i].selfscore = selfscore;
1510
1521
                                        targ[i].iscore = iscore;
1511
1522
                                        targ[i].seq = seq;
 
1523
                                        targ[i].skiptable = skiptable;
1512
1524
                                        targ[i].jobpospt = &jobpos;
1513
1525
                                        targ[i].mutex = &mutex;
1514
1526
 
1542
1554
                                                        iscore[i][j-i] = 2.0; // 2013/Oct/17 2bai
1543
1555
                                                else
1544
1556
//                                                      iscore[i][j-i] = 1.0 - naivepairscore11( seq[i], seq[j], penalty_dist ) / MIN( selfscore[i], selfscore[j] );
1545
 
                                                        iscore[i][j-i] = ( 1.0 - naivepairscore11( seq[i], seq[j], penalty_dist ) / bunbo ) * 2.0; // 2013/Oct/17 2bai
 
1557
//                                                      iscore[i][j-i] = ( 1.0 - naivepairscore11( seq[i], seq[j], penalty_dist ) / bunbo ) * 2.0; // 2013/Oct/17 2bai
 
1558
                                                        iscore[i][j-i] = ( 1.0 - naivepairscorefast( seq[i], seq[j], skiptable[i], skiptable[j], penalty_dist ) / bunbo ) * 2.0; // 2014/Aug/15 fast
 
1559
//exit( 1 );
1546
1560
                
1547
1561
#if 0
1548
1562
                                                fprintf( stderr, "### ssj = %f\n", ssj );
1554
1568
                                }
1555
1569
                        }
1556
1570
                        fprintf( stderr, "\ndone.\n\n" );
 
1571
                        FreeIntMtx( skiptable );
1557
1572
                        fflush( stderr );
1558
1573
                }
1559
1574
                else
1623
1638
                }
1624
1639
                else if( subalignment ) // merge error no tame
1625
1640
                {
1626
 
                        fixed_supg_float_realloc_nobk_halfmtx_treeout_constrained( njob, iscore, topol, len, name, nlen, dep, nsubalignments, subtable );
 
1641
                        fixed_supg_float_realloc_nobk_halfmtx_treeout_constrained( njob, iscore, topol, len, name, nlen, dep, nsubalignments, subtable, 1 );
1627
1642
                }
1628
1643
                else if( treeout ) // merge error no tame
1629
1644
                {
1630
 
                        fixed_musclesupg_float_realloc_nobk_halfmtx_treeout( njob, iscore, topol, len, name, nlen, dep );
 
1645
                        fixed_musclesupg_float_realloc_nobk_halfmtx_treeout( njob, iscore, topol, len, name, nlen, dep, 1 );
1631
1646
                }
1632
1647
                else
1633
1648
                {
1634
 
                        fixed_musclesupg_float_realloc_nobk_halfmtx( njob, iscore, topol, len, dep, 1 );
 
1649
                        fixed_musclesupg_float_realloc_nobk_halfmtx( njob, iscore, topol, len, dep, 1, 1 );
1635
1650
                }
1636
1651
//              else 
1637
1652
//                      ErrorExit( "Incorrect tree\n" );
1641
1656
//                      for( i=0; i<nkozo-1; i++ )
1642
1657
//                              for( j=i+1; j<nkozo; j++ )
1643
1658
//                                      fprintf( stderr, "iscore_kozo[%d][%d] =~ %f\n", i, j, iscore_kozo[i][j-i] );
1644
 
                        fixed_musclesupg_float_realloc_nobk_halfmtx( nkozo, iscore_kozo, topol_kozo, len_kozo, NULL, 1 );
 
1659
                        fixed_musclesupg_float_realloc_nobk_halfmtx( nkozo, iscore_kozo, topol_kozo, len_kozo, NULL, 1, 1 );
1645
1660
                }
1646
1661
                fprintf( stderr, "\ndone.\n\n" );
1647
1662
                fflush( stderr );