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

« back to all changes in this revision

Viewing changes to GENOM/GEN_gene.cxx

  • 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
 
/*********************************************************************************
2
 
 *  Coded by Ralf Westram (coder@reallysoft.de) in 2001                          *
3
 
 *  Institute of Microbiology (Technical University Munich)                      *
4
 
 *  http://www.mikro.biologie.tu-muenchen.de/                                    *
5
 
 *********************************************************************************/
6
 
 
7
 
#include <stdio.h>
8
 
#include <stdlib.h>
9
 
#include <string.h>
10
 
#include <string>
11
 
 
12
 
#include <arbdb.h>
13
 
#include <arbdbt.h>
14
 
#include <aw_root.hxx>
15
 
#include <aw_device.hxx>
16
 
 
17
 
#include "GEN.hxx"
 
1
// =============================================================== //
 
2
//                                                                 //
 
3
//   File      : GEN_gene.cxx                                      //
 
4
//   Purpose   :                                                   //
 
5
//                                                                 //
 
6
//   Coded by Ralf Westram (coder@reallysoft.de) in 2001           //
 
7
//   Institute of Microbiology (Technical University Munich)       //
 
8
//   http://www.arb-home.de/                                       //
 
9
//                                                                 //
 
10
// =============================================================== //
 
11
 
18
12
#include "GEN_gene.hxx"
19
13
#include "GEN_local.hxx"
20
14
#include "GEN_nds.hxx"
21
15
 
 
16
#include <aw_awar.hxx>
 
17
#include <aw_msg.hxx>
 
18
#include <aw_root.hxx>
 
19
#include <arbdbt.h>
 
20
#include <adGene.h>
 
21
 
22
22
// Standard fields of a gb_gene entry:
23
23
// -----------------------------------
24
24
// name                  = short name of gene (unique in one species)
26
26
// pos_start             = start-position(s) of gene(-parts); range is 1...genomeLength
27
27
// pos_stop              = end-position(s)   of gene(-parts); range is 1...genomeLength
28
28
// pos_certain           = contains pairs of chars (1. for start-pos, 2. for end-pos)
29
 
// 
 
29
//
30
30
//                         '=' means 'pos is exact'
31
31
//                         '<' means 'pos may be lower'
32
32
//                         '>' means 'pos may be higher'
33
33
//                         '+' means 'pos is directly behind'
34
34
//                         '-' means 'pos is directly before'
35
 
//                         
 
35
//
36
36
//                         if pos_certain is missing -> like '=='
37
 
//                         
 
37
//
38
38
// pos_complement        = 1 -> CDS is on opposite strand
39
39
 
40
 
// fields for splitted genes:
 
40
// fields for split genes:
41
41
// --------------------------
42
42
// pos_joined         = xxx -> gene consists of abs(xxx) parts (if missing xxx == 1 is assumed)
43
 
// 
 
43
//
44
44
// if abs(xxx)>1, the gene consists of several parts.
45
45
// In that case the fields 'pos_start', 'pos_stop',  'pos_certain' and 'pos_complement'
46
46
// contain multiple comma-separated values - one for each joined part.
47
 
// 
 
47
//
48
48
// if xxx is < -1, then joining the parts does not make sense (or nothing is known about it)
49
49
//
50
50
// Note: Please do not access these fields manually - use GEN_read_position!
54
54
//
55
55
// During import ARB tries to reproduce existing translations.
56
56
// If it succeeds, it removes the translation.
57
 
// 
 
57
//
58
58
// ARB_translation      = written if ARB translation differs from original translation
59
59
//                        (original translation is not deleted in this case)
60
60
// ARB_translation_note = additional info about failed translation
64
64
// identical location exists as well, ARB sets ARB_display_hidden to 1 for
65
65
// the 'gene'. For the other gene with diff. type ARB sets a reference to the
66
66
// hidden 'gene':
67
 
// 
 
67
//
68
68
// ARB_is_gene          = shortname of related hidden gene
69
69
 
70
70
 
83
83
// pos_uncertain = contains 2 chars (1. for start-pos, 2. for end-pos); = means 'pos is exact'; < means 'pos may be lower'; > means 'pos may be higher'; missing -> like ==
84
84
// complement    = 1 -> encoding from right to left
85
85
//
86
 
// fields for splitted genes:
 
86
// fields for split genes:
87
87
// --------------------------
88
88
// pos_joined               = xxx -> gene consists of xxx parts (may not exist if xxx == 1)
89
89
// pos_beginxxx, pos_endxxx = start-/end-positions for parts 2...n
111
111
    return loaded_position;
112
112
}
113
113
 
114
 
//  ----------------------------------------------------------
115
 
//      GEN_gene::init(GBDATA *gb_gene_, GEN_root *root_)
116
 
//  ----------------------------------------------------------
117
114
void GEN_gene::init(GBDATA *gb_gene_, GEN_root *root_) {
118
115
    gb_gene = gb_gene_;
119
116
    root    = root_;
126
123
void GEN_gene::load_location(int part, const GEN_position *location) {
127
124
    gen_assert(part >= 1);
128
125
    gen_assert(part <= location->parts);
129
 
  
 
126
 
130
127
    pos1       = location->start_pos[part-1];
131
128
    pos2       = location->stop_pos[part-1];
132
129
    complement = location->complement[part-1];
133
 
  
 
130
 
134
131
    gen_assert(pos1 <= pos2);
135
132
}
136
133
 
141
138
}
142
139
 
143
140
GEN_gene::GEN_gene(GBDATA *gb_gene_, GEN_root *root_, const GEN_position *location, int partNumber) {
144
 
    //  partNumber 1..n which part of a splitted gene
 
141
    //  partNumber 1..n which part of a split gene
145
142
    //  maxParts   1..n of how many parts consists this gene?
146
 
 
 
143
 
147
144
    init(gb_gene_, root_);
148
145
    load_location(partNumber, location);
149
 
 
 
146
 
150
147
    {
151
148
        char buffer[30];
152
149
        sprintf(buffer, " (%i/%i)", partNumber, location->parts);
153
150
        nodeInfo = name+buffer;
154
151
    }
155
152
}
156
 
 
 
153
 
157
154
void GEN_gene::reinit_NDS() const {
158
155
    nodeInfo = GEN_make_node_text_nds(root->GbMain(), gb_gene, 0);
159
156
}
160
157
 
161
 
// -----------------
 
158
// ------------------
162
159
//      GEN_root
163
 
// -----------------
164
160
 
165
161
GEN_root::GEN_root(const char *organism_name_, const char *gene_name_, GBDATA *gb_main_, AW_root *aw_root, GEN_graphic *gen_graphic_)
166
162
    : gb_main(gb_main_)
171
167
    , length(-1)
172
168
    , gb_gene_data(0)
173
169
{
174
 
    GB_transaction  dummy(gb_main);
 
170
    GB_transaction  ta(gb_main);
175
171
    GBDATA         *gb_organism = GBT_find_species(gb_main, organism_name.c_str());
176
172
 
177
173
    if (!gb_organism) {