Commits

Chris Park committed 7b33b8b

merge annotation OBO updates, plus PR/RECALL columns to DChecker

  • Participants
  • Parent commits fe98a86

Comments (0)

Files changed (21)

 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
-	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+	      cd $(srcdir) && $(AUTOMAKE) --gnu  \
 		&& exit 0; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  Makefile
+	  $(AUTOMAKE) --gnu  Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \

File gen_tools_am

 			    BNTruster => ['SMILE'],
 			    BNUnraveler => ['SMILE'],
 			    BNWeaver => ['SMILE'],
+			    BNs2Txt => ['SMILE'],
+			    SpeciesConnector => ['SMILE'],
 #			    BNWrangler => ['SMILE'],
 			    Contexter  => ['SMILE'],
 			    Counter  => ['SMILE'],

File src/Makefile.am

 
 libSleipnir_a_SOURCES	=	\
 	annotation.cpp			\
-	annotationgo.cpp		\
+	annotationobo.cpp		\
 	annotationkegg.cpp		\
 	annotationmips.cpp		\
 	bayesnet.cpp			\

File src/Makefile.in

 ARFLAGS = cru
 libSleipnir_a_AR = $(AR) $(ARFLAGS)
 libSleipnir_a_LIBADD =
-am_libSleipnir_a_OBJECTS = annotation.$(OBJEXT) annotationgo.$(OBJEXT) \
-	annotationkegg.$(OBJEXT) annotationmips.$(OBJEXT) \
-	bayesnet.$(OBJEXT) bayesnetfn.$(OBJEXT) \
-	bayesnetmixed.$(OBJEXT) bayesnetpnl.$(OBJEXT) \
-	bayesnetsmile.$(OBJEXT) bayesnetsmileelr.$(OBJEXT) \
-	clusthierarchical.$(OBJEXT) clustkmeans.$(OBJEXT) \
-	clustpivot.$(OBJEXT) clustqtc.$(OBJEXT) coalesce.$(OBJEXT) \
-	coalescecluster.$(OBJEXT) coalescemotifs.$(OBJEXT) \
-	coalescestructs.$(OBJEXT) color.$(OBJEXT) \
-	compactmatrix.$(OBJEXT) database.$(OBJEXT) datapair.$(OBJEXT) \
-	datasetcompact.$(OBJEXT) dataset.$(OBJEXT) dat.$(OBJEXT) \
-	example.$(OBJEXT) fasta.$(OBJEXT) file.$(OBJEXT) \
+am_libSleipnir_a_OBJECTS = annotation.$(OBJEXT) \
+	annotationobo.$(OBJEXT) annotationkegg.$(OBJEXT) \
+	annotationmips.$(OBJEXT) bayesnet.$(OBJEXT) \
+	bayesnetfn.$(OBJEXT) bayesnetmixed.$(OBJEXT) \
+	bayesnetpnl.$(OBJEXT) bayesnetsmile.$(OBJEXT) \
+	bayesnetsmileelr.$(OBJEXT) clusthierarchical.$(OBJEXT) \
+	clustkmeans.$(OBJEXT) clustpivot.$(OBJEXT) clustqtc.$(OBJEXT) \
+	coalesce.$(OBJEXT) coalescecluster.$(OBJEXT) \
+	coalescemotifs.$(OBJEXT) coalescestructs.$(OBJEXT) \
+	color.$(OBJEXT) compactmatrix.$(OBJEXT) database.$(OBJEXT) \
+	datapair.$(OBJEXT) datasetcompact.$(OBJEXT) dataset.$(OBJEXT) \
+	dat.$(OBJEXT) example.$(OBJEXT) fasta.$(OBJEXT) file.$(OBJEXT) \
 	genome.$(OBJEXT) hmm.$(OBJEXT) mathb.$(OBJEXT) \
 	measure.$(OBJEXT) meta.$(OBJEXT) orthology.$(OBJEXT) \
 	pcl.$(OBJEXT) pclset.$(OBJEXT) pst.$(OBJEXT) \
 #LDADD = $(LOG4CPP_LIBS) $(SMILE_LIBS) $(SVM_PERF_LIBS) $(PTHREAD_LIBS)
 libSleipnir_a_SOURCES = \
 	annotation.cpp			\
-	annotationgo.cpp		\
+	annotationobo.cpp		\
 	annotationkegg.cpp		\
 	annotationmips.cpp		\
 	bayesnet.cpp			\
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/annotation.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/annotationgo.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/annotationkegg.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/annotationmips.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/annotationobo.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bayesnet.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bayesnetfn.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bayesnetmixed.Po@am__quote@

File src/annotation.cpp

 
 			while( issm.peek( ) != EOF ) {
 				str = OpenToken( issm );
+				cout << str << endl;
 				if( !str.length( ) )
 					break;
 				if( m_vecstrSlims.size( ) <= i )

File src/annotation.h

  * annotated to that term's ancestors.
  * 
  * \see
- * COntologyKEGG | COntologyGO | COntologyMIPS | COntologyMIPSPhenotypes | CSlim
+ * COntologyKEGG | COntologyOBO | COntologyMIPS | COntologyMIPSPhenotypes | CSlim
  */
 class IOntology {
 public:
 
 /*!
  * \brief
- * Implements IOntology for the Gene Ontology.
+ * Implements IOntology for OBO based Ontologies.
  * 
- * COntologyGO parses OBO and GO annotation files to obtain the structure and annotations to the Gene
- * Ontology.  Aspects of the ontology (e.g. biological process, molecular function, cellular compartment)
- * can be opened individually to obtain independent IOntology objects.
+ * COntologyOBO parses OBO and annotation files to obtain the structure and annotations
+ * for OBO ontologies.
  */
-class COntologyGO : COntologyGOImpl, public IOntology {
+class COntologyOBO : COntologyOBOImpl, public IOntology {
 public:
 	/*!
 	 * \brief
 	static const char	c_szMolecularFunction[];
 
 	static bool Open( std::istream& istmOntology, std::istream& istmAnnotations, CGenome& Genome,
-		COntologyGO& OntoBP, COntologyGO& OntoMF, COntologyGO& OntoCC, bool fDatabaseIDs = false,
+			COntologyOBO& OntoBP, COntologyOBO& OntoMF, COntologyOBO& OntoCC, bool fDatabaseIDs = false,
 		bool fSynonyms = false );
 
-	COntologyGO( );
+	COntologyOBO( );
 	bool Open( std::istream& istmOntology, std::istream& istmAnnotations, CGenome& Genome,
 		const char* szNamespace, bool fDatabaseIDs = false, bool fSynonyms = false );
 

File src/annotationi.h

 	bool OpenGloss( SParserKEGG& );
 };
 
-class COntologyGOImpl : protected COntologyImpl {
+class COntologyOBOImpl : protected COntologyImpl {
 protected:
 	static const char	c_szAltID[];
-	static const char	c_szGO[];
-	static const char	c_szGOC[];
+	static const char	c_szOBO[];
 	static const char	c_szHUMAN[];
 	static const char	c_szID[];
 	static const char	c_szIsA[];
 	static const char	c_szRelationship[];
 	static const char	c_szSGD[];
 	static const char	c_szTerm[];
-
-	struct SParserGO : SParser {
+	
+	struct SParserOBO : SParser {
 		typedef std::set<const CGene*>	TSetPGene;
 
-		SParserGO( std::istream&, CGenome&, bool = false, bool = false );
+		SParserOBO( std::istream&, CGenome&, bool = false, bool = false );
 
 		void Reset( );
 
 		std::vector<TSetPGene>		m_vecsetpGenes;
 	};
 
-	COntologyGOImpl( );
-
-	bool OpenOntology( SParserGO& );
-	bool OpenHeader( SParserGO& );
-	bool OpenBlock( SParserGO& );
-	bool OpenTerm( SParserGO& );
-	bool OpenID( SParserGO& );
-	bool OpenName( SParserGO& );
-	bool OpenNamespace( SParserGO& );
-	bool OpenRelationship( SParserGO& );
-	bool OpenParent( SParserGO& );
-	bool OpenAltID( SParserGO& );
-	bool OpenObsolete( SParserGO& );
-	bool OpenGenes( SParserGO& );
-	bool OpenGene( SParserGO& );
+	COntologyOBOImpl( );
+	
+	bool OpenOntology( SParserOBO& );
+	bool OpenHeader( SParserOBO& );
+	bool OpenBlock( SParserOBO& );
+	bool OpenTerm( SParserOBO& );
+	bool OpenID( SParserOBO& );
+	bool OpenName( SParserOBO& );
+	bool OpenNamespace( SParserOBO& );
+	bool OpenRelationship( SParserOBO& );
+	bool OpenParent( SParserOBO& );
+	bool OpenAltID( SParserOBO& );
+	bool OpenObsolete( SParserOBO& );
+	bool OpenGenes( SParserOBO& );
+	bool OpenGene( SParserOBO& );
 };
 
 class COntologyMIPSImpl : protected COntologyImpl {

File src/annotationobo.cpp

+/*****************************************************************************
+* This file is provided under the Creative Commons Attribution 3.0 license.
+*
+* You are free to share, copy, distribute, transmit, or adapt this work
+* PROVIDED THAT you attribute the work to the authors listed below.
+* For more information, please see the following web page:
+* http://creativecommons.org/licenses/by/3.0/
+*
+* This file is a component of the Sleipnir library for functional genomics,
+* authored by:
+* Curtis Huttenhower (chuttenh@princeton.edu)
+* Mark Schroeder
+* Maria D. Chikina
+* Olga G. Troyanskaya (ogt@princeton.edu, primary contact)
+*
+* If you use this library, the included executable tools, or any related
+* code in your work, please cite the following publication:
+* Curtis Huttenhower, Mark Schroeder, Maria D. Chikina, and
+* Olga G. Troyanskaya.
+* "The Sleipnir library for computational functional genomics"
+*****************************************************************************/
+#include "stdafx.h"
+#include "annotation.h"
+#include "genome.h"
+#include "meta.h"
+
+namespace Sleipnir {
+
+const char	COntologyOBO::c_szBiologicalProcess[]	= "biological_process";
+const char	COntologyOBO::c_szCellularComponent[]	= "cellular_component";
+const char	COntologyOBO::c_szMolecularFunction[]	= "molecular_function";
+
+const char	COntologyOBOImpl::c_szAltID[]		= "alt_id: ";
+const char	COntologyOBOImpl::c_szID[]			= "id: ";
+const char	COntologyOBOImpl::c_szIsA[]			= "is_a: ";
+const char	COntologyOBOImpl::c_szIsObsolete[]	= "is_obsolete: ";
+const char	COntologyOBOImpl::c_szOBO[]			= "OBO";
+const char	COntologyOBOImpl::c_szHUMAN[]		= "_HUMAN";
+const char	COntologyOBOImpl::c_szName[]			= "name: ";
+const char	COntologyOBOImpl::c_szNamespace[]	= "namespace: ";
+const char	COntologyOBOImpl::c_szNOT[]			= "NOT";
+const char	COntologyOBOImpl::c_szPartOf[]		= "part_of ";
+const char	COntologyOBOImpl::c_szRelationship[]	= "relationship: ";
+const char	COntologyOBOImpl::c_szSGD[]			= "SGD";
+const char	COntologyOBOImpl::c_szTerm[]			= "[Term]";
+
+COntologyOBO::COntologyOBO( ) {
+
+	m_pOntology = this; }
+
+COntologyOBOImpl::SParserOBO::SParserOBO( std::istream& istm, CGenome& Genome, bool fDBIDs, bool fSynonyms ) :
+	m_fObsolete(false), m_szTarget(NULL), m_fDBIDs(fDBIDs), m_fSynonyms(fSynonyms), SParser( istm, Genome ) { }
+
+void COntologyOBOImpl::SParserOBO::Reset( ) {
+
+	m_fObsolete = false;
+	m_vecstrIDs.clear( ); }
+
+COntologyOBOImpl::COntologyOBOImpl( ) : COntologyImpl( c_szOBO ) { }
+
+/*!
+ * \brief
+ * Initializes three aspects of the Gene Ontology using OBO structure and GO annotation files.
+ * 
+ * \param istmOntology
+ * Stream from which OBO structure file is read.
+ * 
+ * \param istmAnnotations
+ * Stream from which gene annotation file is read.
+ * 
+ * \param Genome
+ * Genome into which genes are inserted or read during annotation parsing.
+ * 
+ * \param OntoBP
+ * Ontology initialized with GO's biological process aspect.
+ * 
+ * \param OntoMF
+ * Ontology initialized with GO's molecular function aspect.
+ * 
+ * \param OntoCC
+ * Ontology initialized with GO's cellular compartment aspect.
+ * 
+ * \param fDatabaseIDs
+ * If true, use annotation database IDs as primary gene names.
+ * 
+ * \param fSynonyms
+ * If true, use first gene synonym (if present) as primary gene names.
+ * 
+ * \returns
+ * True if the ontologies were successfully initialized.
+ * 
+ * Equivalent to calling COntologyOBO::Open three times for the three GO aspects.
+ */
+bool COntologyOBO::Open( std::istream& istmOntology, std::istream& istmAnnotations, CGenome& Genome,
+	COntologyOBO& OntoBP, COntologyOBO& OntoMF, COntologyOBO& OntoCC, bool fDatabaseIDs, bool fSynonyms ) {
+
+	if( !OntoBP.Open( istmOntology, istmAnnotations, Genome, c_szBiologicalProcess, fDatabaseIDs, fSynonyms ) )
+		return false;
+
+	istmOntology.clear( );
+	istmOntology.seekg( 0, ios_base::beg );
+	istmAnnotations.clear( );
+	istmAnnotations.seekg( 0, ios_base::beg );
+	if( !OntoCC.Open( istmOntology, istmAnnotations, Genome, c_szCellularComponent, fDatabaseIDs, fSynonyms ) )
+		return false;
+
+	istmOntology.clear( );
+	istmOntology.seekg( 0, ios_base::beg );
+	istmAnnotations.clear( );
+	istmAnnotations.seekg( 0, ios_base::beg );
+	return OntoMF.Open( istmOntology, istmAnnotations, Genome, c_szMolecularFunction, fDatabaseIDs, fSynonyms ); }
+
+/*!
+ * \brief
+ * Initializes the ontology from one aspect of the Gene Ontology using OBO structure and GO annotation files.
+ * 
+ * \param istmOntology
+ * Stream from which OBO structure file is read.
+ * 
+ * \param istmAnnotations
+ * Stream from which gene annotation file is read.
+ * 
+ * \param Genome
+ * Genome into which genes are inserted or read during annotation parsing.
+ * 
+ * \param szNamespace
+ * Aspect (namespace) of GO to use for this ontology.
+ * 
+ * \param fDatabaseIDs
+ * If true, use annotation database IDs as primary gene names.
+ * 
+ * \param fSynonyms
+ * If true, use first gene synonym (if present) as primary gene names.
+ * 
+ * \returns
+ * True if the ontology was successfully initialized.
+ * 
+ * COntologyOBO::Open parses the structure of one aspect of the Gene Ontology from the given
+ * (organism-independent) OBO file and obtains gene annotations from the given (organism-specific) annotation
+ * file.  Terms are identified by GO IDs (e.g. "GO:0007093"), and genes are identified by the annotation name,
+ * first synonym, or database ID as specified by the fSynonyms and fDatabaseIDs parameters.  Genes are
+ * retrieved from Genome if already present or inserted if not; it is thus important to ensure that the proper
+ * primary gene names are used so as to agree with any identifiers already present in Genome.
+ * 
+ * \remarks
+ * For yeast, fSynonyms and fDatabaseIDs should both be false to use ORF IDs as primary gene names (false will
+ * use common names).  For human, it is recommended to pre-map annotation IDs to HGNC symbols, as the default
+ * IPI and Uniprot peptide IDs can be extremely ambiguous.  For mouse, fDatabaseIDs should be true to use MGI
+ * IDs as primary gene names.  For worm, fDatabaseIDs should be true to use Wormbase gene IDs as primary gene
+ * names, or fSynonyms should be true to use systematic transcript IDs (both false will use common names).
+ * For fly, fDatabaseIDs should be true to use Flybase gene IDs as primary gene names.
+ * 
+ * \see
+ * COntologyOBO::Open
+ */
+bool COntologyOBO::Open( std::istream& istmOntology, std::istream& istmAnnotations, CGenome& Genome,
+	const char* szNamespace, bool fDatabaseIDs, bool fSynonyms ) {
+	SParserOBO	sParserOnto( istmOntology, Genome );
+	SParserOBO	sParserGene( istmAnnotations, Genome, fDatabaseIDs, fSynonyms );
+
+	m_strID += szNamespace;
+	sParserOnto.m_szTarget = szNamespace;
+	return ( OpenOntology( sParserOnto ) && OpenGenes( sParserGene ) ); }
+
+bool COntologyOBOImpl::OpenOntology( SParserOBO& sParser ) {
+	size_t					i, j, iParent;
+	vector<vector<size_t> >	vecveciChildren;
+
+	g_CatSleipnir( ).info( "COntologyOBOImpl::OpenOntology( ) %s", sParser.m_szTarget );
+	Reset( );
+	sParser.m_vecvecstrParents.clear( );
+	sParser.m_vecNodes.clear( );
+	if( !( sParser.GetLine( ) && OpenHeader( sParser ) ) )
+		return false;
+
+	while( sParser.m_istm.peek( ) != EOF )
+		if( !OpenBlock( sParser ) )
+			return false;
+
+	m_aNodes = new SNode[ m_iNodes = sParser.m_vecNodes.size( ) ];
+	vecveciChildren.resize( m_iNodes );
+	for( i = 0; i < m_iNodes; ++i ) {
+		m_aNodes[ i ] = sParser.m_vecNodes[ i ];
+		if( m_aNodes[ i ].m_iParents = sParser.m_vecvecstrParents[ i ].size( ) ) {
+			m_aNodes[ i ].m_aiParents = new size_t[ m_aNodes[ i ].m_iParents ];
+			for( j = 0; j < m_aNodes[ i ].m_iParents; ++j ) {
+				if( ( iParent = m_mapNodes[ sParser.m_vecvecstrParents[ i ][ j ] ] ) == i ) {
+					g_CatSleipnir( ).error( "COntologyOBOImpl::OpenOntology( ) found a loop for node %d: %s has parent %s",
+						i, m_aNodes[ i ].m_strID.c_str( ), sParser.m_vecvecstrParents[ i ][ j ].c_str( ) );
+					return false; }
+				m_aNodes[ i ].m_aiParents[ j ] = iParent;
+				vecveciChildren[ m_aNodes[ i ].m_aiParents[ j ] ].push_back( i ); } } }
+	for( i = 0; i < m_iNodes; ++i ) {
+		if( !vecveciChildren[ i ].size( ) )
+			continue;
+		m_aNodes[ i ].m_aiChildren = new size_t[ m_aNodes[ i ].m_iChildren =
+			vecveciChildren[ i ].size( ) ];
+		for( j = 0; j < m_aNodes[ i ].m_iChildren; ++j )
+			m_aNodes[ i ].m_aiChildren[ j ] = vecveciChildren[ i ][ j ]; }
+
+	return true; }
+
+bool COntologyOBOImpl::OpenHeader( SParserOBO& sParser ) {
+
+	while( sParser.m_szLine[ 0 ] )
+		if( !sParser.GetLine( ) )
+			return false;
+
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenBlock( SParserOBO& sParser ) {
+
+	if( sParser.IsStart( c_szTerm ) )
+		return ( sParser.GetLine( ) && OpenTerm( sParser ) );
+
+	while( sParser.m_szLine[ 0 ] )
+		if( !sParser.GetLine( ) )
+			return false;
+
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenTerm( SParserOBO& sParser ) {
+	bool	fRet, fHit;
+	SNode	sNode;
+	size_t	i;
+
+	sParser.Reset( );
+	while( sParser.m_vecvecstrParents.size( ) < ( sParser.m_vecNodes.size( ) + 1 ) )
+		sParser.m_vecvecstrParents.push_back( vector<string>( ) );
+	sParser.m_vecvecstrParents[ sParser.m_vecNodes.size( ) ].clear( );
+	while( sParser.m_szLine[ 0 ] ) {
+		fRet = fHit = false;
+		switch( sParser.m_szLine[ 0 ] ) {
+			case 'a':
+				if( sParser.IsStart( c_szAltID ) ) {
+					fHit = true;
+					if( !( fRet = OpenAltID( sParser ) ) )
+						g_CatSleipnir( ).error( "COntologyOBOImpl::OpenTerm( ) failed: %s", c_szAltID ); }
+				break;
+
+			case 'i':
+				if( sParser.IsStart( c_szID ) ) {
+					fHit = true;
+					if( !( fRet = OpenID( sParser ) ) )
+						g_CatSleipnir( ).error( "COntologyOBOImpl::OpenTerm( ) failed: %s", c_szID ); }
+				else if( sParser.IsStart( c_szIsA ) ) {
+					fHit = true;
+					if( !( fRet = OpenParent( sParser ) ) )
+						g_CatSleipnir( ).error( "COntologyOBOImpl::OpenTerm( ) failed: %s", c_szIsA ); }
+				else if( sParser.IsStart( c_szIsObsolete ) ) {
+					fHit = true;
+					if( !( fRet = OpenObsolete( sParser ) ) )
+						g_CatSleipnir( ).error( "COntologyOBOImpl::OpenTerm( ) failed: %s",
+							c_szIsObsolete ); }
+				break;
+
+			case 'n':
+				if( sParser.IsStart( c_szName ) ) {
+					fHit = true;
+					if( !( fRet = OpenName( sParser ) ) )
+						g_CatSleipnir( ).error( "COntologyOBOImpl::OpenTerm( ) failed: %s", c_szName ); }
+				else if( sParser.IsStart( c_szNamespace ) ) {
+					fHit = true;
+					if( !( fRet = OpenNamespace( sParser ) ) )
+						g_CatSleipnir( ).error( "COntologyOBOImpl::OpenTerm( ) failed: %s",
+							c_szNamespace ); }
+				break;
+
+			case 'r':
+				if( sParser.IsStart( c_szRelationship ) ) {
+					fHit = true;
+					if( !( fRet = OpenRelationship( sParser ) ) )
+						g_CatSleipnir( ).error( "COntologyOBOImpl::OpenTerm( ) failed: %s",
+							c_szRelationship ); }
+				break; }
+		if( !fHit ) {
+			g_CatSleipnir( ).info( "COntologyOBOImpl::OpenTerm( ) skipping: %s", sParser.m_szLine );
+			fRet = sParser.GetLine( ); }
+		if( !fRet ) {
+			g_CatSleipnir( ).error( "COntologyOBOImpl::OpenTerm( ) failed: %s", sParser.m_szLine );
+			return false; } }
+
+	if( !sParser.m_fObsolete && ( sParser.m_strNamespace == sParser.m_szTarget ) ) {
+		sNode.m_strGloss = sParser.m_strGloss;
+		sNode.m_strID = sParser.m_vecstrIDs[ 0 ];
+		m_mapNodes[ sNode.m_strID ] = sParser.m_vecNodes.size( );
+		for( i = 1; i < sParser.m_vecstrIDs.size( ); ++i )
+			m_mapNodes[ sParser.m_vecstrIDs[ i ] ] = sParser.m_vecNodes.size( );
+		sParser.m_vecNodes.push_back( sNode ); }
+
+	return true; }
+
+bool COntologyOBOImpl::OpenID( SParserOBO& sParser ) {
+
+	sParser.m_vecstrIDs.push_back( sParser.m_szLine + strlen( c_szID ) );
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenAltID( SParserOBO& sParser ) {
+
+	sParser.m_vecstrIDs.push_back( sParser.m_szLine + strlen( c_szAltID ) );
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenName( SParserOBO& sParser ) {
+
+	sParser.m_strGloss = sParser.m_szLine + strlen( c_szName );
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenParent( SParserOBO& sParser ) {
+	const char*	szStart;
+	const char*	szEnd;
+
+	szStart = sParser.m_szLine + strlen( c_szIsA );
+	for( szEnd = szStart; *szEnd && !isspace( *szEnd ); ++szEnd );
+	sParser.m_vecvecstrParents[ sParser.m_vecNodes.size( ) ].push_back( string( szStart, szEnd ) );
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenRelationship( SParserOBO& sParser ) {
+	const char*	szStart;
+	const char*	szEnd;
+
+	if( strncmp( sParser.m_szLine + strlen( c_szRelationship ), c_szPartOf,
+		strlen( c_szPartOf ) ) ) {
+		g_CatSleipnir( ).info( "COntologyOBOImpl::OpenRelationship( %s ) unknown relationship",
+			sParser.m_szLine );
+		return sParser.GetLine( ); }
+
+	szStart = sParser.m_szLine + strlen( c_szRelationship ) + strlen( c_szPartOf );
+	for( szEnd = szStart; *szEnd && !isspace( *szEnd ); ++szEnd );
+	sParser.m_vecvecstrParents[ sParser.m_vecNodes.size( ) ].push_back( string( szStart, szEnd ) );
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenNamespace( SParserOBO& sParser ) {
+
+	sParser.m_strNamespace = sParser.m_szLine + strlen( c_szNamespace );
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenObsolete( SParserOBO& sParser ) {
+
+	sParser.m_fObsolete = true;
+	return sParser.GetLine( ); }
+
+bool COntologyOBOImpl::OpenGenes( SParserOBO& sParser ) {
+	size_t									i, j;
+	SParserOBO::TSetPGene::const_iterator	iterGene;
+
+	g_CatSleipnir( ).info( "COntologyOBOImpl::OpenGenes( )" );
+	if( !sParser.GetLine( ) )
+		return false;
+	if( !sParser.m_szLine[ 0 ] )
+		return true;
+
+	sParser.m_vecsetpGenes.resize( m_iNodes );
+	while( sParser.m_istm.peek( ) != EOF )
+		if( !OpenGene( sParser ) )
+			return false;
+	if( !OpenGene( sParser ) )
+		return false;
+
+	for( i = 0; i < m_iNodes; ++i ) {
+		if( sParser.m_vecsetpGenes[ i ].empty( ) )
+			continue;
+		m_aNodes[ i ].m_apGenes = new const CGene*[ m_aNodes[ i ].m_iGenes =
+			sParser.m_vecsetpGenes[ i ].size( ) ];
+		for( j = 0,iterGene = sParser.m_vecsetpGenes[ i ].begin( );
+			iterGene != sParser.m_vecsetpGenes[ i ].end( ); ++j,++iterGene )
+			m_aNodes[ i ].m_apGenes[ j ] = *iterGene; }
+
+	return true; }
+
+bool COntologyOBOImpl::OpenGene( SParserOBO& sParser ) {
+	size_t						i;
+	string						strID, strName;
+	vector<string>				vecstrLine, vecstrNames;
+	TMapStrI::const_iterator	iterNode;
+
+	if( sParser.m_szLine[ 0 ] == '!' )
+		return sParser.GetLine( );
+
+//	1	DB ID
+//	2	Name
+//	3	NOT
+//	4	GO ID
+//	6	Annotation source
+//	9	Gloss
+//	10	Syns
+	CMeta::Tokenize( sParser.m_szLine, vecstrLine );
+	if( ( vecstrLine.size( ) < 11 ) || !( strID = vecstrLine[ 4 ] ).length( ) )
+		return false;
+	if( vecstrLine[ 3 ].length( ) || ( ( iterNode = m_mapNodes.find( strID ) ) ==
+		m_mapNodes.end( ) ) )
+		return sParser.GetLine( );
+	CMeta::Tokenize( vecstrLine[ 10 ].c_str( ), vecstrNames, "|" );
+
+	while( !vecstrNames.empty( ) && vecstrNames[ 0 ].empty( ) )
+		vecstrNames.erase( vecstrNames.begin( ) );
+	strName = ( sParser.m_fSynonyms || vecstrNames.empty( ) ) ? vecstrLine[ 2 ] : vecstrNames[ 0 ];	
+	strName = ( sParser.m_fDBIDs ? vecstrLine[ 1 ] : strName );
+
+	if( strName.empty( ) ) {
+		g_CatSleipnir( ).error( "COntologyOBOImpl::OpenGene( ) null name: %s",
+			sParser.m_szLine );
+		return false; }
+	{
+		CGene&	Gene	= sParser.m_Genome.AddGene( strName );
+
+		if( sParser.m_fSynonyms )
+			sParser.m_Genome.AddSynonym( Gene, vecstrLine[ 2 ] );
+		//if( sParser.m_fDBIDs )
+		//	sParser.m_Genome.AddSynonym( Gene, vecstrLine[ 1 ] );
+		if( vecstrLine[ 2 ].length( ) ) {
+			strID = ( ( i = vecstrLine[ 2 ].find( c_szHUMAN ) ) == string::npos ) ? vecstrLine[ 2 ] :
+				vecstrLine[ 2 ].substr( 0, i );				
+			sParser.m_Genome.AddSynonym( Gene, strID ); }
+		for( i = 1; i < vecstrNames.size( ); ++i )
+			sParser.m_Genome.AddSynonym( Gene, vecstrNames[ i ] );
+		Gene.AddAnnotation( m_pOntology, iterNode->second );
+		if( Gene.GetGloss( ).length( ) == 0 )
+			Gene.SetGloss( vecstrLine[ 9 ] );
+		sParser.m_vecsetpGenes[ iterNode->second ].insert( &Gene );
+	}
+
+	return sParser.GetLine( ); }
+
+}

File tools/BNFunc/BNFunc.cpp

 	CGenome								Genome;
 	gengetopt_args_info					sArgs;
 	ifstream							ifsmAnno, ifsmOnto, ifsmTerm;
-	COntologyGO							GO;
+	COntologyOBO OBO;
 	COntologyKEGG						KEGG;
 	COntologyMIPS						MIPS;
 	const IOntology*					pOnto;
 		cmdline_parser_print_help( );
 		return 1; }
 	CMeta Meta( sArgs.verbosity_arg, sArgs.random_arg );
+		
+	if( sArgs.onto_arg ) {
+		ifsmOnto.open( sArgs.onto_arg );
+		if( !strcmp( sArgs.namespace_arg, c_szBP ) )
+			szNamespace = COntologyOBO::c_szBiologicalProcess;
+		else if( !strcmp( sArgs.namespace_arg, c_szCC ) )
+			szNamespace = COntologyOBO::c_szCellularComponent;
+		else if( !strcmp( sArgs.namespace_arg, c_szMF ) )
+			szNamespace = COntologyOBO::c_szMolecularFunction;
+		else
+			szNamespace = sArgs.namespace_arg;
 
-	if( sArgs.go_onto_arg ) {
-		ifsmOnto.open( sArgs.go_onto_arg );
-		if( sArgs.go_anno_arg )
-			ifsmAnno.open( sArgs.go_anno_arg );
-		if( !strcmp( sArgs.go_name_arg, c_szBP ) )
-			szNamespace = COntologyGO::c_szBiologicalProcess;
-		else if( !strcmp( sArgs.go_name_arg, c_szCC ) )
-			szNamespace = COntologyGO::c_szCellularComponent;
-		else if( !strcmp( sArgs.go_name_arg, c_szMF ) )
-			szNamespace = COntologyGO::c_szMolecularFunction;
-		else
-			szNamespace = sArgs.go_name_arg;
-		if( !GO.Open( ifsmOnto, ifsmAnno, Genome, szNamespace, !!sArgs.dbids_flag ) ) {
-			cerr << "Couldn't open: ";
-			if( sArgs.go_anno_arg )
-				cerr << sArgs.go_anno_arg << ", ";
-			cerr << sArgs.go_onto_arg << endl;
-			return 1; }
+		if( sArgs.obo_anno_arg ) {
+			ifsmAnno.open( sArgs.obo_anno_arg );
+
+			if( !OBO.Open( ifsmOnto, ifsmAnno, Genome, szNamespace, !!sArgs.dbids_flag ) ) {
+				cerr << "Couldn't open: ";
+				if( sArgs.obo_anno_arg )
+					cerr << sArgs.obo_anno_arg << ", ";
+				cerr << sArgs.onto_arg << endl;
+				return 1;
+			}
+
+			ifsmAnno.close( );
+			pOnto = &OBO;
+		}
 		ifsmOnto.close( );
-		if( sArgs.go_anno_arg )
-			ifsmAnno.close( );
-		pOnto = &GO; }
+	}
+
 	else if( sArgs.mips_onto_arg ) {
 		ifsmOnto.open( sArgs.mips_onto_arg );
 		if( sArgs.mips_anno_arg )
 			if( ( (float)rand( ) / RAND_MAX ) < sArgs.test_arg )
 				iterGene->second = true; }
 
+	if( sArgs.annotations_arg ) {
+		ofsm.clear( );
+		ofsm.open( sArgs.annotations_arg );
+		for( i = 0; i < Slim.GetSlims( ); ++i ) {
+		
+			for( j = 0; j < Slim.GetGenes( i ); ++j ) {
+				const CGene& Gene = Slim.GetGene( i, j );
+				const string& strName =
+						(sArgs.synonyms_flag && Gene.GetSynonyms( )) ? Gene.GetSynonym( 0 )
+								: Gene.GetName( );
+
+				ofsm << Slim.GetSlim( i ) << "\t" << strName;
+				ofsm << endl;
+			}
+		}
+		ofsm.close( );
+	}
+
 	if( sArgs.directory_arg )
 		for( i = 0; i < Slim.GetSlims( ); ++i ) {
 			ofsm.clear( );

File tools/BNFunc/BNFunc.ggo

 						string	typestr="filename"
 
 section "Function Catalogs"
-option	"go_onto"	y	"GO ontology"
+option	"onto"		y	"ontology (obo file)"
 						string	typestr="filename"
-option	"go_anno"	g	"GO annotations"
+option	"obo_anno"	g	"Gene annotations that correspond to the OBO ontology for the organism of interest."
 						string	typestr="filename"
-option	"go_name"	n	"GO namespace"
-						string	typestr="namespace" default="bp"
+option	"namespace"	n	"Namespace (the gene ontology namespaces can be abbreviated bp, mf, and cc)"
+						string	typestr="namespace" default=""
 option	"kegg"		k	"KEGG ontology"
 						string	typestr="filename"
 option	"kegg_org"	K	"KEGG organism"
 						int	default="0"
 option	"verbosity"	v	"Message verbosity"
 						int	default="5"
+option	"annotations"	f	"File for propogated annotations"
+						string	typestr="filename"

File tools/BNFunc/cmdline.c

 /*
   File autogenerated by gengetopt version 2.22
   generated with the following command:
-  /home/chuttenh/hg/sleipnir/trunk/../extlib/gengetopt-2.22/bin/gengetopt -iBNFunc.ggo --default-optional -C -N -e 
+  /home/cypark/g/src/sleipnir/trunk/../extlib/gengetopt-2.22/bin/gengetopt -iBNFunc.ggo --default-optional -C -N -e 
 
   The developers of gengetopt consider the fixed text that goes in all
   gengetopt output files to be in the public domain:
 const char *gengetopt_args_info_description = "";
 
 const char *gengetopt_args_info_help[] = {
-  "  -h, --help                 Print help and exit",
-  "  -V, --version              Print version and exit",
+  "  -h, --help                  Print help and exit",
+  "  -V, --version               Print version and exit",
   "\nMain:",
-  "  -i, --input=filename       Ontology slim file",
+  "  -i, --input=filename        Ontology slim file",
   "\nMiscellaneous:",
-  "  -d, --directory=directory  Output directory  (default=`.')",
-  "  -o, --output=filename      Answer file",
-  "  -I, --negatives=filename   Negative slim file",
+  "  -d, --directory=directory   Output directory  (default=`.')",
+  "  -o, --output=filename       Answer file",
+  "  -I, --negatives=filename    Negative slim file",
   "\nFunction Catalogs:",
-  "  -y, --go_onto=filename     GO ontology",
-  "  -g, --go_anno=filename     GO annotations",
-  "  -n, --go_name=namespace    GO namespace  (default=`bp')",
-  "  -k, --kegg=filename        KEGG ontology",
-  "  -K, --kegg_org=STRING      KEGG organism  (default=`SCE')",
-  "  -m, --mips_onto=filename   MIPS ontology",
-  "  -a, --mips_anno=filename   MIPS annotations",
+  "  -y, --onto=filename         ontology (obo file)",
+  "  -g, --obo_anno=filename     Gene annotations that correspond to the OBO \n                                ontology for the organism of interest.",
+  "  -n, --namespace=namespace   Namespace (the gene ontology namespaces can be \n                                abbreviated bp, mf, and cc)  (default=`')",
+  "  -k, --kegg=filename         KEGG ontology",
+  "  -K, --kegg_org=STRING       KEGG organism  (default=`SCE')",
+  "  -m, --mips_onto=filename    MIPS ontology",
+  "  -a, --mips_anno=filename    MIPS annotations",
   "\nGene Names:",
-  "  -s, --synonyms             Prefer synonym names  (default=off)",
-  "  -b, --dbids                Include GO database IDs  (default=off)",
-  "  -l, --allids               Output all available IDs  (default=off)",
+  "  -s, --synonyms              Prefer synonym names  (default=off)",
+  "  -b, --dbids                 Include GO database IDs  (default=off)",
+  "  -l, --allids                Output all available IDs  (default=off)",
   "\nOptional:",
-  "  -t, --test=DOUBLE          Test fraction  (default=`0')",
-  "  -q, --sql=filename         File in which to save SQL tables",
-  "  -N, --nsets                Generate negative sets for input slim  \n                               (default=off)",
-  "  -L, --nsetlap=DOUBLE       P-value of overlap for negative rejection  \n                               (default=`0.05')",
-  "  -c, --config=filename      Command line config file  (default=`BNFunc.ini')",
-  "  -r, --random=INT           Seed random generator  (default=`0')",
-  "  -v, --verbosity=INT        Message verbosity  (default=`5')",
+  "  -t, --test=DOUBLE           Test fraction  (default=`0')",
+  "  -q, --sql=filename          File in which to save SQL tables",
+  "  -N, --nsets                 Generate negative sets for input slim  \n                                (default=off)",
+  "  -L, --nsetlap=DOUBLE        P-value of overlap for negative rejection  \n                                (default=`0.05')",
+  "  -c, --config=filename       Command line config file  (default=`BNFunc.ini')",
+  "  -r, --random=INT            Seed random generator  (default=`0')",
+  "  -v, --verbosity=INT         Message verbosity  (default=`5')",
+  "  -f, --annotations=filename  File for propogated annotations",
     0
 };
 
   args_info->directory_given = 0 ;
   args_info->output_given = 0 ;
   args_info->negatives_given = 0 ;
-  args_info->go_onto_given = 0 ;
-  args_info->go_anno_given = 0 ;
-  args_info->go_name_given = 0 ;
+  args_info->onto_given = 0 ;
+  args_info->obo_anno_given = 0 ;
+  args_info->namespace_given = 0 ;
   args_info->kegg_given = 0 ;
   args_info->kegg_org_given = 0 ;
   args_info->mips_onto_given = 0 ;
   args_info->config_given = 0 ;
   args_info->random_given = 0 ;
   args_info->verbosity_given = 0 ;
+  args_info->annotations_given = 0 ;
 }
 
 static
   args_info->output_orig = NULL;
   args_info->negatives_arg = NULL;
   args_info->negatives_orig = NULL;
-  args_info->go_onto_arg = NULL;
-  args_info->go_onto_orig = NULL;
-  args_info->go_anno_arg = NULL;
-  args_info->go_anno_orig = NULL;
-  args_info->go_name_arg = gengetopt_strdup ("bp");
-  args_info->go_name_orig = NULL;
+  args_info->onto_arg = NULL;
+  args_info->onto_orig = NULL;
+  args_info->obo_anno_arg = NULL;
+  args_info->obo_anno_orig = NULL;
+  args_info->namespace_arg = gengetopt_strdup ("");
+  args_info->namespace_orig = NULL;
   args_info->kegg_arg = NULL;
   args_info->kegg_orig = NULL;
   args_info->kegg_org_arg = gengetopt_strdup ("SCE");
   args_info->random_orig = NULL;
   args_info->verbosity_arg = 5;
   args_info->verbosity_orig = NULL;
+  args_info->annotations_arg = NULL;
+  args_info->annotations_orig = NULL;
   
 }
 
   args_info->directory_help = gengetopt_args_info_help[5] ;
   args_info->output_help = gengetopt_args_info_help[6] ;
   args_info->negatives_help = gengetopt_args_info_help[7] ;
-  args_info->go_onto_help = gengetopt_args_info_help[9] ;
-  args_info->go_anno_help = gengetopt_args_info_help[10] ;
-  args_info->go_name_help = gengetopt_args_info_help[11] ;
+  args_info->onto_help = gengetopt_args_info_help[9] ;
+  args_info->obo_anno_help = gengetopt_args_info_help[10] ;
+  args_info->namespace_help = gengetopt_args_info_help[11] ;
   args_info->kegg_help = gengetopt_args_info_help[12] ;
   args_info->kegg_org_help = gengetopt_args_info_help[13] ;
   args_info->mips_onto_help = gengetopt_args_info_help[14] ;
   args_info->config_help = gengetopt_args_info_help[25] ;
   args_info->random_help = gengetopt_args_info_help[26] ;
   args_info->verbosity_help = gengetopt_args_info_help[27] ;
+  args_info->annotations_help = gengetopt_args_info_help[28] ;
   
 }
 
   free_string_field (&(args_info->output_orig));
   free_string_field (&(args_info->negatives_arg));
   free_string_field (&(args_info->negatives_orig));
-  free_string_field (&(args_info->go_onto_arg));
-  free_string_field (&(args_info->go_onto_orig));
-  free_string_field (&(args_info->go_anno_arg));
-  free_string_field (&(args_info->go_anno_orig));
-  free_string_field (&(args_info->go_name_arg));
-  free_string_field (&(args_info->go_name_orig));
+  free_string_field (&(args_info->onto_arg));
+  free_string_field (&(args_info->onto_orig));
+  free_string_field (&(args_info->obo_anno_arg));
+  free_string_field (&(args_info->obo_anno_orig));
+  free_string_field (&(args_info->namespace_arg));
+  free_string_field (&(args_info->namespace_orig));
   free_string_field (&(args_info->kegg_arg));
   free_string_field (&(args_info->kegg_orig));
   free_string_field (&(args_info->kegg_org_arg));
   free_string_field (&(args_info->config_orig));
   free_string_field (&(args_info->random_orig));
   free_string_field (&(args_info->verbosity_orig));
+  free_string_field (&(args_info->annotations_arg));
+  free_string_field (&(args_info->annotations_orig));
   
   
 
     write_into_file(outfile, "output", args_info->output_orig, 0);
   if (args_info->negatives_given)
     write_into_file(outfile, "negatives", args_info->negatives_orig, 0);
-  if (args_info->go_onto_given)
-    write_into_file(outfile, "go_onto", args_info->go_onto_orig, 0);
-  if (args_info->go_anno_given)
-    write_into_file(outfile, "go_anno", args_info->go_anno_orig, 0);
-  if (args_info->go_name_given)
-    write_into_file(outfile, "go_name", args_info->go_name_orig, 0);
+  if (args_info->onto_given)
+    write_into_file(outfile, "onto", args_info->onto_orig, 0);
+  if (args_info->obo_anno_given)
+    write_into_file(outfile, "obo_anno", args_info->obo_anno_orig, 0);
+  if (args_info->namespace_given)
+    write_into_file(outfile, "namespace", args_info->namespace_orig, 0);
   if (args_info->kegg_given)
     write_into_file(outfile, "kegg", args_info->kegg_orig, 0);
   if (args_info->kegg_org_given)
     write_into_file(outfile, "random", args_info->random_orig, 0);
   if (args_info->verbosity_given)
     write_into_file(outfile, "verbosity", args_info->verbosity_orig, 0);
+  if (args_info->annotations_given)
+    write_into_file(outfile, "annotations", args_info->annotations_orig, 0);
   
 
   i = EXIT_SUCCESS;
         { "directory",	1, NULL, 'd' },
         { "output",	1, NULL, 'o' },
         { "negatives",	1, NULL, 'I' },
-        { "go_onto",	1, NULL, 'y' },
-        { "go_anno",	1, NULL, 'g' },
-        { "go_name",	1, NULL, 'n' },
+        { "onto",	1, NULL, 'y' },
+        { "obo_anno",	1, NULL, 'g' },
+        { "namespace",	1, NULL, 'n' },
         { "kegg",	1, NULL, 'k' },
         { "kegg_org",	1, NULL, 'K' },
         { "mips_onto",	1, NULL, 'm' },
         { "config",	1, NULL, 'c' },
         { "random",	1, NULL, 'r' },
         { "verbosity",	1, NULL, 'v' },
+        { "annotations",	1, NULL, 'f' },
         { NULL,	0, NULL, 0 }
       };
 
-      c = getopt_long (argc, argv, "hVi:d:o:I:y:g:n:k:K:m:a:sblt:q:NL:c:r:v:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hVi:d:o:I:y:g:n:k:K:m:a:sblt:q:NL:c:r:v:f:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
             goto failure;
         
           break;
-        case 'y':	/* GO ontology.  */
+        case 'y':	/* ontology (obo file).  */
         
         
-          if (update_arg( (void *)&(args_info->go_onto_arg), 
-               &(args_info->go_onto_orig), &(args_info->go_onto_given),
-              &(local_args_info.go_onto_given), optarg, 0, 0, ARG_STRING,
+          if (update_arg( (void *)&(args_info->onto_arg), 
+               &(args_info->onto_orig), &(args_info->onto_given),
+              &(local_args_info.onto_given), optarg, 0, 0, ARG_STRING,
               check_ambiguity, override, 0, 0,
-              "go_onto", 'y',
+              "onto", 'y',
               additional_error))
             goto failure;
         
           break;
-        case 'g':	/* GO annotations.  */
+        case 'g':	/* Gene annotations that correspond to the OBO ontology for the organism of interest..  */
         
         
-          if (update_arg( (void *)&(args_info->go_anno_arg), 
-               &(args_info->go_anno_orig), &(args_info->go_anno_given),
-              &(local_args_info.go_anno_given), optarg, 0, 0, ARG_STRING,
+          if (update_arg( (void *)&(args_info->obo_anno_arg), 
+               &(args_info->obo_anno_orig), &(args_info->obo_anno_given),
+              &(local_args_info.obo_anno_given), optarg, 0, 0, ARG_STRING,
               check_ambiguity, override, 0, 0,
-              "go_anno", 'g',
+              "obo_anno", 'g',
               additional_error))
             goto failure;
         
           break;
-        case 'n':	/* GO namespace.  */
+        case 'n':	/* Namespace (the gene ontology namespaces can be abbreviated bp, mf, and cc).  */
         
         
-          if (update_arg( (void *)&(args_info->go_name_arg), 
-               &(args_info->go_name_orig), &(args_info->go_name_given),
-              &(local_args_info.go_name_given), optarg, 0, "bp", ARG_STRING,
+          if (update_arg( (void *)&(args_info->namespace_arg), 
+               &(args_info->namespace_orig), &(args_info->namespace_given),
+              &(local_args_info.namespace_given), optarg, 0, "", ARG_STRING,
               check_ambiguity, override, 0, 0,
-              "go_name", 'n',
+              "namespace", 'n',
               additional_error))
             goto failure;
         
             goto failure;
         
           break;
+        case 'f':	/* File for propogated annotations.  */
+        
+        
+          if (update_arg( (void *)&(args_info->annotations_arg), 
+               &(args_info->annotations_orig), &(args_info->annotations_given),
+              &(local_args_info.annotations_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "annotations", 'f',
+              additional_error))
+            goto failure;
+        
+          break;
 
         case 0:	/* Long option with no short option */
         case '?':	/* Invalid option.  */

File tools/BNFunc/cmdline.h

   char * negatives_arg;	/**< @brief Negative slim file.  */
   char * negatives_orig;	/**< @brief Negative slim file original value given at command line.  */
   const char *negatives_help; /**< @brief Negative slim file help description.  */
-  char * go_onto_arg;	/**< @brief GO ontology.  */
-  char * go_onto_orig;	/**< @brief GO ontology original value given at command line.  */
-  const char *go_onto_help; /**< @brief GO ontology help description.  */
-  char * go_anno_arg;	/**< @brief GO annotations.  */
-  char * go_anno_orig;	/**< @brief GO annotations original value given at command line.  */
-  const char *go_anno_help; /**< @brief GO annotations help description.  */
-  char * go_name_arg;	/**< @brief GO namespace (default='bp').  */
-  char * go_name_orig;	/**< @brief GO namespace original value given at command line.  */
-  const char *go_name_help; /**< @brief GO namespace help description.  */
+  char * onto_arg;	/**< @brief ontology (obo file).  */
+  char * onto_orig;	/**< @brief ontology (obo file) original value given at command line.  */
+  const char *onto_help; /**< @brief ontology (obo file) help description.  */
+  char * obo_anno_arg;	/**< @brief Gene annotations that correspond to the OBO ontology for the organism of interest..  */
+  char * obo_anno_orig;	/**< @brief Gene annotations that correspond to the OBO ontology for the organism of interest. original value given at command line.  */
+  const char *obo_anno_help; /**< @brief Gene annotations that correspond to the OBO ontology for the organism of interest. help description.  */
+  char * namespace_arg;	/**< @brief Namespace (the gene ontology namespaces can be abbreviated bp, mf, and cc) (default='').  */
+  char * namespace_orig;	/**< @brief Namespace (the gene ontology namespaces can be abbreviated bp, mf, and cc) original value given at command line.  */
+  const char *namespace_help; /**< @brief Namespace (the gene ontology namespaces can be abbreviated bp, mf, and cc) help description.  */
   char * kegg_arg;	/**< @brief KEGG ontology.  */
   char * kegg_orig;	/**< @brief KEGG ontology original value given at command line.  */
   const char *kegg_help; /**< @brief KEGG ontology help description.  */
   int verbosity_arg;	/**< @brief Message verbosity (default='5').  */
   char * verbosity_orig;	/**< @brief Message verbosity original value given at command line.  */
   const char *verbosity_help; /**< @brief Message verbosity help description.  */
+  char * annotations_arg;	/**< @brief File for propogated annotations.  */
+  char * annotations_orig;	/**< @brief File for propogated annotations original value given at command line.  */
+  const char *annotations_help; /**< @brief File for propogated annotations help description.  */
   
   unsigned int help_given ;	/**< @brief Whether help was given.  */
   unsigned int version_given ;	/**< @brief Whether version was given.  */
   unsigned int directory_given ;	/**< @brief Whether directory was given.  */
   unsigned int output_given ;	/**< @brief Whether output was given.  */
   unsigned int negatives_given ;	/**< @brief Whether negatives was given.  */
-  unsigned int go_onto_given ;	/**< @brief Whether go_onto was given.  */
-  unsigned int go_anno_given ;	/**< @brief Whether go_anno was given.  */
-  unsigned int go_name_given ;	/**< @brief Whether go_name was given.  */
+  unsigned int onto_given ;	/**< @brief Whether onto was given.  */
+  unsigned int obo_anno_given ;	/**< @brief Whether obo_anno was given.  */
+  unsigned int namespace_given ;	/**< @brief Whether namespace was given.  */
   unsigned int kegg_given ;	/**< @brief Whether kegg was given.  */
   unsigned int kegg_org_given ;	/**< @brief Whether kegg_org was given.  */
   unsigned int mips_onto_given ;	/**< @brief Whether mips_onto was given.  */
   unsigned int config_given ;	/**< @brief Whether config was given.  */
   unsigned int random_given ;	/**< @brief Whether random was given.  */
   unsigned int verbosity_given ;	/**< @brief Whether verbosity was given.  */
+  unsigned int annotations_given ;	/**< @brief Whether annotations was given.  */
 
 } ;
 

File tools/BNServer/BNServer.cpp

 	ofstream					ofsm;
 	int							iRet;
 	COntologyKEGG				KEGG;
-	COntologyGO					GOBP, GOMF, GOCC;
+	COntologyOBO					GOBP, GOMF, GOCC;
 	set<size_t>					setiContexts;
 // Server data
 	vector<float>				vecdPriors;
 		if( sArgs.go_anno_arg ) {
 			ifsmGenes.clear( );
 			ifsmGenes.open( sArgs.go_anno_arg ); }
-		if( !COntologyGO::Open( ifsm, ifsmGenes, Genome, GOBP, GOMF, GOCC, false, true ) ) {
+		if( !COntologyOBO::Open( ifsm, ifsmGenes, Genome, GOBP, GOMF, GOCC, false, true ) ) {
 			cerr << "Could not open: " << sArgs.go_onto_arg << ", " << sArgs.go_anno_arg << endl;
 			return 1; }
 		ifsm.close( );

File tools/Counter/cmdline.c

 /*
-  File autogenerated by gengetopt version 2.22.4
+  File autogenerated by gengetopt version 2.22
   generated with the following command:
-  /usr/bin/gengetopt -iCounter.ggo --default-optional -u -N -e 
+  /home/cypark/g/src/sleipnir/trunk/../extlib/gengetopt-2.22/bin/gengetopt -iCounter.ggo --default-optional -u -N -e 
 
   The developers of gengetopt consider the fixed text that goes in all
   gengetopt output files to be in the public domain:
 #include <stdlib.h>
 #include <string.h>
 
-#ifndef FIX_UNUSED
-#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
-#endif
-
-#include <getopt.h>
+#include "getopt.h"
 
 #include "cmdline.h"
 
   "  -h, --help                    Print help and exit",
   "  -V, --version                 Print version and exit",
   "\n Group: Mode",
-  "  -w, --answers=filename        Answer file",
-  "  -k, --counts=directory        Directory containing count files",
-  "  -n, --networks=filename       Bayes nets",
+  "  -w, --answers=filename        Answer file (-w triggers counts mode)",
+  "  -k, --counts=directory        Directory containing count files (-k triggers \n                                  learning mode)",
+  "  -n, --networks=filename       Bayes nets (-n triggers inference mode)",
   "\nMain:",
   "  -o, --output=filename or directory\n                                Output count directory, Bayes nets, or \n                                  inferences",
   "  -d, --directory=directory     Data directory  (default=`.')",
 void clear_args (struct gengetopt_args_info *args_info);
 
 static int
-cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error);
 
 static int
 static
 void clear_args (struct gengetopt_args_info *args_info)
 {
-  FIX_UNUSED (args_info);
   args_info->answers_arg = NULL;
   args_info->answers_orig = NULL;
   args_info->counts_arg = NULL;
 void
 cmdline_parser_print_version (void)
 {
-  printf ("%s %s\n",
-     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
-     CMDLINE_PARSER_VERSION);
+  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
 }
 
 static void print_help_common(void) {
   printf("\n");
 
   if (strlen(gengetopt_args_info_description) > 0)
-    printf("%s\n\n", gengetopt_args_info_description);
+    printf("%s\n", gengetopt_args_info_description);
 }
 
 void
   clear_args (args_info);
   init_args_info (args_info);
 
-  args_info->inputs = 0;
+  args_info->inputs = NULL;
   args_info->inputs_num = 0;
 }
 
 
 
 static void
-write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
+write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
 {
-  FIX_UNUSED (values);
   if (arg) {
     fprintf(outfile, "%s=\"%s\"\n", opt, arg);
   } else {
 char *
 gengetopt_strdup (const char *s)
 {
-  char *result = 0;
+  char *result = NULL;
   if (!s)
     return result;
 
 }
 
 int
-cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
+cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
 {
   return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
 }
 
 int
-cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                    struct cmdline_parser_params *params)
 {
   int result;
-  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
+  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
 
   return result;
 }
 
 int
-cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
 {
   int result;
   struct cmdline_parser_params params;
   params.check_ambiguity = 0;
   params.print_errors = 1;
 
-  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
+  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
 
   return result;
 }
 {
   int result = EXIT_SUCCESS;
 
-  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
+  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
     result = EXIT_FAILURE;
 
   return result;
 cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
 {
   int error = 0;
-  FIX_UNUSED (additional_error);
 
   /* checks for required options */
   if (! args_info->output_given)
   
   if (args_info->Mode_group_counter == 0)
     {
-      fprintf (stderr, "%s: %d options of group Mode were given. One is required%s.\n", prog_name, args_info->Mode_group_counter, (additional_error ? additional_error : ""));
+      fprintf (stderr, "%s: %d options of group Mode were given. One is required.%s\n", prog_name, args_info->Mode_group_counter, (additional_error ? additional_error : ""));
       error = 1;
     }
   
 static
 int update_arg(void *field, char **orig_field,
                unsigned int *field_given, unsigned int *prev_given, 
-               char *value, const char *possible_values[],
-               const char *default_value,
+               char *value, char *possible_values[], const char *default_value,
                cmdline_parser_arg_type arg_type,
                int check_ambiguity, int override,
                int no_free, int multiple_option,
   const char *val = value;
   int found;
   char **string_field;
-  FIX_UNUSED (field);
 
   stop_char = 0;
   found = 0;
       return 1; /* failure */
     }
 
-  FIX_UNUSED (default_value);
     
   if (field_given && *field_given && ! override)
     return 0;
 
 
 int
-cmdline_parser_internal (
-  int argc, char **argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
                         struct cmdline_parser_params *params, const char *additional_error)
 {
   int c;	/* Character of the parsed option.  */
         { "memmapout",	0, NULL, 'M' },
         { "threads",	1, NULL, 't' },
         { "verbosity",	1, NULL, 'v' },
-        { 0,  0, 0, 0 }
+        { NULL,	0, NULL, 0 }
       };
 
       c = getopt_long (argc, argv, "hVw:k:n:o:d:s:e:X:g:G:c:C:b:Z:Sp:a:rR:y:lxmMt:v:", long_options, &option_index);
           return 0;
         
           break;
-        case 'w':	/* Answer file.  */
+        case 'w':	/* Answer file (-w triggers counts mode).  */
         
           if (args_info->Mode_group_counter && override)
             reset_group_Mode (args_info);
             goto failure;
         
           break;
-        case 'k':	/* Directory containing count files.  */
+        case 'k':	/* Directory containing count files (-k triggers learning mode).  */
         
           if (args_info->Mode_group_counter && override)
             reset_group_Mode (args_info);
             goto failure;
         
           break;
-        case 'n':	/* Bayes nets.  */
+        case 'n':	/* Bayes nets (-n triggers inference mode).  */
         
           if (args_info->Mode_group_counter && override)
             reset_group_Mode (args_info);
 
   if (args_info->Mode_group_counter > 1)
     {
-      fprintf (stderr, "%s: %d options of group Mode were given. One is required%s.\n", argv[0], args_info->Mode_group_counter, (additional_error ? additional_error : ""));
+      fprintf (stderr, "%s: %d options of group Mode were given. One is required.%s\n", argv[0], args_info->Mode_group_counter, (additional_error ? additional_error : ""));
       error = 1;
     }
   

File tools/Counter/cmdline.h

 /** @file cmdline.h
  *  @brief The header file for the command line option parser
- *  generated by GNU Gengetopt version 2.22.4
+ *  generated by GNU Gengetopt version 2.22
  *  http://www.gnu.org/software/gengetopt.
  *  DO NOT modify this file, since it can be overwritten
  *  @author GNU Gengetopt by Lorenzo Bettini */
 #endif /* __cplusplus */
 
 #ifndef CMDLINE_PARSER_PACKAGE
-/** @brief the program name (used for printing errors) */
+/** @brief the program name */
 #define CMDLINE_PARSER_PACKAGE "Counter"
 #endif
 
-#ifndef CMDLINE_PARSER_PACKAGE_NAME
-/** @brief the complete program name (used for help and version) */
-#define CMDLINE_PARSER_PACKAGE_NAME "Counter"
-#endif
-
 #ifndef CMDLINE_PARSER_VERSION
 /** @brief the program version */
 #define CMDLINE_PARSER_VERSION "1.0"
 {
   const char *help_help; /**< @brief Print help and exit help description.  */
   const char *version_help; /**< @brief Print version and exit help description.  */
-  char * answers_arg;	/**< @brief Answer file.  */
-  char * answers_orig;	/**< @brief Answer file original value given at command line.  */
-  const char *answers_help; /**< @brief Answer file help description.  */
-  char * counts_arg;	/**< @brief Directory containing count files.  */
-  char * counts_orig;	/**< @brief Directory containing count files original value given at command line.  */
-  const char *counts_help; /**< @brief Directory containing count files help description.  */
-  char * networks_arg;	/**< @brief Bayes nets.  */
-  char * networks_orig;	/**< @brief Bayes nets original value given at command line.  */
-  const char *networks_help; /**< @brief Bayes nets help description.  */
+  char * answers_arg;	/**< @brief Answer file (-w triggers counts mode).  */
+  char * answers_orig;	/**< @brief Answer file (-w triggers counts mode) original value given at command line.  */
+  const char *answers_help; /**< @brief Answer file (-w triggers counts mode) help description.  */
+  char * counts_arg;	/**< @brief Directory containing count files (-k triggers learning mode).  */
+  char * counts_orig;	/**< @brief Directory containing count files (-k triggers learning mode) original value given at command line.  */
+  const char *counts_help; /**< @brief Directory containing count files (-k triggers learning mode) help description.  */
+  char * networks_arg;	/**< @brief Bayes nets (-n triggers inference mode).  */
+  char * networks_orig;	/**< @brief Bayes nets (-n triggers inference mode) original value given at command line.  */
+  const char *networks_help; /**< @brief Bayes nets (-n triggers inference mode) help description.  */
   char * output_arg;	/**< @brief Output count directory, Bayes nets, or inferences.  */
   char * output_orig;	/**< @brief Output count directory, Bayes nets, or inferences original value given at command line.  */
   const char *output_help; /**< @brief Output count directory, Bayes nets, or inferences help description.  */
  * @param args_info the structure where option information will be stored
  * @return 0 if everything went fine, NON 0 if an error took place
  */
-int cmdline_parser (int argc, char **argv,
+int cmdline_parser (int argc, char * const *argv,
   struct gengetopt_args_info *args_info);
 
 /**
  * @return 0 if everything went fine, NON 0 if an error took place
  * @deprecated use cmdline_parser_ext() instead
  */
-int cmdline_parser2 (int argc, char **argv,
+int cmdline_parser2 (int argc, char * const *argv,
   struct gengetopt_args_info *args_info,
   int override, int initialize, int check_required);
 
  * @param params additional parameters for the parser
  * @return 0 if everything went fine, NON 0 if an error took place
  */
-int cmdline_parser_ext (int argc, char **argv,
+int cmdline_parser_ext (int argc, char * const *argv,
   struct gengetopt_args_info *args_info,
   struct cmdline_parser_params *params);
 

File tools/DChecker/DChecker.cpp

 			if( !sArgs.sse_flag ) {
 				*postm << "#	P	" << iPositives << endl;
 				*postm << "#	N	" << iNegatives << endl; }
-			*postm << "Cut	Genes	" << ( sArgs.sse_flag ? "Pairs	SSE" : "TP	FP	TN	FN" ) << endl;
+			*postm << "Cut	Genes	" << ( sArgs.sse_flag ? "Pairs	SSE" : "TP	FP	TN	FN	PR	RC" ) << endl;
 			for( i = 0; i < MatResults.GetRows( ); ++i ) {
 				*postm << ( iBins ? i : ( sArgs.min_arg + ( i * sArgs.delta_arg ) ) ) << '\t' <<
 					veciRec[ i ];
 						*postm << '\t' << MatResults.Get( i, j );
 				if( veciGenesTerm.size( ) || vecfHere.size( ) )
 					*postm << '\t' << veciRecTerm[ i ];
+				
+				// print precision/recall
+				*postm << '\t' << (float)MatResults.Get(i,0)/(MatResults.Get(0,0));
+				*postm << '\t' << (float)MatResults.Get(i,0)/(MatResults.Get(i,1)+MatResults.Get(i,0)+1);
+				
 				*postm << endl; }
 			if( !sArgs.sse_flag )
 				*postm << "#	AUC	" << ( sArgs.auc_arg ?

File tools/Dat2Dab/Dat2Dab.ggo

 							double
 option	"zero"			Z	"Zero missing values"
 							flag	off
-option	"dmissing"		D	"set missing values to a set default value"
+option	"dmissing"		M	"set missing values to a set default value"
 							float	
 option	"duplicates"	d	"Allow dissimilar duplicate values"
 							flag	off

File tools/Dat2Dab/cmdline.c

 /*
   File autogenerated by gengetopt version 2.22
   generated with the following command:
-  /home/chuttenh/hg/sleipnir/trunk/../extlib/gengetopt-2.22/bin/gengetopt -iDat2Dab.ggo --default-optional -u -N -e 
+  /home/cypark/g/src/sleipnir/trunk/../extlib/gengetopt-2.22/bin/gengetopt -iDat2Dab.ggo --default-optional -u -N -e 
 
   The developers of gengetopt consider the fixed text that goes in all
   gengetopt output files to be in the public domain:
   "\nMain:",
   "  -i, --input=filename     Input DAT/DAB file",
   "  -o, --output=filename    Output DAT/DAB file",
+  "  -q, --quant=filename     Input Quant file",
   "\nPreprocessing:",
   "  -f, --flip               Calculate one minus values  (default=off)",
   "  -n, --normalize          Normalize to the range [0,1]  (default=off)",
   "  -G, --genex=filename     Exclude all genes from the given set",
   "  -D, --genee=filename     Process only edges including a gene from the given \n                             set",
   "  -e, --edges=filename     Process only edges from the given DAT/DAB",
+  "  -x, --exedges=filename   Exclude edges from the given DAT/DAB",
   "  -c, --cutoff=DOUBLE      Exclude edges below cutoff",
   "  -Z, --zero               Zero missing values  (default=off)",
+  "  -M, --dmissing=FLOAT     set missing values to a set default value",
   "  -d, --duplicates         Allow dissimilar duplicate values  (default=off)",
   "  -u, --subsample=FLOAT    Fraction of output to randomly subsample  \n                             (default=`1')",
   "\nLookups:",
   "  -b, --table              Produce table formatted output  (default=off)",
   "  -s, --skip=INT           Columns to skip in input PCL  (default=`2')",
   "  -m, --memmap             Memory map input/output  (default=off)",
+  "  -R, --random=INT         Seed random generator (default -1 uses current time) \n                              (default=`-1')",
+  "  -N, --noise              Add noise from standard Normal to all non-missing \n                             values  (default=off)",
   "  -v, --verbosity=INT      Message verbosity  (default=`5')",
     0
 };
   args_info->version_given = 0 ;
   args_info->input_given = 0 ;
   args_info->output_given = 0 ;
+  args_info->quant_given = 0 ;
   args_info->flip_given = 0 ;
   args_info->normalize_given = 0 ;
   args_info->zscore_given = 0 ;
   args_info->genex_given = 0 ;
   args_info->genee_given = 0 ;
   args_info->edges_given = 0 ;
+  args_info->exedges_given = 0 ;
   args_info->cutoff_given = 0 ;
   args_info->zero_given = 0 ;
+  args_info->dmissing_given = 0 ;
   args_info->duplicates_given = 0 ;
   args_info->subsample_given = 0 ;
   args_info->lookup1_given = 0 ;
   args_info->table_given = 0 ;
   args_info->skip_given = 0 ;
   args_info->memmap_given = 0 ;
+  args_info->random_given = 0 ;
+  args_info->noise_given = 0 ;
   args_info->verbosity_given = 0 ;
 }
 
   args_info->input_orig = NULL;
   args_info->output_arg = NULL;
   args_info->output_orig = NULL;
+  args_info->quant_arg = NULL;
+  args_info->quant_orig = NULL;
   args_info->flip_flag = 0;
   args_info->normalize_flag = 0;
   args_info->zscore_flag = 0;
   args_info->genee_orig = NULL;
   args_info->edges_arg = NULL;
   args_info->edges_orig = NULL;
+  args_info->exedges_arg = NULL;
+  args_info->exedges_orig = NULL;
   args_info->cutoff_orig = NULL;
   args_info->zero_flag = 0;
+  args_info->dmissing_orig = NULL;
   args_info->duplicates_flag = 0;
   args_info->subsample_arg = 1;
   args_info->subsample_orig = NULL;
   args_info->skip_arg = 2;
   args_info->skip_orig = NULL;
   args_info->memmap_flag = 0;
+  args_info->random_arg = -1;
+  args_info->random_orig = NULL;
+  args_info->noise_flag = 0;
   args_info->verbosity_arg = 5;
   args_info->verbosity_orig = NULL;
   
   args_info->version_help = gengetopt_args_info_help[1] ;
   args_info->input_help = gengetopt_args_info_help[3] ;
   args_info->output_help = gengetopt_args_info_help[4] ;
-  args_info->flip_help = gengetopt_args_info_help[6] ;
-  args_info->normalize_help = gengetopt_args_info_help[7] ;
-  args_info->zscore_help = gengetopt_args_info_help[8] ;
-  args_info->rank_help = gengetopt_args_info_help[9] ;
-  args_info->randomize_help = gengetopt_args_info_help[10] ;
-  args_info->genes_help = gengetopt_args_info_help[12] ;
-  args_info->genex_help = gengetopt_args_info_help[13] ;
-  args_info->genee_help = gengetopt_args_info_help[14] ;
-  args_info->edges_help = gengetopt_args_info_help[15] ;
-  args_info->cutoff_help = gengetopt_args_info_help[16] ;
-  args_info->zero_help = gengetopt_args_info_help[17] ;
-  args_info->duplicates_help = gengetopt_args_info_help[18] ;
-  args_info->subsample_help = gengetopt_args_info_help[19] ;
-  args_info->lookup1_help = gengetopt_args_info_help[21] ;
-  args_info->lookup2_help = gengetopt_args_info_help[22] ;
-  args_info->lookups1_help = gengetopt_args_info_help[23] ;
-  args_info->lookups2_help = gengetopt_args_info_help[24] ;
-  args_info->genelist_help = gengetopt_args_info_help[25] ;
-  args_info->paircount_help = gengetopt_args_info_help[26] ;
-  args_info->remap_help = gengetopt_args_info_help[28] ;
-  args_info->table_help = gengetopt_args_info_help[29] ;
-  args_info->skip_help = gengetopt_args_info_help[30] ;
-  args_info->memmap_help = gengetopt_args_info_help[31] ;
-  args_info->verbosity_help = gengetopt_args_info_help[32] ;
+  args_info->quant_help = gengetopt_args_info_help[5] ;
+  args_info->flip_help = gengetopt_args_info_help[7] ;
+  args_info->normalize_help = gengetopt_args_info_help[8] ;
+  args_info->zscore_help = gengetopt_args_info_help[9] ;
+  args_info->rank_help = gengetopt_args_info_help[10] ;
+  args_info->randomize_help = gengetopt_args_info_help[11] ;
+  args_info->genes_help = gengetopt_args_info_help[13] ;
+  args_info->genex_help = gengetopt_args_info_help[14] ;
+  args_info->genee_help = gengetopt_args_info_help[15] ;
+  args_info->edges_help = gengetopt_args_info_help[16] ;
+  args_info->exedges_help = gengetopt_args_info_help[17] ;
+  args_info->cutoff_help = gengetopt_args_info_help[18] ;
+  args_info->zero_help = gengetopt_args_info_help[19] ;
+  args_info->dmissing_help = gengetopt_args_info_help[20] ;
+  args_info->duplicates_help = gengetopt_args_info_help[21] ;
+  args_info->subsample_help = gengetopt_args_info_help[22] ;
+  args_info->lookup1_help = gengetopt_args_info_help[24] ;
+  args_info->lookup2_help = gengetopt_args_info_help[25] ;
+  args_info->lookups1_help = gengetopt_args_info_help[26] ;
+  args_info->lookups2_help = gengetopt_args_info_help[27] ;
+  args_info->genelist_help = gengetopt_args_info_help[28] ;
+  args_info->paircount_help = gengetopt_args_info_help[29] ;
+  args_info->remap_help = gengetopt_args_info_help[31] ;
+  args_info->table_help = gengetopt_args_info_help[32] ;
+  args_info->skip_help = gengetopt_args_info_help[33] ;
+  args_info->memmap_help = gengetopt_args_info_help[34] ;
+  args_info->random_help = gengetopt_args_info_help[35] ;
+  args_info->noise_help = gengetopt_args_info_help[36] ;
+  args_info->verbosity_help = gengetopt_args_info_help[37] ;
   
 }
 
   free_string_field (&(args_info->input_orig));
   free_string_field (&(args_info->output_arg));
   free_string_field (&(args_info->output_orig));
+  free_string_field (&(args_info->quant_arg));
+  free_string_field (&(args_info->quant_orig));
   free_string_field (&(args_info->genes_arg));
   free_string_field (&(args_info->genes_orig));
   free_string_field (&(args_info->genex_arg));
   free_string_field (&(args_info->genee_orig));
   free_string_field (&(args_info->edges_arg));
   free_string_field (&(args_info->edges_orig));
+  free_string_field (&(args_info->exedges_arg));
+  free_string_field (&(args_info->exedges_orig));
   free_string_field (&(args_info->cutoff_orig));
+  free_string_field (&(args_info->dmissing_orig));
   free_string_field (&(args_info->subsample_orig));
   free_string_field (&(args_info->lookup1_arg));
   free_string_field (&(args_info->lookup1_orig));
   free_string_field (&(args_info->remap_arg));
   free_string_field (&(args_info->remap_orig));
   free_string_field (&(args_info->skip_orig));
+  free_string_field (&(args_info->random_orig));
   free_string_field (&(args_info->verbosity_orig));
   
   
     write_into_file(outfile, "input", args_info->input_orig, 0);
   if (args_info->output_given)
     write_into_file(outfile, "output", args_info->output_orig, 0);
+  if (args_info->quant_given)
+    write_into_file(outfile, "quant", args_info->quant_orig, 0);
   if (args_info->flip_given)
     write_into_file(outfile, "flip", 0, 0 );
   if (args_info->normalize_given)
     write_into_file(outfile, "genee", args_info->genee_orig, 0);
   if (args_info->edges_given)
     write_into_file(outfile, "edges", args_info->edges_orig, 0);
+  if (args_info->exedges_given)
+    write_into_file(outfile, "exedges", args_info->exedges_orig, 0);
   if (args_info->cutoff_given)
     write_into_file(outfile, "cutoff", args_info->cutoff_orig, 0);
   if (args_info->zero_given)
     write_into_file(outfile, "zero", 0, 0 );
+  if (args_info->dmissing_given)
+    write_into_file(outfile, "dmissing", args_info->dmissing_orig, 0);
   if (args_info->duplicates_given)
     write_into_file(outfile, "duplicates", 0, 0 );
   if (args_info->subsample_given)
     write_into_file(outfile, "skip", args_info->skip_orig, 0);
   if (args_info->memmap_given)
     write_into_file(outfile, "memmap", 0, 0 );
+  if (args_info->random_given)
+    write_into_file(outfile, "random", args_info->random_orig, 0);
+  if (args_info->noise_given)
+    write_into_file(outfile, "noise", 0, 0 );
   if (args_info->verbosity_given)
     write_into_file(outfile, "verbosity", args_info->verbosity_orig, 0);
   
         { "version",	0, NULL, 'V' },
         { "input",	1, NULL, 'i' },
         { "output",	1, NULL, 'o' },
+        { "quant",	1, NULL, 'q' },
         { "flip",	0, NULL, 'f' },
         { "normalize",	0, NULL, 'n' },
         { "zscore",	0, NULL, 'z' },
         { "genex",	1, NULL, 'G' },
         { "genee",	1, NULL, 'D' },
         { "edges",	1, NULL, 'e' },
+        { "exedges",	1, NULL, 'x' },
         { "cutoff",	1, NULL, 'c' },
         { "zero",	0, NULL, 'Z' },
+        { "dmissing",	1, NULL, 'M' },
         { "duplicates",	0, NULL, 'd' },
         { "subsample",	1, NULL, 'u' },
         { "lookup1",	1, NULL, 'l' },
         { "table",	0, NULL, 'b' },
         { "skip",	1, NULL, 's' },
         { "memmap",	0, NULL, 'm' },
+        { "random",	1, NULL, 'R' },
+        { "noise",	0, NULL, 'N' },
         { "verbosity",	1, NULL, 'v' },
         { NULL,	0, NULL, 0 }
       };
 
-      c = getopt_long (argc, argv, "hVi:o:fnzrag:G:D:e:c:Zdu:l:L:t:T:EPp:bs:mv:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hVi:o:q:fnzrag:G:D:e:x:c:ZM:du:l:L:t:T:EPp:bs:mR:Nv:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
             goto failure;
         
           break;
+        case 'q':	/* Input Quant file.  */
+        
+        
+          if (update_arg( (void *)&(args_info->quant_arg), 
+               &(args_info->quant_orig), &(args_info->quant_given),
+              &(local_args_info.quant_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "quant", 'q',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'f':	/* Calculate one minus values.  */
         
         
             goto failure;
         
           break;
+        case 'x':	/* Exclude edges from the given DAT/DAB.  */
+        
+        
+          if (update_arg( (void *)&(args_info->exedges_arg), 
+               &(args_info->exedges_orig), &(args_info->exedges_given),
+              &(local_args_info.exedges_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "exedges", 'x',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'c':	/* Exclude edges below cutoff.  */
         
         
             goto failure;
         
           break;
+        case 'M':	/* set missing values to a set default value.  */
+        
+        
+          if (update_arg( (void *)&(args_info->dmissing_arg), 
+               &(args_info->dmissing_orig), &(args_info->dmissing_given),
+              &(local_args_info.dmissing_given), optarg, 0, 0, ARG_FLOAT,
+              check_ambiguity, override, 0, 0,
+              "dmissing", 'M',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'd':	/* Allow dissimilar duplicate values.  */
         
         
             goto failure;
         
           break;
+        case 'R':	/* Seed random generator (default -1 uses current time).  */
+        
+        
+          if (update_arg( (void *)&(args_info->random_arg), 
+               &(args_info->random_orig), &(args_info->random_given),
+              &(local_args_info.random_given), optarg, 0, "-1", ARG_INT,
+              check_ambiguity, override, 0, 0,
+              "random", 'R',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'N':	/* Add noise from standard Normal to all non-missing values.  */
+        
+        
+          if (update_arg((void *)&(args_info->noise_flag), 0, &(args_info->noise_given),
+              &(local_args_info.noise_given), optarg, 0, 0, ARG_FLAG,
+              check_ambiguity, override, 1, 0, "noise", 'N',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'v':	/* Message verbosity.  */
         
         

File tools/Dat2Dab/cmdline.h

   char * output_arg;	/**< @brief Output DAT/DAB file.  */
   char * output_orig;	/**< @brief Output DAT/DAB file original value given at command line.  */
   const char *output_help; /**< @brief Output DAT/DAB file help description.  */
+  char * quant_arg;	/**< @brief Input Quant file.  */
+  char * quant_orig;	/**< @brief Input Quant file original value given at command line.  */
+  const char *quant_help; /**< @brief Input Quant file help description.  */
   int flip_flag;	/**< @brief Calculate one minus values (default=off).  */
   const char *flip_help; /**< @brief Calculate one minus values help description.  */
   int normalize_flag;	/**< @brief Normalize to the range [0,1] (default=off).  */
   char * edges_arg;	/**< @brief Process only edges from the given DAT/DAB.  */
   char * edges_orig;	/**< @brief Process only edges from the given DAT/DAB original value given at command line.  */
   const char *edges_help; /**< @brief Process only edges from the given DAT/DAB help description.  */
+  char * exedges_arg;	/**< @brief Exclude edges from the given DAT/DAB.  */
+  char * exedges_orig;	/**< @brief Exclude edges from the given DAT/DAB original value given at command line.  */
+  const char *exedges_help; /**< @brief Exclude edges from the given DAT/DAB help description.  */
   double cutoff_arg;	/**< @brief Exclude edges below cutoff.  */
   char * cutoff_orig;	/**< @brief Exclude edges below cutoff original value given at command line.  */
   const char *cutoff_help; /**< @brief Exclude edges below cutoff help description.  */
   int zero_flag;	/**< @brief Zero missing values (default=off).  */
   const char *zero_help; /**< @brief Zero missing values help description.  */
+  float dmissing_arg;	/**< @brief set missing values to a set default value.  */
+  char * dmissing_orig;	/**< @brief set missing values to a set default value original value given at command line.  */
+  const char *dmissing_help; /**< @brief set missing values to a set default value help description.  */
   int duplicates_flag;	/**< @brief Allow dissimilar duplicate values (default=off).  */
   const char *duplicates_help; /**< @brief Allow dissimilar duplicate values help description.  */
   float subsample_arg;	/**< @brief Fraction of output to randomly subsample (default='1').  */
   const char *skip_help; /**< @brief Columns to skip in input PCL help description.  */
   int memmap_flag;	/**< @brief Memory map input/output (default=off).  */
   const char *memmap_help; /**< @brief Memory map input/output help description.  */
+  int random_arg;	/**< @brief Seed random generator (default -1 uses current time) (default='-1').  */
+  char * random_orig;	/**< @brief Seed random generator (default -1 uses current time) original value given at command line.  */
+  const char *random_help; /**< @brief Seed random generator (default -1 uses current time) help description.  */
+  int noise_flag;	/**< @brief Add noise from standard Normal to all non-missing values (default=off).  */
+  const char *noise_help; /**< @brief Add noise from standard Normal to all non-missing values help description.  */
   int verbosity_arg;	/**< @brief Message verbosity (default='5').  */
   char * verbosity_orig;	/**< @brief Message verbosity original value given at command line.  */
   const char *verbosity_help; /**< @brief Message verbosity help description.  */
   unsigned int version_given ;	/**< @brief Whether version was given.  */
   unsigned int input_given ;	/**< @brief Whether input was given.  */
   unsigned int output_given ;	/**< @brief Whether output was given.  */
+  unsigned int quant_given ;	/**< @brief Whether quant was given.  */
   unsigned int flip_given ;	/**< @brief Whether flip was given.  */
   unsigned int normalize_given ;	/**< @brief Whether normalize was given.  */
   unsigned int zscore_given ;	/**< @brief Whether zscore was given.  */
   unsigned int genex_given ;	/**< @brief Whether genex was given.  */
   unsigned int genee_given ;	/**< @brief Whether genee was given.  */
   unsigned int edges_given ;	/**< @brief Whether edges was given.  */
+  unsigned int exedges_given ;	/**< @brief Whether exedges was given.  */
   unsigned int cutoff_given ;	/**< @brief Whether cutoff was given.  */
   unsigned int zero_given ;	/**< @brief Whether zero was given.  */
+  unsigned int dmissing_given ;	/**< @brief Whether dmissing was given.  */
   unsigned int duplicates_given ;	/**< @brief Whether duplicates was given.  */
   unsigned int subsample_given ;	/**< @brief Whether subsample was given.  */
   unsigned int lookup1_given ;	/**< @brief Whether lookup1 was given.  */
   unsigned int table_given ;	/**< @brief Whether table was given.  */
   unsigned int skip_given ;	/**< @brief Whether skip was given.  */
   unsigned int memmap_given ;	/**< @brief Whether memmap was given.  */
+  unsigned int random_given ;	/**< @brief Whether random was given.  */
+  unsigned int noise_given ;	/**< @brief Whether noise was given.  */
   unsigned int verbosity_given ;	/**< @brief Whether verbosity was given.  */
 
   char **inputs ; /**< @brief unamed options (options without names) */

File tools/Explainer/Explainer.cpp

 	float				dValue, dAnswer;
 	vector<SDatum>		vecsData;
 	ifstream			ifsm;
-	COntologyGO			GOBP;
+	COntologyOBO			GOBP;
 	CGenome				Genome;
 	CGene*				pOne;
 	CGene*				pTwo;
 		ifsm.open( sArgs.go_onto_arg );
 		if( sArgs.go_anno_arg )
 			ifsmGenes.open( sArgs.go_anno_arg );
-		if( !GOBP.Open( ifsm, ifsmGenes, Genome, COntologyGO::c_szBiologicalProcess ) ) {
+		if( !GOBP.Open( ifsm, ifsmGenes, Genome, COntologyOBO::c_szBiologicalProcess ) ) {
 			cerr << "Could not open: " << sArgs.go_onto_arg << ", " << sArgs.go_anno_arg << endl;
 			return 1; }
 		ifsm.close( ); }

File tools/OntoShell/OntoShell.cpp

 
 int main( int iArgs, char** aszArgs ) {
 	COntologyKEGG			KEGG;
-	COntologyGO				GOBP, GOMF, GOCC;
+	COntologyOBO				GOBP, GOMF, GOCC;
 	COntologyMIPS			MIPS;
 	COntologyMIPSPhenotypes	MIPSPhen;
 	CGenome					Genome;
 		if( sArgs.go_anno_arg ) {
 			ifsmGenes.clear( );
 			ifsmGenes.open( sArgs.go_anno_arg ); }
-		if( !COntologyGO::Open( ifsmOnto, ifsmGenes, Genome, GOBP, GOMF, GOCC, !!sArgs.dbids_flag,
+		if( !COntologyOBO::Open( ifsmOnto, ifsmGenes, Genome, GOBP, GOMF, GOCC, !!sArgs.dbids_flag,
 			!!sArgs.altids_flag ) ) {
 			cerr << "Could not open: " << sArgs.go_onto_arg << ", " << sArgs.go_anno_arg << endl;
 			return 1; }