File: Extension.cpp

package info (click to toggle)
mapsembler2 2.1.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,116 kB
  • ctags: 3,391
  • sloc: cpp: 27,549; ansic: 2,662; asm: 271; sh: 226; makefile: 153
file content (48 lines) | stat: -rw-r--r-- 1,539 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
//  Extension.cpp
//  
//
//  Created by Pierre Peterlongo on 22/10/2012
//

#ifndef ASSERTS
#define NDEBUG // disable asserts, they're computationnally intensive
#endif

#include "Extension.h"

extern Bloom * bloo1;
extern BinaryBank * SolidKmers;
extern char * prefix_trashable;


Extension::Extension(const char * kmer){
//  printf("CREATE EXTENSION for %s (direction:%s)\n", kmer,LeftorRight );
  starting_kmer = kmer;
  node_id=-1;
}



void Extension::perform_extension(const string prefix, int max_graph_depth, const char extension_type, int max_nodes, parcours_t search_mode){
    terminator->reset(); // distinct extensions may share kmers, however, a unique extension doesn't. 
    if(extension_type==1 || extension_type==2)
            IterativeExtensions::when_to_stop_extending = IterativeExtensions::After_first_contig; // sequence
    else
            IterativeExtensions::when_to_stop_extending = IterativeExtensions::Until_max_depth; //graph
    
    if(extension_type==1 || extension_type==3)
            IterativeExtensions::traversal_type = IterativeExtensions::SimplePaths; // strict
    else
            IterativeExtensions::traversal_type = IterativeExtensions::Monument; // contigs

    string linear_seq_name = prefix_trashable+starting_kmer;
     
    // construct and store the linear seqs'
    IterativeExtensions::dont_output_first_nucleotide = true;
    IterativeExtensions::construct_linear_seqs(starting_kmer,string(), max_graph_depth, linear_seq_name, 1, max_nodes,  search_mode);
    
    
    
    
}