~ubuntu-branches/debian/jessie/arb/jessie

« back to all changes in this revision

Viewing changes to GDE/MUSCLE/src/objscore.cpp

  • Committer: Package Import Robot
  • Author(s): Elmar Pruesse, Andreas Tille, Elmar Pruesse
  • Date: 2014-09-02 15:15:06 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140902151506-jihq58b3iz342wif
Tags: 6.0.2-1
[ Andreas Tille ]
* New upstream version
  Closes: #741890
* debian/upstream -> debian/upstream/metadata
* debian/control:
   - Build-Depends: added libglib2.0-dev
   - Depends: added mafft, mrbayes
* debian/rules
   - Add explicite --remove-section=.comment option to manual strip call
* cme fix dpkg-control
* arb-common.dirs: Do not create unneeded lintian dir
* Add turkish debconf translation (thanks for the patch to Mert Dirik
  <mertdirik@gmail.com>)
  Closes: #757497

[ Elmar Pruesse ]
* patches removed:
   - 10_config.makefiles.patch,
     80_no_GL.patch
       removed in favor of creating file from config.makefile.template via 
       sed in debian/control
   - 20_Makefile_main.patch
       merged upstream
   - 21_Makefiles.patch
       no longer needed
   - 30_tmpfile_CVE-2008-5378.patch: 
       merged upstream
   - 50_fix_gcc-4.8.patch:
       merged upstream
   - 40_add_libGLU.patch:
       libGLU not needed for arb_ntree)
   - 60_use_debian_packaged_raxml.patch:
       merged upstream
   - 70_hardening.patch
       merged upstream
   - 72_add_math_lib_to_linker.patch
       does not appear to be needed
* patches added:
   - 10_upstream_r12793__show_db_load_progress:
       backported patch showing progress while ARB is loading a database
       (needed as indicator/splash screen while ARB is launching)
   - 20_upstream_r12794__socket_permissions:
       backported security fix
   - 30_upstream_r12814__desktop_keywords:
       backported add keywords to desktop (fixes lintian warning)
   - 40_upstream_r12815__lintian_spelling:
       backported fix for lintian reported spelling errors
   - 50_private_nameservers
       change configuration to put nameservers into users home dirs
       (avoids need for shared writeable directory)
   - 60_use_debian_phyml
       use phyml from debian package for both interfaces in ARB
* debian/rules:
   - create config.makefile from override_dh_configure target
   - use "make tarfile" in override_dh_install
   - remove extra cleaning not needed for ARB 6
   - use "dh_install --list-missing" to avoid missing files
   - added override_dh_fixperms target
* debian/control:
   - added libarb-dev package
   - Depends: added phyml, xdg-utils
   - Suggests: removed phyml
   - fix lintian duplicate-short-description (new descriptions)
* debian/*.install:
   - "unrolled" confusing globbing to select files
   - pick files from debian/tmp
   - moved all config files to /etc/arb
* debian/arb-common.templates: updated
* scripts:
   - removed arb-add-pt-server
   - launch-wrapper: 
     - only add demo.arb to newly created $ARBUSERDATA
     - pass commandline arguments through bin/arb wrapper
   - preinst: removing old PT server index files on upgrade from 5.5*
   - postinst: set setgid on shared PT dir
* rewrote arb.1 manfile
* added file icon for ARB databases
* using upstream arb_tcp.dat

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "muscle.h"
 
2
#include "msa.h"
 
3
#include "objscore.h"
 
4
#include "profile.h"
 
5
#include "timing.h"
 
6
 
 
7
#if     TIMING
 
8
TICKS g_ticksObjScore = 0;
 
9
#endif
 
10
 
 
11
SCORE ObjScore(const MSA &msa, const unsigned SeqIndexes1[],
 
12
  unsigned uSeqCount1, const unsigned SeqIndexes2[], unsigned uSeqCount2)
 
13
        {
 
14
#if     TIMING
 
15
        TICKS t1 = GetClockTicks();
 
16
#endif
 
17
        const unsigned uSeqCount = msa.GetSeqCount();
 
18
 
 
19
        OBJSCORE OS = g_ObjScore;
 
20
        if (g_ObjScore == OBJSCORE_SPM)
 
21
                {
 
22
        if (uSeqCount <= 100)
 
23
                        OS = OBJSCORE_XP;
 
24
                else
 
25
                        OS = OBJSCORE_SPF;
 
26
                }
 
27
 
 
28
        MSA msa1;
 
29
        MSA msa2;
 
30
 
 
31
        switch (OS)
 
32
                {
 
33
        case OBJSCORE_DP:
 
34
        case OBJSCORE_XP:
 
35
                MSAFromSeqSubset(msa, SeqIndexes1, uSeqCount1, msa1);
 
36
                MSAFromSeqSubset(msa, SeqIndexes2, uSeqCount2, msa2);
 
37
 
 
38
                SetMSAWeightsMuscle(msa1);
 
39
                SetMSAWeightsMuscle(msa2);
 
40
                break;
 
41
 
 
42
        case OBJSCORE_SP:
 
43
        case OBJSCORE_SPF:
 
44
        case OBJSCORE_PS:
 
45
        // Yuck -- casting away const (design flaw)
 
46
                SetMSAWeightsMuscle((MSA &) msa);
 
47
                break;
 
48
                }
 
49
 
 
50
        SCORE Score = 0;
 
51
        switch (OS)
 
52
                {
 
53
        case OBJSCORE_SP:
 
54
                Score = ObjScoreSP(msa);
 
55
                break;
 
56
 
 
57
        case OBJSCORE_DP:
 
58
                Score = ObjScoreDP(msa1, msa2);
 
59
                break;
 
60
 
 
61
        case OBJSCORE_XP:
 
62
                Score = ObjScoreXP(msa1, msa2);
 
63
                break;
 
64
 
 
65
        case OBJSCORE_PS:
 
66
                Score = ObjScorePS(msa);
 
67
                break;
 
68
 
 
69
        case OBJSCORE_SPF:
 
70
                Score = ObjScoreSPDimer(msa);
 
71
                break;
 
72
        
 
73
        default:
 
74
                Quit("Invalid g_ObjScore=%d", g_ObjScore);
 
75
                }
 
76
#if     TIMING
 
77
        TICKS t2 = GetClockTicks();
 
78
        g_ticksObjScore += (t2 - t1);
 
79
#endif
 
80
        return Score;
 
81
        }
 
82
 
 
83
SCORE ObjScoreIds(const MSA &msa, const unsigned Ids1[],
 
84
  unsigned uCount1, const unsigned Ids2[], unsigned uCount2)
 
85
        {
 
86
#if     TIMING
 
87
        TICKS t1 = GetClockTicks();
 
88
#endif
 
89
        unsigned *SeqIndexes1 = new unsigned[uCount1];
 
90
        unsigned *SeqIndexes2 = new unsigned[uCount2];
 
91
 
 
92
        for (unsigned n = 0; n < uCount1; ++n)
 
93
                SeqIndexes1[n] = msa.GetSeqIndex(Ids1[n]);
 
94
 
 
95
        for (unsigned n = 0; n < uCount2; ++n)
 
96
                SeqIndexes2[n] = msa.GetSeqIndex(Ids2[n]);
 
97
 
 
98
#if DOUBLE_AFFINE
 
99
        extern SCORE ObjScoreDA(const MSA &msa, SCORE *ptrLetters, SCORE *ptrGaps);
 
100
        SCORE Letters, Gaps;
 
101
        SCORE dObjScore = ObjScoreDA(msa, &Letters, &Gaps);
 
102
 
 
103
        delete[] SeqIndexes1;
 
104
        delete[] SeqIndexes2;
 
105
#else
 
106
        SCORE dObjScore = ObjScore(msa, SeqIndexes1, uCount1, SeqIndexes2, uCount2);
 
107
#endif
 
108
#if     TIMING
 
109
        TICKS t2 = GetClockTicks();
 
110
        g_ticksObjScore += (t2 - t1);
 
111
#endif
 
112
        return dObjScore;
 
113
        }