Commit 58c7c0a0 authored by mvalle's avatar mvalle
Browse files

Restricted Doxygen to *.h and *.cpp files

Now ignore empty lines at the beginning of the msa
Added routine to check the branches on the tree root.


git-svn-id: https://svn.vital-it.ch/svn/hp2c/trunk/Codeml_Variants/Fastcodeml@5673 95c5a404-1f88-0410-a6b0-c3f062b6f34a
parent 20c6890a
......@@ -679,7 +679,7 @@ INPUT_ENCODING = UTF-8
# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
# *.f90 *.f *.for *.vhd *.vhdl
FILE_PATTERNS =
FILE_PATTERNS = *.h *.cpp
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
......
......@@ -8,7 +8,7 @@
void Phylip::loadData(const char* aFilename, std::vector<std::string>& aSpecies, std::vector<std::string>& aSequences)
{
// Open the file and verify it has at least one line
// Open the file
std::ifstream in(aFilename);
if(!in)
{
......@@ -17,14 +17,19 @@ void Phylip::loadData(const char* aFilename, std::vector<std::string>& aSpecies,
throw FastCodeMLFatal(o);
}
// Skip empty lines and verify the file has at least one line
std::string str;
if(!getline(in, str) || str.empty())
do
{
in.close();
std::ostringstream o;
o << "File \"" << aFilename << "\" is empty";
throw FastCodeMLFatal(o);
if(!getline(in, str))
{
in.close();
std::ostringstream o;
o << "File \"" << aFilename << "\" is empty";
throw FastCodeMLFatal(o);
}
}
while(str.empty());
// From the first line extract number of species and nmber of basis
long unsigned int nspecies, nbasis;
......
......@@ -177,3 +177,16 @@ void PhyloTree::countNullBranchLengths(int& aOnLeafCnt, int& aOnIntCnt, const Tr
countNullBranchLengths(aOnLeafCnt, aOnIntCnt, m);
}
}
void PhyloTree::checkRootBranches(void) const
{
TreeNode *m;
unsigned int cnt = 0;
unsigned int cnt_leaves = 0;
for(; (m = mTreeRoot.getChild(cnt)) != NULL; ++cnt)
{
if(m->isLeaf()) ++cnt_leaves;
}
std::cout << std::endl << "Root has " << cnt << " children of which " << cnt_leaves << " are leaves" << std::endl;
}
......@@ -108,6 +108,10 @@ public:
///
void countNullBranchLengths(int& aOnLeafCnt, int& aOnIntCnt, const TreeNode* aTreeNode=NULL) const;
/// Verify if the root of the tree is well formed for the analysis.
/// Currently it prints the number of branches emanating from the tree root and how many of them are leaves.
///
void checkRootBranches(void) const;
protected:
......
......@@ -187,6 +187,9 @@ int main(int aRgc, char **aRgv)
// Check coherence between the two files
msa.checkNameCoherence(tree.getSpecies());
// Check root (TBD)
tree.checkRootBranches();
// If times from file then check for null branch lengths for any leaf
if(cmd.mBranchLengthsFromFile)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment