- Timestamp:
- 20/12/11 14:33:05 (5 months ago)
- Location:
- trunk/PROBE_SET
- Files:
-
- 5 modified
- 1 copied
- 1 moved
-
Makefile (modified) (3 diffs)
-
ps_arb2asciipaths.cxx (modified) (1 diff)
-
ps_convert_db.cxx (modified) (1 diff)
-
ps_detect_weak_differences.cxx (modified) (2 diffs)
-
ps_get_probes.cxx (modified) (1 diff)
-
ps_pg_specmap.hxx (moved) (moved from trunk/PROBE_SET/ps_pg_tree_functions.cxx) (3 diffs)
-
ps_pg_tree_functions.hxx (copied) (copied from trunk/PROBE_SET/ps_pg_tree_functions.cxx) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PROBE_SET/Makefile
r7623 r8311 127 127 ps_arb2asciipaths.o: ps_defs.hxx 128 128 ps_arb2asciipaths.o: ps_filebuffer.hxx 129 ps_arb2asciipaths.o: ps_pg_tree_functions. cxx129 ps_arb2asciipaths.o: ps_pg_tree_functions.hxx 130 130 ps_arb2asciipaths.o: $(ARBHOME)/INCLUDE/ad_prot.h 131 131 ps_arb2asciipaths.o: $(ARBHOME)/INCLUDE/arb_assert.h … … 146 146 ps_convert_db.o: ps_filebuffer.hxx 147 147 ps_convert_db.o: ps_node.hxx 148 ps_convert_db.o: ps_pg_tree_functions.cxx 148 ps_convert_db.o: ps_pg_specmap.hxx 149 ps_convert_db.o: ps_pg_tree_functions.hxx 149 150 ps_convert_db.o: ps_tools.hxx 150 151 ps_convert_db.o: $(ARBHOME)/INCLUDE/ad_prot.h … … 222 223 ps_get_probes.o: ps_defs.hxx 223 224 ps_get_probes.o: ps_filebuffer.hxx 224 ps_get_probes.o: ps_pg_tree_functions. cxx225 ps_get_probes.o: ps_pg_tree_functions.hxx 225 226 ps_get_probes.o: $(ARBHOME)/INCLUDE/ad_prot.h 226 227 ps_get_probes.o: $(ARBHOME)/INCLUDE/arb_assert.h -
trunk/PROBE_SET/ps_arb2asciipaths.cxx
r8309 r8311 11 11 12 12 #include "ps_filebuffer.hxx" 13 #include "ps_pg_tree_functions. cxx"13 #include "ps_pg_tree_functions.hxx" 14 14 15 15 static IDVector *__PATH = new IDVector; -
trunk/PROBE_SET/ps_convert_db.cxx
r8309 r8311 12 12 #include "ps_tools.hxx" 13 13 #include "ps_database.hxx" 14 #include "ps_pg_tree_functions.cxx" 14 #include "ps_pg_tree_functions.hxx" 15 #include "ps_pg_specmap.hxx" 15 16 16 17 #include <sys/times.h> -
trunk/PROBE_SET/ps_detect_weak_differences.cxx
r8309 r8311 33 33 static SpeciesID __ONEMATCH_MAX_ID; 34 34 35 #if defined(DEBUG) 35 36 static void PS_print_path() { 36 37 printf("__PATH %3zu :", __PATH->size()); … … 52 53 printf("\n"); 53 54 } 54 55 #endif 55 56 56 57 static void PS_detect_weak_differences_stepdown(const PS_NodePtr _ps_node, -
trunk/PROBE_SET/ps_get_probes.cxx
r8309 r8311 10 10 // =============================================================== // 11 11 12 #include "ps_pg_tree_functions. cxx"12 #include "ps_pg_tree_functions.hxx" 13 13 #include "ps_filebuffer.hxx" 14 14 -
trunk/PROBE_SET/ps_pg_specmap.hxx
r8309 r8311 1 #ifndef PS_PG_ TREE_FUNCTIONS_CXX2 #define PS_PG_ TREE_FUNCTIONS_CXX1 #ifndef PS_PG_SPECMAP_HXX 2 #define PS_PG_SPECMAP_HXX 3 3 4 #ifndef PS_DEFS_HXX 5 #include "ps_defs.hxx" 6 #endif 7 8 #ifndef ARBDB_H 9 #include <arbdb.h> 10 #endif 11 12 using namespace std; 13 14 // API for Probe-Group-Database format 15 16 // -------------------------------------------------------------------------------- 17 // mapping shortname <-> SpeciesID 4 // ----------------------------------------- 5 // mapping shortname <-> SpeciesID 18 6 19 7 static Name2IDMap __NAME2ID_MAP; … … 61 49 } 62 50 63 staticconst string& PG_SpeciesID2SpeciesName(SpeciesID num) {51 inline const string& PG_SpeciesID2SpeciesName(SpeciesID num) { 64 52 ps_assert(__MAPS_INITIALIZED); // you didn't call PG_initSpeciesMaps 65 53 return __ID2NAME_MAP[num]; … … 70 58 } 71 59 72 // db-structure of group_tree:73 //74 // <root>75 // |76 // |77 // "group_tree"78 // |79 // |80 // "node" <more nodes...>81 // | | |82 // | | |83 // | | "group" (contains all probes for this group; may be missing)84 // | |85 // | "num" (contains species-number (created by PG_SpeciesName2SpeciesID))86 // |87 // "node" <more nodes...>88 //89 // Notes: - the "node"s contained in the path from "group_tree" to any "group"90 // describes the members of the group91 92 93 94 static GBDATA *PG_get_first_probe(GBDATA *pb_group) {95 return GB_entry(pb_group, "probe");96 }97 98 static GBDATA *PG_get_next_probe(GBDATA *pb_probe) {99 ps_assert(GB_has_key(pb_probe, "probe"));100 return GB_nextEntry(pb_probe);101 }102 103 static const char *PG_read_probe(GBDATA *pb_probe) {104 return GB_read_char_pntr(pb_probe);105 }106 107 static GBDATA *PS_get_first_node(GBDATA *pb_nodecontainer) {108 return GB_entry(pb_nodecontainer, "node");109 }110 111 static GBDATA *PS_get_next_node(GBDATA *pb_node) {112 ps_assert(GB_has_key(pb_node, "node"));113 return GB_nextEntry(pb_node);114 }115 116 60 #else 117 #error ps_pg_ tree_functions.cxx included twice118 #endif 61 #error ps_pg_specmap.hxx included twice 62 #endif // PS_PG_SPECMAP_HXX -
trunk/PROBE_SET/ps_pg_tree_functions.hxx
r8309 r8311 1 #ifndef PS_PG_TREE_FUNCTIONS_ CXX2 #define PS_PG_TREE_FUNCTIONS_ CXX1 #ifndef PS_PG_TREE_FUNCTIONS_HXX 2 #define PS_PG_TREE_FUNCTIONS_HXX 3 3 4 4 #ifndef PS_DEFS_HXX 5 5 #include "ps_defs.hxx" 6 6 #endif 7 8 7 #ifndef ARBDB_H 9 8 #include <arbdb.h> 10 9 #endif 11 10 12 using namespace std;13 14 11 // API for Probe-Group-Database format 15 16 // --------------------------------------------------------------------------------17 // mapping shortname <-> SpeciesID18 19 static Name2IDMap __NAME2ID_MAP;20 static ID2NameMap __ID2NAME_MAP;21 static bool __MAPS_INITIALIZED = false;22 23 static GB_ERROR PG_initSpeciesMaps(GBDATA *pb_main) {24 25 GB_transaction pb_dummy(pb_main);26 27 ps_assert(!__MAPS_INITIALIZED);28 29 // look for existing mapping in pb-db:30 GBDATA *pb_mapping = GB_entry(pb_main, "species_mapping");31 if (!pb_mapping) { // error32 GB_export_error("No species mapping");33 }34 else {35 // retrieve mapping from string36 const char *mapping = GB_read_char_pntr(pb_mapping);37 if (!mapping) return GB_export_error("Can't read mapping");38 39 while (mapping[0]) {40 const char *comma = strchr(mapping, ','); if (!comma) break;41 const char *semicolon = strchr(comma, ';'); if (!semicolon) break;42 string name(mapping, comma-mapping);43 comma+=1;44 string idnum(comma, semicolon-comma);45 SpeciesID id = atoi(idnum.c_str());46 47 __NAME2ID_MAP[name] = id;48 __ID2NAME_MAP[id] = name;49 50 mapping = semicolon+1;51 }52 }53 54 __MAPS_INITIALIZED = true;55 return 0;56 }57 58 SpeciesID PG_SpeciesName2SpeciesID(const string& shortname) {59 ps_assert(__MAPS_INITIALIZED); // you didn't call PG_initSpeciesMaps60 return __NAME2ID_MAP[shortname];61 }62 63 static const string& PG_SpeciesID2SpeciesName(SpeciesID num) {64 ps_assert(__MAPS_INITIALIZED); // you didn't call PG_initSpeciesMaps65 return __ID2NAME_MAP[num];66 }67 68 static int PG_NumberSpecies() {69 return __ID2NAME_MAP.size();70 }71 12 72 13 // db-structure of group_tree: … … 92 33 93 34 94 staticGBDATA *PG_get_first_probe(GBDATA *pb_group) {35 inline GBDATA *PG_get_first_probe(GBDATA *pb_group) { 95 36 return GB_entry(pb_group, "probe"); 96 37 } 97 38 98 staticGBDATA *PG_get_next_probe(GBDATA *pb_probe) {39 inline GBDATA *PG_get_next_probe(GBDATA *pb_probe) { 99 40 ps_assert(GB_has_key(pb_probe, "probe")); 100 41 return GB_nextEntry(pb_probe); 101 42 } 102 43 103 staticconst char *PG_read_probe(GBDATA *pb_probe) {44 inline const char *PG_read_probe(GBDATA *pb_probe) { 104 45 return GB_read_char_pntr(pb_probe); 105 46 } 106 47 107 staticGBDATA *PS_get_first_node(GBDATA *pb_nodecontainer) {48 inline GBDATA *PS_get_first_node(GBDATA *pb_nodecontainer) { 108 49 return GB_entry(pb_nodecontainer, "node"); 109 50 } 110 51 111 staticGBDATA *PS_get_next_node(GBDATA *pb_node) {52 inline GBDATA *PS_get_next_node(GBDATA *pb_node) { 112 53 ps_assert(GB_has_key(pb_node, "node")); 113 54 return GB_nextEntry(pb_node); … … 115 56 116 57 #else 117 #error ps_pg_tree_functions. cxx included twice118 #endif 58 #error ps_pg_tree_functions.hxx included twice 59 #endif // PS_PG_TREE_FUNCTIONS_HXX
