libbbrc
Bbrc Class Reference

#include <bbrc.h>

List of all members.

Public Member Functions

Inits

Initializer functions.

 Bbrc ()
 Constructor for standard settings: 95% significance Bbrclevel, minimum frequency 2, type trees, dynamic upper bound, BBRC.
 Bbrc (int _type, unsigned int _minfreq)
 Like standard constructor, but type and minimum frequency configurable.
 Bbrc (int _type, unsigned int _minfreq, float chisq_val, bool _do_backbone)
 Like standard constructor, but type, minimum frequency, significance Bbrclevel and BBRC configurable.
 ~Bbrc ()
void Reset ()
 Use this to clear the database before feeding new compounds and activities.
void Defaults ()
 Use this to set default parameters as in default constructor.
Getters

Getter functions.

int GetMinfreq ()
 Get minimum frequency.
int GetType ()
 Get type.
bool GetBackbone ()
 Get whether BBRC representatives should be mined.
bool GetDynamicUpperBound ()
 Get whether dynamic upper bound pruning is used.
bool GetPruning ()
 Get whether statistical metric pruning should be used.
bool GetConsoleOut ()
 Get whether output should be directed to the console.
bool GetAromatic ()
 Get whether aromatic rings should be perceived instead of Kekule notation.
bool GetRefineSingles ()
 Get whether fragments with frequency 1 should be refined.
bool GetDoOutput ()
 Get whether output is enabled.
bool GetBbrcSep ()
 Get whether BBRCs should be separated in the output.
bool GetChisqActive ()
 Get whether chi-square filter is active.
float GetChisqSig ()
 Get significance threshold.
bool GetRegression ()
 Get whether continuous activity values should be used.
Setters

Setter functions.

void SetMinfreq (int val)
 Set minimum frequency (>=1 here). Same as '-f'.
bool SetType (int val)
 Set type 1 (paths) or 2 (trees) here. Same as '-l'.
bool SetBackbone (bool val)
 Pass 'false' here to switch off mining for BBRC representatives. Same as '-b'.
bool SetDynamicUpperBound (bool val)
 Pass 'false' here to disable dynamic upper bound pruning (e.g. for performance measures). Same as '-d'.
bool SetPruning (bool val)
 Pass 'false' here to disable statistical metrical pruning completely. Same as '-u'.
bool SetConsoleOut (bool val)
 Pass 'true' here to disable usage of result vector and directly print each fragment to the console (saves memory).
void SetAromatic (bool val)
 Pass 'true' here to enable aromatic rings and use Kekule notation. IMPORTANT! SET THIS BEFORE CALLING AddCompound()! Same as '-a'.
bool SetRefineSingles (bool val)
 Pass 'true' here to enable refinement of fragments with frequency 1. Same as '-s'.
void SetDoOutput (bool val)
 Pass 'false' here to disable output. Same as '-o'.
bool SetBbrcSep (bool val)
 Set this to 'true' to enable BBRC separators in output.
bool SetChisqActive (bool val)
 Set this to 'true' to enable chi-square filter.
bool SetChisqSig (float _chisq_val)
 Set significance threshold here (between 0 and 1). Same as '-p'.
bool SetRegression (bool val)
 Set 'true' here to enable continuous activity values. Same as '-g'.
bool SetMaxHops (int val)
 Dummy method for max hops (only used in LAST-PM). Same as '-m'.
Others

Other functions.

vector< string > * MineRoot (unsigned int j)
 Mine fragments rooted at the j-th root node (element type).
void ReadGsp (FILE *gsp)
 Read in a gSpan file.
bool AddCompound (string smiles, unsigned int comp_id)
 Add a compound to the database.
bool AddActivity (float act, unsigned int comp_id)
 Add an activity to the database.
bool AddWeight (float weight, unsigned int comp_id)
 Add a weight to the database.
int GetNoRootNodes ()
 Get number of root nodes (different element types).
int GetNoCompounds ()
 Get number of compounds in the database.

Constructor & Destructor Documentation

Bbrc ( )

Constructor for standard settings: 95% significance Bbrclevel, minimum frequency 2, type trees, dynamic upper bound, BBRC.

References fm::bbrc_chisq, fm::bbrc_do_yaml, fm::bbrc_gsp_out, Defaults(), and Reset().

           : init_mining_done(false) {
  if (!fm::bbrc_instance_present) {
      fm::bbrc_database = NULL; fm::bbrc_statistics = NULL; fm::bbrc_chisq = NULL; fm::bbrc_result = NULL;
      Reset();
      Defaults();
      fm::bbrc_instance_present=true;
      if (getenv("FMINER_LAZAR")) fm::bbrc_do_yaml = false;
      if (getenv("FMINER_SMARTS")) fm::bbrc_gsp_out = false; 
      if (getenv("FMINER_PVALUES")) fm::bbrc_pvalues = true;
      if (getenv("FMINER_NO_AROMATIC_WC")) fm::bbrc_aromatic_wc = false;
      if (getenv("FMINER_SILENT")) {
        FILE* fp = freopen ("fminer_debug.txt","w",stderr);
      }
      if (getenv("FMINER_NR_HITS")) fm::bbrc_nr_hits = true;
  }
  else {
    cerr << "Error! Cannot create more than 1 instance." << endl; 
    exit(1);
  }
}
Bbrc ( int  _type,
unsigned int  _minfreq 
)

Like standard constructor, but type and minimum frequency configurable.

References fm::bbrc_chisq, fm::bbrc_do_yaml, fm::bbrc_gsp_out, Defaults(), Reset(), SetMinfreq(), and SetType().

                                           : init_mining_done(false) {
  if (!fm::bbrc_instance_present) {
      fm::bbrc_database = NULL; fm::bbrc_statistics = NULL; fm::bbrc_chisq = NULL; fm::bbrc_result = NULL;
      Reset();
      Defaults();
      SetType(_type);
      SetMinfreq(_minfreq);
      fm::bbrc_instance_present=true;
      if (getenv("FMINER_LAZAR")) fm::bbrc_do_yaml = false;
      if (getenv("FMINER_SMARTS")) fm::bbrc_gsp_out = false; 
      if (getenv("FMINER_PVALUES")) fm::bbrc_pvalues = true;
      if (getenv("FMINER_NO_AROMATIC_WC")) fm::bbrc_aromatic_wc = false;
      if (getenv("FMINER_SILENT")) {
        FILE* fp = freopen ("fminer_debug.txt","w",stderr);
      }
      if (getenv("FMINER_NR_HITS")) fm::bbrc_nr_hits = true;

  }
  else {
    cerr << "Error! Cannot create more than 1 instance." << endl; 
    exit(1);
  }

}
Bbrc ( int  _type,
unsigned int  _minfreq,
float  chisq_val,
bool  _do_backbone 
)

Like standard constructor, but type, minimum frequency, significance Bbrclevel and BBRC configurable.

References fm::bbrc_chisq, fm::bbrc_do_yaml, fm::bbrc_gsp_out, Defaults(), Reset(), SetBackbone(), SetChisqSig(), SetMinfreq(), and SetType().

                                                                                : init_mining_done(false) {
  if (!fm::bbrc_instance_present) {
      fm::bbrc_database = NULL; fm::bbrc_statistics = NULL; fm::bbrc_chisq = NULL; fm::bbrc_result = NULL;
      Reset();
      Defaults();
      SetType(_type);
      SetMinfreq(_minfreq);
      SetChisqSig(_chisq_val);
      SetBackbone(_do_backbone);
      fm::bbrc_instance_present=true;
      if (getenv("FMINER_LAZAR")) fm::bbrc_do_yaml = false;
      if (getenv("FMINER_SMARTS")) fm::bbrc_gsp_out = false; 
      if (getenv("FMINER_PVALUES")) fm::bbrc_pvalues = true;
      if (getenv("FMINER_NO_AROMATIC_WC")) fm::bbrc_aromatic_wc = false;
      if (getenv("FMINER_SILENT")) {
        FILE* fp = freopen ("fminer_debug.txt","w",stderr);
      }
      if (getenv("FMINER_NR_HITS")) fm::bbrc_nr_hits = true;

  }
  else {
    cerr << "Error! Cannot create more than 1 instance." << endl; 
    exit(1);
  }

}
~Bbrc ( )

References fm::bbrc_chisq, and fm::bbrc_ks.

            {
    if (fm::bbrc_instance_present) {
        delete fm::bbrc_database;
        delete fm::bbrc_statistics; 
        delete fm::bbrc_chisq; 
        delete fm::bbrc_ks;
        delete fm::bbrc_graphstate;
        delete fm::bbrc_closelegoccurrences;
        delete fm::bbrc_legoccurrences;

        fm::bbrc_Bbrccandidatelegsoccurrences.clear();
        fm::bbrc_candidatecloselegsoccs.clear();
        fm::bbrc_candidateBbrccloselegsoccsused.clear();

        fm::bbrc_instance_present=false;
    }
}

Member Function Documentation

bool AddActivity ( float  act,
unsigned int  comp_id 
)

Add an activity to the database.

References fm::bbrc_db_built.

                                                      {
  if (fm::bbrc_db_built) {
    cerr << "BbrcDatabase has been already processed! Please reset() and insert a new dataset." << endl;
    return false;
  }
  activity_map.insert(make_pair(comp_id, act));
  return true;
}
bool AddCompound ( string  smiles,
unsigned int  comp_id 
)

Add a compound to the database.

References fm::bbrc_db_built.

                                                          {
  if (fm::bbrc_db_built) {
    cerr << "BbrcDatabase has been already processed! Please reset() and insert a new dataset." << endl;
    return false;
  }
  stringstream ss(smiles);
  OBConversion conv(&ss, &cout);
  if(!conv.SetInAndOutFormats("SMI","INCHI")) {
    cerr << "Formats not available" << endl;
    return false;
  }
  OBMol mol;
  if (!conv.Read(&mol)) {
    cerr << "Could not convert '" << smiles << "' (leaving out)." << endl;
    return false;
  }
  conv.SetOptions("w",OBConversion::OUTOPTIONS);
  string inchi = conv.WriteString(&mol);
  // remove newline
  string::size_type pos = inchi.find_last_not_of("\n");
  if (pos != string::npos) {
    inchi = inchi.substr(0, pos+1);
  }
  //cerr << "Inchi: '" << inchi << "'" << endl;

  // insert into map to check doubles
  pair<unsigned int, string> ori = make_pair(comp_id, smiles);
  pair< map<string,pair<unsigned int, string> >::iterator, bool> res = inchi_compound_map.insert(make_pair(inchi,ori));
  if (!res.second) {
    cerr << "Note: structure of '" << smiles << "' has been already inserted, inserting anyway..." << endl;
  }

  // insert into actual map augmented by number
  string inchi_no = inchi;
  inchi_no += "-";
  comp_runner++;
  stringstream out; out << comp_runner;
  string comp_runner_s = out.str();
  inchi_no += comp_runner_s;
  pair< map<string,pair<unsigned int, string> >::iterator, bool> resmm = inchi_compound_mmap.insert(make_pair(inchi_no,ori));
  return true;
}
bool AddWeight ( float  weight,
unsigned int  comp_id 
)

Add a weight to the database.

References fm::bbrc_db_built.

                                                       {
  if (fm::bbrc_db_built) {
    cerr << "BbrcDatabase has been already processed! Please reset() and insert a new dataset." << endl;
    return false;
  }
  if (weight <= 0.0) {
    cerr << "Weight '" << weight << "' for id '" << comp_id << "' is not positive." << endl;
    return false;
  }
  weight_map.insert(make_pair(comp_id, weight));
  return true;
}
void Defaults ( )

Use this to set default parameters as in default constructor.

References fm::bbrc_adjust_ub, fm::bbrc_aromatic, fm::bbrc_bbrc_sep, fm::bbrc_chisq, fm::bbrc_do_pruning, fm::bbrc_do_yaml, fm::bbrc_gsp_out, fm::bbrc_ks, and fm::bbrc_regression.

Referenced by Bbrc().

                    {
    fm::bbrc_minfreq = 2;
    fm::bbrc_type = 2;
    fm::bbrc_do_pruning = true;
    fm::bbrc_console_out = false;
    fm::bbrc_aromatic = true;
    fm::bbrc_refine_singles = false;
    fm::bbrc_do_output=true;
    fm::bbrc_bbrc_sep=false;
    fm::bbrc_updated = true;
    fm::bbrc_gsp_out=true;
    fm::bbrc_nr_hits = false;

    // BBRC
    fm::bbrc_ks->sig = 0.95;
    fm::bbrc_chisq->sig = -1.0;
    fm::bbrc_do_backbone = true;
    fm::bbrc_adjust_ub = true;
    fm::bbrc_regression=false;
    fm::bbrc_do_yaml=true;
    fm::bbrc_pvalues=false;
    fm::bbrc_aromatic_wc=true;
}
bool GetAromatic ( )

Get whether aromatic rings should be perceived instead of Kekule notation.

References fm::bbrc_aromatic.

Referenced by MineRoot().

bool GetBackbone ( )

Get whether BBRC representatives should be mined.

Referenced by MineRoot(), SetBbrcSep(), SetDynamicUpperBound(), and SetRegression().

{return fm::bbrc_do_backbone;}
bool GetBbrcSep ( )

Get whether BBRCs should be separated in the output.

References fm::bbrc_bbrc_sep.

Referenced by MineRoot(), SetBackbone(), SetBbrcSep(), SetConsoleOut(), and SetPruning().

bool GetChisqActive ( )

Get whether chi-square filter is active.

References fm::bbrc_chisq.

Referenced by MineRoot(), SetBackbone(), SetChisqActive(), SetDynamicUpperBound(), and SetPruning().

{return fm::bbrc_chisq->active;}
float GetChisqSig ( )

Get significance threshold.

References fm::bbrc_chisq, fm::bbrc_ks, and fm::bbrc_regression.

Referenced by MineRoot().

{if (!fm::bbrc_regression) return fm::bbrc_chisq->sig; else return fm::bbrc_ks->sig; }
bool GetConsoleOut ( )

Get whether output should be directed to the console.

Referenced by SetBbrcSep().

{return fm::bbrc_console_out;}
bool GetDoOutput ( )

Get whether output is enabled.

Referenced by MineRoot().

{return fm::bbrc_do_output;}

Get whether dynamic upper bound pruning is used.

References fm::bbrc_adjust_ub.

Referenced by MineRoot(), SetBackbone(), and SetPruning().

int GetMinfreq ( )

Get minimum frequency.

Referenced by MineRoot(), and SetRefineSingles().

{return fm::bbrc_minfreq;}
int GetNoCompounds ( ) [inline]

Get number of compounds in the database.

References fm::bbrc_db_built.

int GetNoRootNodes ( ) [inline]

Get number of root nodes (different element types).

References fm::bbrc_db_built.

bool GetPruning ( )

Get whether statistical metric pruning should be used.

References fm::bbrc_do_pruning.

Referenced by MineRoot(), SetBbrcSep(), SetDynamicUpperBound(), and SetRegression().

bool GetRefineSingles ( )

Get whether fragments with frequency 1 should be refined.

Referenced by MineRoot(), SetMinfreq(), and SetRefineSingles().

{return fm::bbrc_refine_singles;}
bool GetRegression ( )

Get whether continuous activity values should be used.

References fm::bbrc_regression.

Referenced by MineRoot().

int GetType ( )

Get type.

Referenced by MineRoot().

{return fm::bbrc_type;}
vector< string > * MineRoot ( unsigned int  j)

Mine fragments rooted at the j-th root node (element type).

References fm::bbrc_bbrc_sep, fm::bbrc_chisq, fm::bbrc_db_built, fm::bbrc_regression, GetAromatic(), GetBackbone(), GetBbrcSep(), GetChisqActive(), GetChisqSig(), GetDoOutput(), GetDynamicUpperBound(), GetMinfreq(), GetPruning(), GetRefineSingles(), GetRegression(), and GetType().

                                             {
    fm::bbrc_result->clear();
    if (!init_mining_done) {
        if (!fm::bbrc_db_built) {
          AddDataCanonical();
        }
        // Adjust chisq bound
        if (!fm::bbrc_regression) {
          if (fm::bbrc_chisq->nr_acts.size()>1 && fm::bbrc_chisq->nr_acts.size() < 6) {
            if (fm::bbrc_chisq->sig == -1.0) { // do not override user-supplied threshold, only machine default.
              fm::bbrc_chisq->sig=fm::bbrc_chisq->df_thresholds[fm::bbrc_chisq->nr_acts.size()-1];
            }
          }
          else if (fm::bbrc_chisq->nr_acts.size()==1) {
            cout << "";
          }
          else {
            cerr << "Error! Too many classes: '" << fm::bbrc_chisq->nr_acts.size() << "' (Max. 5)." << endl;
            exit(1);
          }
        }
        fm::bbrc_database->edgecount (); 
        fm::bbrc_database->reorder (); 
        BbrcinitBbrcLegStatics (); 
        fm::bbrc_graphstate->init (); 
        if (fm::bbrc_bbrc_sep && !fm::bbrc_do_backbone && fm::bbrc_do_output && !fm::bbrc_console_out) (*fm::bbrc_result) << fm::bbrc_graphstate->sep();
        init_mining_done=true; 

        if (!fm::bbrc_regression) {
             cerr << "Settings:" << endl \
             << "---" << endl \
             << "Type:                                 " << GetType() << endl \
             << "Minimum frequency:                    " << GetMinfreq() << endl \
             << "Aromatic:                             " << GetAromatic() << endl \
             << "Chi-square active (chi-square-value): " << GetChisqActive() << " (" << GetChisqSig()<< ")" << endl \
             << "BBRC mining:                          " << GetBackbone() << endl \
             << "Statistical metric (dynamic) pruning: " << GetPruning() << " (" << GetDynamicUpperBound() << ")" << endl \
             << "Refine patterns with single support:  " << GetRefineSingles() << endl \
             << "Do output:                            " << GetDoOutput() << endl \
             << "BBRC sep:                             " << GetBbrcSep() << endl \
             << "Regression:                           " << GetRegression() << endl \
             << "---" << endl;
        }
        else {
             cerr << "Settings:" << endl \
             << "---" << endl \
             << "Type:                                 " << GetType() << endl \
             << "Minimum frequency:                    " << GetMinfreq() << endl \
             << "Aromatic:                             " << GetAromatic() << endl \
             << "KS active (p-value):                  " << GetChisqActive() << " (" << GetChisqSig()<< ")" << endl \
             << "BBRC mining:                          " << GetBackbone() << endl \
             << "Statistical metric (dynamic) pruning: " << GetPruning() << " (" << GetDynamicUpperBound() << ")" << endl \
             << "Refine patterns with single support:  " << GetRefineSingles() << endl \
             << "Do output:                            " << GetDoOutput() << endl \
             << "BBRC sep:                             " << GetBbrcSep() << endl \
             << "Regression:                           " << GetRegression() << endl \
             << "---" << endl;
        }

    }


    if (j >= fm::bbrc_database->nodelabels.size()) { cerr << "Error! Root node " << j << " does not exist." << endl;  exit(1); }
    if ( fm::bbrc_database->nodelabels[j].frequency >= fm::bbrc_minfreq && fm::bbrc_database->nodelabels[j].frequentedgelabels.size () ) {
        BbrcPath path(j);
        path.expand(); // mining step
    }
    if (getenv("FMINER_SILENT")) {
      fclose (stderr);
    }
    return fm::bbrc_result;
}
void ReadGsp ( FILE *  gsp)

Read in a gSpan file.

                           {
    fm::bbrc_database->readGsp(gsp);
}
void Reset ( )

Use this to clear the database before feeding new compounds and activities.

References fm::bbrc_chisq, fm::bbrc_db_built, fm::bbrc_ks, and SetChisqActive().

Referenced by Bbrc().

                 { 
    if (fm::bbrc_instance_present) {
        delete fm::bbrc_database;
        delete fm::bbrc_statistics;
        delete fm::bbrc_chisq;
        delete fm::bbrc_ks;
        delete fm::bbrc_graphstate;
        delete fm::bbrc_closelegoccurrences;
        delete fm::bbrc_legoccurrences;
    }
    fm::bbrc_database = new BbrcDatabase();
    fm::bbrc_db_built = false;
    fm::bbrc_statistics = new BbrcStatistics();
    fm::bbrc_chisq = new ChisqBbrcConstraint(-1.0);
    fm::bbrc_ks = new KSBbrcConstraint(0.95);
    fm::bbrc_graphstate = new BbrcGraphState();
    fm::bbrc_closelegoccurrences = new CloseBbrcLegOccurrences();
    fm::bbrc_legoccurrences = new BbrcLegOccurrences();

    fm::bbrc_Bbrccandidatelegsoccurrences.clear();
    fm::bbrc_candidatecloselegsoccs.clear();
    fm::bbrc_candidateBbrccloselegsoccsused.clear();

    SetChisqActive(true); 
    fm::bbrc_result = &r;

    // clearing privates
    init_mining_done = false;
    comp_runner=0; 
    comp_no=0; 
    r.clear();
    inchi_compound_map.clear();
    inchi_compound_mmap.clear();
    activity_map.clear();
    weight_map.clear();

    if (getenv("FMINER_SILENT")) {
        fclose (stderr);
        FILE* fp = freopen ("fminer_debug.txt","w",stderr);
    }
}
void SetAromatic ( bool  val)

Pass 'true' here to enable aromatic rings and use Kekule notation. IMPORTANT! SET THIS BEFORE CALLING AddCompound()! Same as '-a'.

References fm::bbrc_aromatic.

                               {
    fm::bbrc_aromatic = val;
}
bool SetBackbone ( bool  val)

Pass 'false' here to switch off mining for BBRC representatives. Same as '-b'.

References GetBbrcSep(), GetChisqActive(), GetDynamicUpperBound(), SetBbrcSep(), and SetDynamicUpperBound().

Referenced by Bbrc(), SetChisqActive(), and SetRegression().

                               {
    // internal: chisq active
    if (val && !GetChisqActive()) {
        cerr << "Warning! BBRC mining could not be enabled due to deactivated significance criterium." << endl;
    }
    // -------- !db --------
    else if (!val && GetDynamicUpperBound()) {
        cerr << "Notice: Disabling dynamic upper bound pruning due to switched-off BBRC mining." << endl;
        SetDynamicUpperBound(false);
        fm::bbrc_do_backbone = val;
    }
    // -------- r!b ---------
    else if (val && GetBbrcSep()) {
        cerr << "Notice: Disabling BBRC separator due to enabled BBRC mining." << endl;
        SetBbrcSep(false);
        fm::bbrc_do_backbone = val;
    }
    else fm::bbrc_do_backbone = val;
    return 1;
}
bool SetBbrcSep ( bool  val)

Set this to 'true' to enable BBRC separators in output.

References fm::bbrc_bbrc_sep, GetBackbone(), GetBbrcSep(), GetConsoleOut(), GetPruning(), and SetConsoleOut().

Referenced by SetBackbone(), and SetPruning().

                              {
    //  ------- r!b ---------
    if (val && GetBackbone()) { 
        cerr << "Warning! BBRC separator could not be enabled due to enabled BBRC mining." << endl;
    }
    // -------- ru ---------
    if (val && !GetPruning()) {
        cerr << "Warning! BBRC separator could not be enabled due to disabled statistical metric pruning." << endl;
    }
    else {
        fm::bbrc_bbrc_sep=val;
        if (GetBbrcSep()) {
            // console out not switched by fminer
            if (GetConsoleOut()) {
                 cerr << "Notice: Disabling console output, using result vector." << endl;
                 SetConsoleOut(false);
            }
        }
    }
    return 1;
}
bool SetChisqActive ( bool  val)

Set this to 'true' to enable chi-square filter.

References fm::bbrc_chisq, GetChisqActive(), SetBackbone(), SetDynamicUpperBound(), SetPruning(), and SetRegression().

Referenced by Reset().

                                  {
    fm::bbrc_chisq->active = val;
    // chisq active not switched by fminer
    if (!GetChisqActive()) {
        cerr << "Notice: Disabling dynamic upper bound pruning due to deactivated significance criterium." << endl;
        SetDynamicUpperBound(false); //order important
        cerr << "Notice: Disabling BBRC mining due to deactivated significance criterium." << endl;
        SetBackbone(false);
        cerr << "Notice: Disabling statistical metric pruning due to deactivated significance criterium." << endl;
        SetPruning(false);
        SetRegression(false);
    }
    return 1;
}
bool SetChisqSig ( float  _chisq_val)

Set significance threshold here (between 0 and 1). Same as '-p'.

References fm::bbrc_chisq, fm::bbrc_ks, and fm::bbrc_regression.

Referenced by Bbrc().

                                       {
    // parameters not regarded in integrity constraints
    if (_chisq_val < 0.0 || _chisq_val > 1.0) { cerr << "Error! Invalid value '" << _chisq_val << "' for parameter chisq." << endl; exit(1); }
    if (fm::bbrc_regression) {
         fm::bbrc_ks->sig = _chisq_val; 
    }
    else {
        fm::bbrc_chisq->sig = gsl_cdf_chisq_Pinv(_chisq_val, 1);
        return 1;
    }
}
bool SetConsoleOut ( bool  val)

Pass 'true' here to disable usage of result vector and directly print each fragment to the console (saves memory).

References GetBbrcSep().

Referenced by SetBbrcSep().

                                 {
    // console out not switched by fminer
    if (val) {
        if (GetBbrcSep()) cerr << "Warning! Console output could not be enabled due to enabled BBRC separator." << endl;
        else fm::bbrc_console_out=val;
    }
    return 1;
}
void SetDoOutput ( bool  val)

Pass 'false' here to disable output. Same as '-o'.

                               {
    fm::bbrc_do_output = val;
}
bool SetDynamicUpperBound ( bool  val)

Pass 'false' here to disable dynamic upper bound pruning (e.g. for performance measures). Same as '-d'.

References fm::bbrc_adjust_ub, GetBackbone(), GetChisqActive(), and GetPruning().

Referenced by SetBackbone(), SetChisqActive(), and SetPruning().

                                        {
    // -------- !db ---------
    if (val && !GetBackbone()) {
        cerr << "Warning! Dynamic upper bound pruning could not be enabled due to disabled BBRC mining." << endl;
    }
    // internal: chisq active
    else if (val && !GetChisqActive()) {
        cerr << "Warning! Dynamic upper bound pruning could not be enabled due to deactivated significance criterium." << endl;
    }
    // -------- !du ---------
    else if (val && !GetPruning()) {
        cerr << "Warning! Dynamic upper bound pruning could not be enabled due to deactivated statistical metric pruning." << endl;
    }
    else {
        fm::bbrc_adjust_ub=val; 
    }
    return 1;
}
bool SetMaxHops ( int  val)

Dummy method for max hops (only used in LAST-PM). Same as '-m'.

                             {
    return 0;
}
void SetMinfreq ( int  val)

Set minimum frequency (>=1 here). Same as '-f'.

References GetRefineSingles().

Referenced by Bbrc(), and SetRefineSingles().

                             {
    // parameters not regarded in integrity constraints
    if (val < 1) { cerr << "Error! Invalid value '" << val << "' for parameter minfreq." << endl; exit(1); }
    if (val > 1 && GetRefineSingles()) { cerr << "Warning! Minimum frequency of '" << val << "' could not be set due to activated single refinement." << endl;}
    fm::bbrc_minfreq = val;
}
bool SetPruning ( bool  val)

Pass 'false' here to disable statistical metrical pruning completely. Same as '-u'.

References fm::bbrc_do_pruning, GetBbrcSep(), GetChisqActive(), GetDynamicUpperBound(), SetBbrcSep(), and SetDynamicUpperBound().

Referenced by SetChisqActive(), and SetRegression().

                              {
    // internal: chisq active
    if (val && !GetChisqActive()) {
        cerr << "Warning! Statistical metric pruning could not be enabled due to deactivated significance criterium." << endl;
    }
    else {
        // ---------- !du -----------
        if (!val && GetDynamicUpperBound()) {
            cerr << "Notice: Disabling dynamic upper bound pruning due to disabled static upper bound pruning." << endl;
            SetDynamicUpperBound(false); 
        }
        // --------- ru -------
        if (!val && GetBbrcSep()) {
            cerr << "Notice: Disabling BBRC separator due to disabled static upper bound pruning." << endl;
            SetBbrcSep(false);
        }
        fm::bbrc_do_pruning=val;
    }
    return 1;
}
bool SetRefineSingles ( bool  val)

Pass 'true' here to enable refinement of fragments with frequency 1. Same as '-s'.

References GetMinfreq(), GetRefineSingles(), and SetMinfreq().

                                    {
    fm::bbrc_refine_singles = val;
    // parameters not regarded in integrity constraints
    if (GetRefineSingles() && GetMinfreq() > 1) {
        cerr << "Notice: Using minimum frequency of 1 to refine singles." << endl;
        SetMinfreq(1);
    }
    return 1;
}
bool SetRegression ( bool  val)

Set 'true' here to enable continuous activity values. Same as '-g'.

References fm::bbrc_regression, GetBackbone(), GetPruning(), SetBackbone(), and SetPruning().

Referenced by SetChisqActive().

                                 {
    fm::bbrc_regression = val;
    if (fm::bbrc_regression) {
         if (!GetBackbone()) {
            SetBackbone(true);
         }
         if (GetPruning()) {
            cerr << "Notice: Disabling statistical metric pruning due to activated regression." << endl;
            SetPruning(false);
         }
    }
    return 1;
}
bool SetType ( int  val)

Set type 1 (paths) or 2 (trees) here. Same as '-l'.

Referenced by Bbrc().

                          {
    // parameters not regarded in integrity constraints
    if ((val != 1) && (val != 2)) { cerr << "Error! Invalid value '" << val << "' for parameter type." << endl; exit(1); }
    fm::bbrc_type = val;
    return 1;
}

The documentation for this class was generated from the following files: