Commits

Anonymous committed 0644ebc

Seperated the execution in two stages: Training and Learning

Comments (0)

Files changed (4)

tools/SpeciesConnector/SpeciesConnector.cpp

 
 static const char	c_acDab[]	= ".dab";
 
-float find_value( size_t iOne, size_t iTwo, const CDat& Dat ) {
-
-	return ( ( ( iOne == -1 ) || ( iTwo == -1 ) ) ? CMeta::GetNaN( ) : Dat.Get( iOne, iTwo ) ); }
-
 int main( int iArgs, char** aszArgs ) {
 	gengetopt_args_info			sArgs;
 	size_t						i, j, k, iDatOne, iDatTwo, iGeneOne, iGeneTwo, iZero;
 	if( cmdline_parser( iArgs, aszArgs, &sArgs ) ) {
 		cmdline_parser_print_help( );
 		return 1; }
-	CMeta Meta( sArgs.verbosity_arg, sArgs.random_arg );
-
-	Threshold = ( sArgs.threshold_arg == -1 ) ? 0.5f : float( sArgs.threshold_arg );
-
-	vecstrInputs.resize( sArgs.inputs_num );
-	copy( sArgs.inputs, sArgs.inputs + sArgs.inputs_num, vecstrInputs.begin( ) );
-
-	vecstrxInputs.resize( sArgs.inputs_num );
-
-	for( i = 0; i < vecstrInputs.size( ); ++i ){
-		if( strcmp( &vecstrInputs[ i ][ vecstrInputs[ i ].rfind( "." ) + 1 ], "xdsl" ) == 0 ){ 
-			vecstrxInputs[ i ].resize( vecstrInputs[ i ].rfind( "." ) - vecstrInputs[ i ].rfind( "/" ) - 1 );
-			vecstrxInputs[ i ] = vecstrInputs[ i ].substr( vecstrInputs[ i ].rfind( "/" ) + 1, vecstrInputs[ i ].rfind( "." ) - vecstrInputs[ i ].rfind( "/" ) - 1 );}
-		else{
-			cerr << "inputs file types should be xdsl." <<  endl;
-			return 1;}}
+	CMeta Meta( sArgs.verbosity_arg, sArgs.random_arg );	
 
 	if( sArgs.zeros_arg ) {
 		ifstream		ifsm;
 			if( vecstrZeros.empty( ) )
 				continue;
 			mapZeros[ vecstrZeros[ 0 ] ] = atoi( vecstrZeros[ 1 ].c_str( ) ); } }
+	
+	_mkdir( sArgs.odirectory_arg );
+
+	vecstrInputs.resize( sArgs.inputs_num );
+	copy( sArgs.inputs, sArgs.inputs + sArgs.inputs_num, vecstrInputs.begin( ) );
+
+	vecstrxInputs.resize( sArgs.inputs_num );
+
+	for( i = 0; i < vecstrInputs.size( ); ++i ){
+		if( strcmp( &vecstrInputs[ i ][ vecstrInputs[ i ].rfind( "." ) + 1 ], "xdsl" ) == 0 ){ 
+			vecstrxInputs[ i ].resize( vecstrInputs[ i ].rfind( "." ) - vecstrInputs[ i ].rfind( "/" ) - 1 );
+			vecstrxInputs[ i ] = vecstrInputs[ i ].substr( vecstrInputs[ i ].rfind( "/" ) + 1, vecstrInputs[ i ].rfind( "." ) - vecstrInputs[ i ].rfind( "/" ) - 1 );}
+		else{
+			cerr << "inputs file types should be xdsl." <<  endl;
+			return 1;}}
 
 	vector<vector<float> >					vecPrior;
 	vector<vector<vector<float> > >			vecDataGSpZero;
 				vecDataGSpOne[ i ][ j ][ k ] = MatCPT.Get( k , 1 );}}
 		vecstrFiles.clear( );}
 
-	_mkdir( sArgs.directory_arg );
+	if( sArgs.learn_flag ){
 
-	vector<vector<string> >		vecvecstrInputs;
-	size_t						countstrInputs;
-	vecvecstrInputs.resize( vecvecSpDat.size( ) );
-	countstrInputs = 0;
-	for( i = 0; i < vecvecSpDat.size( ); ++i ){
-		vecvecstrInputs[ i ].resize( vecvecSpDat[ i ].size( ) ); 
-		for( j = 0; j < vecvecSpDat[ i ].size( ); ++j ){
-			vecvecstrInputs[ i ][ j ] =  ( string )sArgs.ndirectory_arg + '/' + vecstrxInputs[ i ] + '/' + vecvecSpDat[ i ][ j ] + c_acDab;
-			countstrInputs++;}}
+		_mkdir( sArgs.l0directory_arg );
+		_mkdir( sArgs.l1directory_arg );
+		_mkdir( sArgs.jdirectory_arg );
 
-	vector<string>				vecstrFInputs;
-	vector<string>				vecstrFDAInputs;
-	size_t						countstrFDAInputs;
-	vector<vector<size_t> >		InputMaps;
-	vecstrFInputs.resize( countstrInputs );
-	vecstrFDAInputs.resize( countstrInputs + vecvecstrInputs.size( ) );
-	countstrInputs = 0;
-	countstrFDAInputs = 0;
-	InputMaps.resize( vecvecstrInputs.size( ) );
-	for( i = 0; i < vecvecstrInputs.size( ); ++i ){
-		InputMaps[ i ].resize( vecvecstrInputs[ i ].size( ) );
-		for( j = 0; j < vecvecstrInputs[ i ].size( ); ++j ){
-			vecstrFInputs[ countstrInputs ] = vecvecstrInputs[ i ][ j ].c_str( );
-			vecstrFDAInputs[ countstrFDAInputs ] = vecvecstrInputs[ i ][ j ].c_str( );
-			countstrInputs++;
+		Threshold = ( sArgs.threshold_arg == -1 ) ? 0.5f : float( sArgs.threshold_arg );
+		
+		vector<vector<string> >		vecvecstrInputs;
+		size_t						countstrInputs;
+		vecvecstrInputs.resize( vecvecSpDat.size( ) );
+		countstrInputs = 0;
+		for( i = 0; i < vecvecSpDat.size( ); ++i ){
+			vecvecstrInputs[ i ].resize( vecvecSpDat[ i ].size( ) ); 
+			for( j = 0; j < vecvecSpDat[ i ].size( ); ++j ){
+				vecvecstrInputs[ i ][ j ] =  ( string )sArgs.ddirectory_arg + '/' + vecstrxInputs[ i ] + '/' + vecvecSpDat[ i ][ j ] + c_acDab;
+				countstrInputs++;}}
+		
+		vector<string>				vecstrFDAInputs;
+		size_t						countstrFDAInputs;
+		vecstrFDAInputs.resize( countstrInputs + vecvecstrInputs.size( ) );
+		countstrFDAInputs = 0;
+		for( i = 0; i < vecvecstrInputs.size( ); ++i ){
+			for( j = 0; j < vecvecstrInputs[ i ].size( ); ++j ){
+				vecstrFDAInputs[ countstrFDAInputs ] = vecvecstrInputs[ i ][ j ].c_str( );
+				countstrFDAInputs++;}
+			vecstrFDAInputs[ countstrFDAInputs ] = ( string )sArgs.adirectory_arg + '/' + vecstrxInputs[ i ] + c_acDab;
 			countstrFDAInputs++;}
-		vecstrFDAInputs[ countstrFDAInputs ] = ( string )sArgs.adirectory_arg + '/' + vecstrxInputs[ i ] + c_acDab;
-		countstrFDAInputs++;}
+		
+		vector<string>		vecstrFGenes;
+		{	CDataset	DataF;
 
-	vector<string>		vecstrFGenes;
-	{	CDataset	DataF;
+		DataF.OpenGenes( vecstrFDAInputs );
+		vecstrFGenes.resize( DataF.GetGenes( ) );
+		copy( DataF.GetGeneNames( ).begin( ), DataF.GetGeneNames( ).end( ), vecstrFGenes.begin( ) );}
+		
+		if( sArgs.genelist_flag ){
+			for( i = 0; i < vecstrFGenes.size( ); ++i )
+				cout << vecstrFGenes[ i ] << endl;
+			return 1;}
 
-	DataF.OpenGenes( vecstrFDAInputs );
-	vecstrFGenes.resize( DataF.GetGenes( ) );
-	copy( DataF.GetGeneNames( ).begin( ), DataF.GetGeneNames( ).end( ), vecstrFGenes.begin( ) );}
+		vector<CDat*>			DatOutB;
+		DatOutB.resize( vecvecstrInputs.size( ) );
+		for( i = 0; i < DatOutB.size( ); ++i ){
+			DatOutB[ i ] = new CDat( );
+			DatOutB[ i ]->Open( vecstrFGenes );}
 
-	if( sArgs.genelist_flag ){
-		for( i = 0; i < vecstrFGenes.size( ); ++i )
-			cout << vecstrFGenes[ i ] << endl;
-		return 1;}
+		vector<CDat*>		vecDataIntZero;
+		vector<CDat*>		vecDataIntOne;
+		vecDataIntZero.resize( vecvecstrInputs.size( ) );
+		vecDataIntOne.resize( vecvecstrInputs.size( ) );
+		for( i = 0; i < vecvecstrInputs.size( ); ++i ){
+			vecDataIntZero[ i ] = new CDat( );
+			vecDataIntOne[ i ] = new CDat( );
+			vecDataIntZero[ i ]->Open( vecstrFGenes );
+			vecDataIntOne[ i ]->Open( vecstrFGenes );}
+		
+		for( i = 0; i < vecvecstrInputs.size( ); ++i ){
+			map<string,size_t>::const_iterator	iterZero;
+			for( j = 0; j < vecvecstrInputs[ i ].size( ); ++j ){
+				iZero = ( ( iterZero = mapZeros.find( vecvecstrInputs[ i ][ j ] ) ) == mapZeros.end( ) ) ? -1 : iterZero->second;
 
-	vector<CDat*>			DatOutB;
-	DatOutB.resize( vecvecstrInputs.size( ) );
-	for( i = 0; i < DatOutB.size( ); ++i ){
-		DatOutB[ i ] = new CDat( );
-		DatOutB[ i ]->Open( vecstrFGenes );}
+				CDataPair		DataF;
+				if( !( DataF.Open( vecvecstrInputs[ i ][ j ].c_str( ), false, !!sArgs.memmap_flag ) ||
+					DataF.Open( vecvecstrInputs[ i ][ j ].c_str( ), true, !!sArgs.memmap_flag ) ) ){
+						cerr << "Could not open:" << vecvecstrInputs[ i ][ j ] << endl;
+						return 1;}
+				vector<size_t>		vecGeneIndex;
+				vecGeneIndex.resize( vecstrFGenes.size( ) );
+				for( k = 0; k < vecstrFGenes.size( ); ++k )
+					vecGeneIndex[ k ] = DataF.GetGene( vecstrFGenes[ k ] );
 
-	vector<CDat*>		vecDataIntZero;
-	vector<CDat*>		vecDataIntOne;
-	vecDataIntZero.resize( vecvecstrInputs.size( ) );
-	vecDataIntOne.resize( vecvecstrInputs.size( ) );
-	for( i = 0; i < vecvecstrInputs.size( ); ++i ){
-		vecDataIntZero[ i ] = new CDat( );
-		vecDataIntOne[ i ] = new CDat( );
-		vecDataIntZero[ i ]->Open( vecstrFGenes );
-		vecDataIntOne[ i ]->Open( vecstrFGenes );}
+				for( iDatOne = 0; iDatOne < vecstrFGenes.size( ); ++iDatOne ){ 
+					for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrFGenes.size( ); ++iDatTwo ){ 
+						iGeneOne = vecGeneIndex[ iDatOne ];
+						iGeneTwo = vecGeneIndex[ iDatTwo ];
+						float		DFValue;
+						DFValue = ( ( iGeneOne == -1 ) || ( iGeneTwo == -1 ) ) ? CMeta::GetNaN( ) : DataF.Get( iGeneOne, iGeneTwo );
+						if( !CMeta::IsNaN( DFValue ) ) {
+							size_t		DatPFI = DataF.Quantize( DFValue );
+							float		Zero, One;
 
-	for( i = 0; i < vecvecstrInputs.size( ); ++i ){
-		map<string,size_t>::const_iterator	iterZero;
-		for( j = 0; j < vecvecstrInputs[ i ].size( ); ++j ){
-			iZero = ( ( iterZero = mapZeros.find( vecvecstrInputs[ i ][ j ] ) ) == mapZeros.end( ) ) ? -1 : iterZero->second;
-			
-			CDataPair		DataF;
-			if( !( DataF.Open( vecvecstrInputs[ i ][ j ].c_str( ), false, !!sArgs.memmap_flag ) ||
-				DataF.Open( vecvecstrInputs[ i ][ j ].c_str( ), true, !!sArgs.memmap_flag ) ) ){
-					cerr << "Could not open:" << vecvecstrInputs[ i ][ j ] << endl;
-					return 1;}
-			vector<size_t>		vecGeneIndex;
-			vecGeneIndex.resize( vecstrFGenes.size( ) );
-			for( k = 0; k < vecstrFGenes.size( ); ++k )
-				vecGeneIndex[ k ] = DataF.GetGene( vecstrFGenes[ k ] );
-			
+							if( CMeta::IsNaN( Zero = vecDataIntZero[ i ]->Get( iDatOne, iDatTwo ) ) )
+								vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, log( vecDataGSpZero[ i ][ j ][ DatPFI ] ) );
+							else
+								vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, Zero + log( vecDataGSpZero[ i ][ j ][ DatPFI ] ) );
+
+							if( CMeta::IsNaN( One = vecDataIntOne[ i ]->Get( iDatOne, iDatTwo ) ) )
+								vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, log( vecDataGSpOne[ i ][ j ][ DatPFI ] ) );
+							else
+								vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, One + log( vecDataGSpOne[ i ][ j ][ DatPFI ] ) );}
+
+						if( CMeta::IsNaN( DFValue ) && ( iZero != -1 ) ){
+							float		Zero, One;
+
+							if( CMeta::IsNaN( Zero = vecDataIntZero[ i ]->Get( iDatOne, iDatTwo ) ) )
+								vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, log( vecDataGSpZero[ i ][ j ][ iZero ] ) );
+							else
+								vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, Zero + log( vecDataGSpZero[ i ][ j ][ iZero ] ) );
+
+							if( CMeta::IsNaN( One = vecDataIntOne[ i ]->Get( iDatOne, iDatTwo ) ) )
+								vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, log( vecDataGSpOne[ i ][ j ][ iZero ] ) );
+							else
+								vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, One + log( vecDataGSpOne[ i ][ j ][ iZero ] ) );}}}}
+
 			for( iDatOne = 0; iDatOne < vecstrFGenes.size( ); ++iDatOne ){ 
 				for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrFGenes.size( ); ++iDatTwo ){ 
-					iGeneOne = vecGeneIndex[ iDatOne ];
-					iGeneTwo = vecGeneIndex[ iDatTwo ];
-					float		DFValue;
-					DFValue = ( ( iGeneOne == -1 ) || ( iGeneTwo == -1 ) ) ? CMeta::GetNaN( ) : DataF.Get( iGeneOne, iGeneTwo );
-					if( !CMeta::IsNaN( DFValue ) ) {
-						size_t		DatPFI = DataF.Quantize( DFValue );
-						float		Zero, One;
+					float		sumOneB = 0, sumZeroB = 0, FinalB = 0 ;
+					float		Zero, One;
 
-						if( CMeta::IsNaN( Zero = vecDataIntZero[ i ]->Get( iDatOne, iDatTwo ) ) )
-							vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, log( vecDataGSpZero[ i ][ j ][ DatPFI ] ) );
-						else
-							vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, Zero + log( vecDataGSpZero[ i ][ j ][ DatPFI ] ) );
+					if( CMeta::IsNaN( Zero = vecDataIntZero[ i ]->Get( iDatOne, iDatTwo ) ) ){
+						vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, 0.0f);
+						sumZeroB =  log( vecPrior[ i ][ 0 ] );}
+					else 
+						sumZeroB =  Zero + log( vecPrior[ i ][ 0 ] );
 
-						if( CMeta::IsNaN( One = vecDataIntOne[ i ]->Get( iDatOne, iDatTwo ) ) )
-							vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, log( vecDataGSpOne[ i ][ j ][ DatPFI ] ) );
-						else
-							vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, One + log( vecDataGSpOne[ i ][ j ][ DatPFI ] ) );}
+					if( CMeta::IsNaN( One = vecDataIntOne[ i ]->Get( iDatOne, iDatTwo ) ) ){
+						vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, 0.0f );
+						sumOneB =  log( vecPrior[ i ][ 1 ] );}
+					else
+						sumOneB =  One + log( vecPrior[ i ][ 1 ] );
 
-					if( CMeta::IsNaN( DFValue ) && ( iZero != -1 ) ){
-						float		Zero, One;
-						
-						if( CMeta::IsNaN( Zero = vecDataIntZero[ i ]->Get( iDatOne, iDatTwo ) ) )
-							vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, log( vecDataGSpZero[ i ][ j ][ iZero ] ) );
-						else
-							vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, Zero + log( vecDataGSpZero[ i ][ j ][ iZero ] ) );
+					FinalB = (float) ( 1 / ( 1 + exp ( sumZeroB - sumOneB ) ) );
+					DatOutB[ i ]->Set( iDatOne, iDatTwo, FinalB );}}}
 
-						if( CMeta::IsNaN( One = vecDataIntOne[ i ]->Get( iDatOne, iDatTwo ) ) )
-							vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, log( vecDataGSpOne[ i ][ j ][ iZero ] ) );
-						else
-							vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, One + log( vecDataGSpOne[ i ][ j ][ iZero ] ) );}}}}
+		for( i = 0; i < vecvecstrInputs.size( ); ++i ){
+			DatOutB[ i ]->Save( ( ( string ) sArgs.odirectory_arg + '/' + vecstrxInputs[ i ] + 'b' + c_acDab ).c_str( ) );
+			vecDataIntZero[ i ]->Save( ( ( string ) sArgs.l0directory_arg + '/' + vecstrxInputs[ i ] + c_acDab ).c_str( ) );	
+			vecDataIntOne[ i ]->Save( ( ( string ) sArgs.l1directory_arg + '/' + vecstrxInputs[ i ] + c_acDab ).c_str( ) );}	
 
-		for( iDatOne = 0; iDatOne < vecstrFGenes.size( ); ++iDatOne ){ 
-			for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrFGenes.size( ); ++iDatTwo ){ 
-				float		sumOneB = 0, sumZeroB = 0, FinalB = 0 ;
-				float		Zero, One;
-				
-				if( CMeta::IsNaN( Zero = vecDataIntZero[ i ]->Get( iDatOne, iDatTwo ) ) ){
-					vecDataIntZero[ i ]->Set( iDatOne, iDatTwo, 0.0f);
-					sumZeroB =  log( vecPrior[ i ][ 0 ] );}
-				else 
-					sumZeroB =  Zero + log( vecPrior[ i ][ 0 ] );
+		vector<size_t>		MapstrGenes;	
+		if( sArgs.genex_arg ) {
+			CGenome				Genome;		
+			CGenes				GenesEx( Genome );
+			if( !GenesEx.Open( sArgs.genex_arg ) ) {
+				cerr << "Could not open: " << sArgs.genex_arg << endl;
+				return 1; } 
+			vecstrGenes.resize( vecstrFGenes.size( ) - GenesEx.GetGenes( ) );
+			MapstrGenes.resize( vecstrGenes.size( ) );
+			size_t		GenesExCount = 0;
+			for( i = 0; i < vecstrFGenes.size( ); ++i ){
+				if( !GenesEx.IsGene( vecstrFGenes[ i ] ) ){
+					vecstrGenes[ GenesExCount ] = vecstrFGenes[ i ];
+					MapstrGenes[ GenesExCount ] = i;
+					GenesExCount++;}}}
+		else{
+			vecstrGenes.resize( vecstrFGenes.size( ) );
+			MapstrGenes.resize( vecstrFGenes.size( ) );
+			for( i = 0; i < vecstrFGenes.size( ); ++i ){
+				vecstrGenes[ i ] = vecstrFGenes[ i ];
+				MapstrGenes[ i ] = i;}}
+		
+		CDat		DatOut00, DatOut01, DatOut10, DatOut11; 
+		DatOut00.Open( vecstrxInputs );
+		DatOut01.Open( vecstrxInputs );
+		DatOut10.Open( vecstrxInputs );
+		DatOut11.Open( vecstrxInputs );
 
-				if( CMeta::IsNaN( One = vecDataIntOne[ i ]->Get( iDatOne, iDatTwo ) ) ){
-					vecDataIntOne[ i ]->Set( iDatOne, iDatTwo, 0.0f );
-					sumOneB =  log( vecPrior[ i ][ 1 ] );}
-				else
-					sumOneB =  One + log( vecPrior[ i ][ 1 ] );
-								
-				FinalB = (float) ( 1 / ( 1 + exp ( sumZeroB - sumOneB ) ) );
-				DatOutB[ i ]->Set( iDatOne, iDatTwo, FinalB );}}}
+		if( sArgs.uniformjoint_flag ){
+			for( iDatOne = 0; iDatOne < vecstrInputs.size( ); ++iDatOne ){
+				for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrInputs.size( ); ++iDatTwo ){
+					for( i = 0; i < vecPrior[ iDatOne ].size( ); ++i ){
+						for( j = 0; j < vecPrior[ iDatTwo ].size( ); ++j ){
+							float	UnifProb = 1.0f / ( vecPrior[ iDatOne ].size( ) * vecPrior[ iDatTwo ].size( ) );
+							DatOut00.Set( iDatOne, iDatTwo, UnifProb );
+							DatOut01.Set( iDatOne, iDatTwo, UnifProb );
+							DatOut10.Set( iDatOne, iDatTwo, UnifProb );
+							DatOut11.Set( iDatOne, iDatTwo, UnifProb );}}}}}
+					
+		if( !sArgs.uniformjoint_flag ){
 
-	for( i = 0; i < vecvecstrInputs.size( ); ++i ){
-		DatOutB[ i ]->Save( ( ( string ) sArgs.directory_arg + '/' + vecstrxInputs[ i ] + 'b' + c_acDab ).c_str( ) );}	
-	
-	vector<size_t>		MapstrGenes;	
-	if( sArgs.genex_arg ) {
-		CGenome				Genome;		
-		CGenes				GenesEx( Genome );
-		if( !GenesEx.Open( sArgs.genex_arg ) ) {
-			cerr << "Could not open: " << sArgs.genex_arg << endl;
-			return 1; } 
-		vecstrGenes.resize( vecstrFGenes.size( ) - GenesEx.GetGenes( ) );
-		MapstrGenes.resize( vecstrGenes.size( ) );
-		size_t		GenesExCount = 0;
-		for( i = 0; i < vecstrFGenes.size( ); ++i ){
-			if( !GenesEx.IsGene( vecstrFGenes[ i ] ) ){
-				vecstrGenes[ GenesExCount ] = vecstrFGenes[ i ];
-				MapstrGenes[ GenesExCount ] = i;
-				GenesExCount++;}}}
-	else{
-		vecstrGenes.resize( vecstrFGenes.size( ) );
-		MapstrGenes.resize( vecstrFGenes.size( ) );
-		for( i = 0; i < vecstrFGenes.size( ); ++i ){
-			vecstrGenes[ i ] = vecstrFGenes[ i ];
-			MapstrGenes[ i ] = i;}}
+			for( iDatOne = 0; iDatOne < vecstrInputs.size( ); ++iDatOne ) {
+				if( ( iDatOne + 1 ) == vecstrInputs.size( ) )
+					break;
 
-	vector<vector<vector<vector<float> > > >		vec4OSpGSp;
-	vec4OSpGSp.resize( sArgs.inputs_num );
-	for( iDatOne = 0; iDatOne < vecstrInputs.size( ); ++iDatOne ) {
-		vec4OSpGSp[ iDatOne ].resize( sArgs.inputs_num );
-		for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrInputs.size( ); ++iDatTwo ) {
-			vec4OSpGSp[ iDatOne ][ iDatTwo ].resize( vecPrior[ iDatOne ].size( ) );
-			for( i = 0; i < vecPrior[ iDatOne ].size( ); ++i )
-				vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ].resize( vecPrior[ iDatTwo ].size( ) );}}
-
-	for( iDatOne = 0; iDatOne < vecstrInputs.size( ); ++iDatOne ) {
-		vec4OSpGSp[ iDatOne ].resize( sArgs.inputs_num );
-		for( iDatTwo = 0; iDatTwo < iDatOne; ++iDatTwo ) {
-			vec4OSpGSp[ iDatOne ][ iDatTwo ].resize( vecPrior[ iDatOne ].size( ) );
-			for( i = 0; i < vecPrior[ iDatOne ].size( ); ++i )
-				vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ].resize( vecPrior[ iDatTwo ].size( ) );}}
-
-	if( !sArgs.uniformjoint_flag && !sArgs.normaljoint_flag ){
-		
-		vector<float>		veciValueOnep;
-		vector<float>		veciValueTwop;
-
-		for( iDatOne = 0; iDatOne < vecstrInputs.size( ); ++iDatOne ) {
-			if( ( iDatOne + 1 ) == vecstrInputs.size( ) )
-				break;
-
-			veciGenesOneI.resize( vecstrGenes.size( ) );
-			CDataset	DataInd;
-			vector<string>				vecstrIndInputs;
-			vecstrIndInputs.resize( vecvecstrInputs[ iDatOne ].size( ) + 1 );
-			for( i = 0; i < vecvecstrInputs[ iDatOne ].size( ); ++i ){
-				vecstrIndInputs[ i ] = vecvecstrInputs[ iDatOne ][ i ].c_str( );}
-			vecstrIndInputs[ i ] = ( string )sArgs.adirectory_arg + '/' + vecstrxInputs[ iDatOne ] + c_acDab;
-			DataInd.OpenGenes( vecstrIndInputs );
-			for( i = 0; i < vecstrGenes.size( ); ++i )
-				veciGenesOneI[ i ] = DataInd.GetGene( vecstrGenes[ i ] );
-
-			for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrInputs.size( ); ++iDatTwo ) {
-				veciGenesTwoI.resize( vecstrGenes.size( ) );
+				veciGenesOneI.resize( vecstrGenes.size( ) );
 				CDataset	DataInd;
 				vector<string>				vecstrIndInputs;
-				vecstrIndInputs.resize( vecvecstrInputs[ iDatTwo ].size( ) + 1 );
-				for( i = 0; i < vecvecstrInputs[ iDatTwo ].size( ); ++i ){
-					vecstrIndInputs[ i ] = vecvecstrInputs[ iDatTwo ][ i ].c_str( );}
-				vecstrIndInputs[ i ] = ( string )sArgs.adirectory_arg + '/' + vecstrxInputs[ iDatTwo ] + c_acDab;
+				vecstrIndInputs.resize( vecvecstrInputs[ iDatOne ].size( ) + 1 );
+				for( i = 0; i < vecvecstrInputs[ iDatOne ].size( ); ++i ){
+					vecstrIndInputs[ i ] = vecvecstrInputs[ iDatOne ][ i ].c_str( );}
+				vecstrIndInputs[ i ] = ( string )sArgs.adirectory_arg + '/' + vecstrxInputs[ iDatOne ] + c_acDab;
 				DataInd.OpenGenes( vecstrIndInputs );
 				for( i = 0; i < vecstrGenes.size( ); ++i )
-					veciGenesTwoI[ i ] = DataInd.GetGene( vecstrGenes[ i ] );
+					veciGenesOneI[ i ] = DataInd.GetGene( vecstrGenes[ i ] );
 
-				vecveciJoint.resize( vecPrior[ iDatOne ].size( ) );
-				for( i = 0; i < vecveciJoint.size( ); ++i ) {
-					vecveciJoint[ i ].resize( vecPrior[ iDatTwo ].size( ) );
-					fill( vecveciJoint[ i ].begin( ), vecveciJoint[ i ].end( ), 0 ); }
+				for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrInputs.size( ); ++iDatTwo ) {
+					veciGenesTwoI.resize( vecstrGenes.size( ) );
+					CDataset	DataInd;
+					vector<string>				vecstrIndInputs;
+					vecstrIndInputs.resize( vecvecstrInputs[ iDatTwo ].size( ) + 1 );
+					for( i = 0; i < vecvecstrInputs[ iDatTwo ].size( ); ++i ){
+						vecstrIndInputs[ i ] = vecvecstrInputs[ iDatTwo ][ i ].c_str( );}
+					vecstrIndInputs[ i ] = ( string )sArgs.adirectory_arg + '/' + vecstrxInputs[ iDatTwo ] + c_acDab;
+					DataInd.OpenGenes( vecstrIndInputs );
+					for( i = 0; i < vecstrGenes.size( ); ++i )
+						veciGenesTwoI[ i ] = DataInd.GetGene( vecstrGenes[ i ] );
 
-				for( i = iCountJoint = 0; i < vecstrGenes.size( ); ++i ) {
-					if( ( veciGenesOneI[ i ] == -1 ) || ( veciGenesTwoI[ i ] == -1 ) )
-						continue;
+					vecveciJoint.resize( vecPrior[ iDatOne ].size( ) );
+					for( i = 0; i < vecveciJoint.size( ); ++i ) {
+						vecveciJoint[ i ].resize( vecPrior[ iDatTwo ].size( ) );
+						fill( vecveciJoint[ i ].begin( ), vecveciJoint[ i ].end( ), 0 ); }
 
-					for( j = ( i + 1 ); j < vecstrGenes.size( ); ++j ) {
-						if( ( veciGenesOneI[ j ] == -1 ) || ( veciGenesTwoI[ j ] == -1 ) )
+					for( i = iCountJoint = 0; i < vecstrGenes.size( ); ++i ) {
+						if( ( veciGenesOneI[ i ] == -1 ) || ( veciGenesTwoI[ i ] == -1 ) )
 							continue;
 
-						iValueOne = DatOutB[ iDatOne ]->Get( MapstrGenes[ i ], MapstrGenes[ j ] ) >= Threshold ? 1 : 0;
-						iValueTwo = DatOutB[ iDatTwo ]->Get( MapstrGenes[ i ], MapstrGenes[ j ] ) >= Threshold ? 1 : 0;
-						vecveciJoint[ iValueOne ][ iValueTwo ]++;
-						iCountJoint++;}}
+						for( j = ( i + 1 ); j < vecstrGenes.size( ); ++j ) {
+							if( ( veciGenesOneI[ j ] == -1 ) || ( veciGenesTwoI[ j ] == -1 ) )
+								continue;
 
-				for( i = 0; i < vecveciJoint.size( ); ++i ){
-					for( j = 0; j < vecveciJoint.size( ); ++j ){
-						vecveciJoint[ i ][ j ]++;
-						iCountJoint++;}}					
+							iValueOne = DatOutB[ iDatOne ]->Get( MapstrGenes[ i ], MapstrGenes[ j ] ) >= Threshold ? 1 : 0;
+							iValueTwo = DatOutB[ iDatTwo ]->Get( MapstrGenes[ i ], MapstrGenes[ j ] ) >= Threshold ? 1 : 0;
+							vecveciJoint[ iValueOne ][ iValueTwo ]++;
+							iCountJoint++;}}
 
-				vector<vector<float> >		vecveciTJoint;
-				vecveciTJoint.resize( vecveciJoint.size( ) );
-				for( i = 0; i < vecveciTJoint.size( ); ++i ){
-					vecveciTJoint[ i ].resize( vecveciJoint[ i ].size( ) );
-					for( j = 0; j < vecveciTJoint.size( ); ++j ){ 
-						vecveciTJoint[ i ][ j ] = ( (float)vecveciJoint[ i ][ j ] ) / iCountJoint;}}				
+					for( i = 0; i < vecveciJoint.size( ); ++i ){
+						for( j = 0; j < vecveciJoint.size( ); ++j ){
+							vecveciJoint[ i ][ j ]++;
+							iCountJoint++;}}					
+
+					vector<vector<float> >		vecveciTJoint;
+					vecveciTJoint.resize( vecveciJoint.size( ) );
+					for( i = 0; i < vecveciTJoint.size( ); ++i ){
+						vecveciTJoint[ i ].resize( vecveciJoint[ i ].size( ) );
+						for( j = 0; j < vecveciTJoint.size( ); ++j ){ 
+							vecveciTJoint[ i ][ j ] = ( (float)vecveciJoint[ i ][ j ] ) / iCountJoint;}}
+
+					DatOut00.Set( iDatOne, iDatTwo, vecveciTJoint[ 0 ][ 0 ] );
+					DatOut01.Set( iDatOne, iDatTwo, vecveciTJoint[ 0 ][ 1 ] );
+					DatOut10.Set( iDatOne, iDatTwo, vecveciTJoint[ 1 ][ 0 ] );
+					DatOut11.Set( iDatOne, iDatTwo, vecveciTJoint[ 1 ][ 1 ] );}}}
 				
-				veciValueOnep.resize( vecPrior[ iDatOne ].size( ) );
-				veciValueTwop.resize( vecPrior[ iDatTwo ].size( ) );
-				fill( veciValueOnep.begin( ), veciValueOnep.end( ), 0.0f );
-				fill( veciValueTwop.begin( ), veciValueTwop.end( ), 0.0f );
+		DatOut00.Save( ( ( string ) sArgs.jdirectory_arg + "/Learned00" + c_acDab ).c_str( ) );
+		DatOut01.Save( ( ( string ) sArgs.jdirectory_arg + "/Learned01" + c_acDab ).c_str( ) );	
+		DatOut10.Save( ( ( string ) sArgs.jdirectory_arg + "/Learned10" + c_acDab ).c_str( ) );
+		DatOut11.Save( ( ( string ) sArgs.jdirectory_arg + "/Learned11" + c_acDab ).c_str( ) );
+		
+		for( i = 0; i < vecvecstrInputs.size( ); ++i ){
+			delete DatOutB[ i ];
+			delete vecDataIntZero[ i ];	
+			delete vecDataIntOne[ i ];}
+		
+		return 1;}
+    
+	else{
 
-				for( i = 0; i < vecveciJoint.size( ); ++i ){
-					for( j = 0; j < vecveciJoint[ i ].size( ); ++j ){
-						veciValueOnep[ i ] += vecveciTJoint[ i ][ j ];
-						veciValueTwop[ j ] += vecveciTJoint[ i ][ j ];}} 
+		vector<string>		vecDataIntZero;
+		vector<string>		vecDataIntOne;
+		vecDataIntZero.resize( vecstrxInputs.size( ) );
+		vecDataIntOne.resize( vecstrxInputs.size( ) );
+		for( i = 0; i < vecstrxInputs.size( ); ++i ){
+			vecDataIntZero[ i ] = ( string )sArgs.l0directory_arg + '/' + vecstrxInputs[ i ] + c_acDab; 
+			vecDataIntOne[ i ] = ( string )sArgs.l1directory_arg + '/' + vecstrxInputs[ i ] + c_acDab;}
 
-				for( i = 0; i < vecveciJoint.size( ); ++i ){
-					for( j = 0; j < vecveciJoint[ i ].size(  ); ++j ){
-						vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ][ j ] = vecveciTJoint[ i ][ j ] / veciValueOnep[ i ];
-						vec4OSpGSp[ iDatTwo ][ iDatOne ][ i ][ j ] = vecveciTJoint[ j ][ i ] / veciValueTwop[ i ];}}}}}
+		vector<CDataPair*>			DataZero;
+		DataZero.resize( vecDataIntZero.size( ) );
+		for( i = 0; i < vecDataIntZero.size( ); ++i ){
+			DataZero[ i ] = new CDataPair( );
+			if( !( DataZero[ i ]->Open( vecDataIntZero[ i ].c_str( ), false, !!sArgs.memmap_flag ) ||
+				DataZero[ i ]->Open( vecDataIntZero[ i ].c_str( ), true, !!sArgs.memmap_flag ) ) ){
+					cerr << "Could not open:" << vecDataIntZero[ i ] << endl;
+					return 1;}}
+		
+		vector<CDataPair*>			DataOne;
+		DataOne.resize( vecDataIntOne.size( ) );
+		for( i = 0; i < vecDataIntOne.size( ); ++i ){
+			DataOne[ i ] = new CDataPair( );
+			if( !( DataOne[ i ]->Open( vecDataIntOne[ i ].c_str( ), false, !!sArgs.memmap_flag ) ||
+				DataOne[ i ]->Open( vecDataIntOne[ i ].c_str( ), true, !!sArgs.memmap_flag ) ) ){
+					cerr << "Could not open:" << vecDataIntOne[ i ] << endl;
+					return 1;}}
 
-	if( sArgs.uniformjoint_flag ){
-		for( iDatOne = 0; iDatOne < vec4OSpGSp.size( ); ++iDatOne )
-			for( iDatTwo = 0; iDatTwo < vec4OSpGSp[ iDatOne ].size( ); ++iDatTwo ){
-				if( iDatOne == iDatTwo )
+		vector<string>		vecstrFGenes;
+		{	CDataset	DataF;
+
+		DataF.OpenGenes( vecDataIntZero );
+		vecstrFGenes.resize( DataF.GetGenes( ) );
+		copy( DataF.GetGeneNames( ).begin( ), DataF.GetGeneNames( ).end( ), vecstrFGenes.begin( ) );}
+
+		vector<vector<vector<vector<float> > > >		vec4OSpGSp;
+		size_t			JointDim = vecPrior[ 0 ].size( );
+
+		vector<vector<string> >		VecLearnedNames;
+		VecLearnedNames.resize( JointDim );
+		VecLearnedNames[ 0 ].resize( JointDim );
+		VecLearnedNames[ 1 ].resize( JointDim );
+		VecLearnedNames[ 0 ][ 0 ] = "Learned00";
+		VecLearnedNames[ 0 ][ 1 ] = "Learned01";
+		VecLearnedNames[ 1 ][ 0 ] = "Learned10";
+		VecLearnedNames[ 1 ][ 1 ] = "Learned11";
+
+		vec4OSpGSp.resize( vecstrxInputs.size( ) );
+		for( iDatOne = 0; iDatOne < vecstrxInputs.size( ); ++iDatOne ) {
+			vec4OSpGSp[ iDatOne ].resize( vecstrxInputs.size( ) );
+			for( iDatTwo = 0; iDatTwo < vecstrxInputs.size( ); ++iDatTwo ) {
+				if( iDatTwo == iDatOne )
 					continue;
-				for( i = 0; i < vec4OSpGSp[ iDatOne ][ iDatTwo ].size( ); ++i )
-					for( j = 0; j < vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ].size( ); ++j )
-						vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ][ j ] = 0.5f;}}
+				vec4OSpGSp[ iDatOne ][ iDatTwo ].resize( JointDim );
+				for( i = 0; i < JointDim; ++i ){
+					vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ].resize( JointDim );}}}
+	
+	for( i = 0; i < JointDim; ++i ){
+		for( j = 0; j < JointDim; ++j ){
+			CDataPair		DataF;
+			string			JointFile = ( string )sArgs.jdirectory_arg + VecLearnedNames[ i ][ j ] + c_acDab; 
+			if( !( DataF.Open( JointFile.c_str( ), false, !!sArgs.memmap_flag ) ||
+					DataF.Open( JointFile.c_str( ), true, !!sArgs.memmap_flag ) ) ){
+						cerr << "Could not open:" << JointFile << endl;
+						return 1;}
 
-	if( sArgs.normaljoint_flag ){
+			vector<size_t>	veciSpecies;
+			veciSpecies.resize( vecstrxInputs.size( ) );
+			for( k = 0; k < vecstrxInputs.size( ); ++k )
+				veciSpecies[ k ] = DataF.GetGene( vecstrxInputs[ k ] );
+			
+			for( iDatOne = 0; iDatOne < vecstrxInputs.size( ); ++iDatOne ) {
+				for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrxInputs.size( ); ++iDatTwo ) {
+					vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ][ j ] = DataF.Get( veciSpecies[ iDatOne ], veciSpecies[ iDatTwo ] );
+					vec4OSpGSp[ iDatTwo ][ iDatOne ][ j ][ i ] = DataF.Get( veciSpecies[ iDatOne ], veciSpecies[ iDatTwo ] );}}}}
+	
+    vector<float>		veciValueOnep;
+	vector<float>		veciValueTwop;
 
-		vector<float>		veciValueOnep;
-		vector<float>		veciValueTwop;
-		vector<vector<float> >		vecveciJoint;
-		float				iCountJoint;
+	for( iDatOne = 0; iDatOne < vecstrxInputs.size( ); ++iDatOne ) {
+		for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrxInputs.size( ); ++iDatTwo ) {
+			
+			veciValueOnep.resize( JointDim );
+			veciValueTwop.resize( JointDim );
 
-		for( iDatOne = 0; iDatOne < vec4OSpGSp.size( ); ++iDatOne )
-			for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vec4OSpGSp[ iDatOne ].size( ); ++iDatTwo ){
-				if( iDatOne == iDatTwo )
-					continue;
-				vecveciJoint.resize( vecPrior[ iDatOne ].size( ) );
-				iCountJoint = 0;
-				for( i = 0; i < vecveciJoint.size( ); ++i ){
-					vecveciJoint[ i ].resize( vecPrior[ iDatTwo ].size( ) );
-					for( j = 0; j < vecveciJoint[ i ].size( ); ++j ){
-						vecveciJoint[ i ][ j ] = ( float )rand( ) / RAND_MAX;
-						iCountJoint += vecveciJoint[ i ][ j ];}}
-				
-				for( i = 0; i < vecveciJoint.size( ); ++i ){
-					for( j = 0; j < vecveciJoint.size( ); ++j ){
-						vecveciJoint[ i ][ j ]++;
-						iCountJoint++;}}					
+			fill( veciValueOnep.begin( ), veciValueOnep.end( ), 0.0f );
+			fill( veciValueTwop.begin( ), veciValueTwop.end( ), 0.0f );
 
-				vector<vector<float> >		vecveciTJoint;
-				vecveciTJoint.resize( vecveciJoint.size( ) );
-				for( i = 0; i < vecveciTJoint.size( ); ++i ){
-					vecveciTJoint[ i ].resize( vecveciJoint[ i ].size( ) );
-					for( j = 0; j < vecveciTJoint.size( ); ++j ){ 
-						vecveciTJoint[ i ][ j ] = ( (float)vecveciJoint[ i ][ j ] ) / iCountJoint;}}				
-				
-				veciValueOnep.resize( vecPrior[ iDatOne ].size( ) );
-				veciValueTwop.resize( vecPrior[ iDatTwo ].size( ) );
-				fill( veciValueOnep.begin( ), veciValueOnep.end( ), 0.0f );
-				fill( veciValueTwop.begin( ), veciValueTwop.end( ), 0.0f );
+			for( i = 0; i < JointDim; ++i ){
+				for( j = 0; j < JointDim; ++j ){
+					veciValueOnep[ i ] += vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ][ j ];
+					veciValueTwop[ j ] += vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ][ j ];}}
 
-				for( i = 0; i < vecveciJoint.size( ); ++i ){
-					for( j = 0; j < vecveciJoint[ i ].size( ); ++j ){
-						veciValueOnep[ i ] += vecveciTJoint[ i ][ j ];
-						veciValueTwop[ j ] += vecveciTJoint[ i ][ j ];}} 
-
-				for( i = 0; i < vecveciJoint.size( ); ++i ){
-					for( j = 0; j < vecveciJoint[ i ].size(  ); ++j ){
-						vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ][ j ] = vecveciTJoint[ i ][ j ] / veciValueOnep[ i ];
-						vec4OSpGSp[ iDatTwo ][ iDatOne ][ i ][ j ] = vecveciTJoint[ j ][ i ] / veciValueTwop[ i ];}}}}
+			for( i = 0; i < JointDim; ++i ){
+				for( j = 0; j < JointDim; ++j ){
+					vec4OSpGSp[ iDatOne ][ iDatTwo ][ i ][ j ] /= veciValueOnep[ i ];
+					vec4OSpGSp[ iDatTwo ][ iDatOne ][ i ][ j ] /= veciValueTwop[ i ];}}}}
+    
+	vector<CDat*>			DatOutCS;
 	
-	vector<CDat*>			DatOutCS;
-
-	DatOutCS.resize( vecvecstrInputs.size( ) );
+	DatOutCS.resize( vecstrxInputs.size( ) );
 	for( i = 0; i < DatOutCS.size( ); ++i ){
 		DatOutCS[ i ] = new CDat( );
 		DatOutCS[ i ]->Open( vecstrFGenes );}
-	
+
+	vector<vector<size_t> >		veciGenesOne, veciGenesZero;
+	veciGenesOne.resize( vecDataIntOne.size( ) );
+	veciGenesZero.resize( vecDataIntZero.size( ) );
+	for( i = 0; i < vecstrxInputs.size( ); ++i ){
+		veciGenesOne[ i ].resize( vecstrFGenes.size( ) );
+		veciGenesZero[ i ].resize( vecstrFGenes.size( ) );
+		for( j = 0; j < vecstrFGenes.size( ); ++j ){
+			veciGenesOne[ i ][ j ] = DataOne[ i ]->GetGene( vecstrFGenes[ j ] );
+			veciGenesZero[ i ][ j ] = DataZero[ i ]->GetGene( vecstrFGenes[ j ] );}}
+
 	if( !sArgs.holdout_flag ){
-		for( i = 0; i < vecvecstrInputs.size( ); ++i ){
+		for( i = 0; i < vecstrxInputs.size( ); ++i ){
 			for( iDatOne = 0; iDatOne < vecstrFGenes.size( ); ++iDatOne ){ 
 				for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrFGenes.size( ); ++iDatTwo ){ 
 					float		sumOne = 0, sumZero = 0, Final = 0 ;
-					for( k = 0; k < vecvecstrInputs.size( ); ++k ){
+					for( k = 0; k < vecstrxInputs.size( ); ++k ){
 						if( k != i ){
-							sumOne += log( exp( log( vec4OSpGSp[ i ][ k ][ 1 ][ 0 ] ) + vecDataIntZero[ k ]->Get( iDatOne, iDatTwo ) ) + exp( log( vec4OSpGSp[ i ][ k ][ 1 ][ 1 ] ) + vecDataIntOne[ k ]->Get( iDatOne, iDatTwo ) ) );
-							sumZero += log( exp( log( vec4OSpGSp[ i ][ k ][ 0 ][ 0 ] ) + vecDataIntZero[ k ]->Get( iDatOne, iDatTwo ) ) + exp( log( vec4OSpGSp[ i ][ k ][ 0 ][ 1 ] ) + vecDataIntOne[ k ]->Get( iDatOne, iDatTwo ) ) );}}
-					sumOne += ( vecDataIntOne[ i ]->Get( iDatOne, iDatTwo ) + log( vecPrior[ i ][ 1 ] ) );
-					sumZero += ( vecDataIntZero[ i ]->Get( iDatOne, iDatTwo ) + log( vecPrior[ i ][ 0 ] ) );
+							sumOne += log( exp( log( vec4OSpGSp[ i ][ k ][ 1 ][ 0 ] ) + DataZero[ k ]->Get( veciGenesZero[ k ][ iDatOne ], veciGenesZero[ k ][ iDatTwo ] ) ) + exp( log( vec4OSpGSp[ i ][ k ][ 1 ][ 1 ] ) + DataOne[ k ]->Get( veciGenesOne[ k ][ iDatOne ], veciGenesOne[ k ][ iDatTwo ] ) ) );
+							sumZero += log( exp( log( vec4OSpGSp[ i ][ k ][ 0 ][ 0 ] ) + DataZero[ k ]->Get( veciGenesZero[ k ][ iDatOne ], veciGenesZero[ k ][ iDatTwo ] ) ) + exp( log( vec4OSpGSp[ i ][ k ][ 0 ][ 1 ] ) + DataOne[ k ]->Get( veciGenesOne[ k ][ iDatOne ], veciGenesOne[ k ][ iDatTwo ] ) ) );}}
+					sumOne += ( DataOne[ i ]->Get( veciGenesOne[ i ][ iDatOne ], veciGenesOne[ i ][ iDatTwo ] ) + log( vecPrior[ i ][ 1 ] ) );
+					sumZero += ( DataZero[ i ]->Get( veciGenesZero[ i ][ iDatOne ], veciGenesZero[ i ][ iDatTwo ] ) + log( vecPrior[ i ][ 0 ] ) );
 					Final = (float) ( 1 / ( 1 + exp ( sumZero - sumOne ) ) );
 					DatOutCS[ i ]->Set( iDatOne, iDatTwo, Final );}}}}
 
 	else{
-		for( i = 0; i < vecvecstrInputs.size( ); ++i ){
+		for( i = 0; i < vecstrxInputs.size( ); ++i ){
 			for( iDatOne = 0; iDatOne < vecstrFGenes.size( ); ++iDatOne ){ 
 				for( iDatTwo = ( iDatOne + 1 ); iDatTwo < vecstrFGenes.size( ); ++iDatTwo ){ 
 					float		sumOne = 0, sumZero = 0, Final = 0 ;
-					for( k = 0; k < vecvecstrInputs.size( ); ++k ){
+					for( k = 0; k < vecstrxInputs.size( ); ++k ){
 						if( k != i ){
-							sumOne += log( exp( log( vec4OSpGSp[ i ][ k ][ 1 ][ 0 ] ) + vecDataIntZero[ k ]->Get( iDatOne, iDatTwo ) ) + exp( log( vec4OSpGSp[ i ][ k ][ 1 ][ 1 ] ) + vecDataIntOne[ k ]->Get( iDatOne, iDatTwo ) ) );
-							sumZero += log( exp( log( vec4OSpGSp[ i ][ k ][ 0 ][ 0 ] ) + vecDataIntZero[ k ]->Get( iDatOne, iDatTwo ) ) + exp( log( vec4OSpGSp[ i ][ k ][ 0 ][ 1 ] ) + vecDataIntOne[ k ]->Get( iDatOne, iDatTwo ) ) );}}
+							sumOne += log( exp( log( vec4OSpGSp[ i ][ k ][ 1 ][ 0 ] ) + DataZero[ k ]->Get( veciGenesZero[ k ][ iDatOne ], veciGenesZero[ k ][ iDatTwo ] ) ) + exp( log( vec4OSpGSp[ i ][ k ][ 1 ][ 1 ] ) + DataOne[ k ]->Get( veciGenesOne[ k ][ iDatOne ], veciGenesOne[ k ][ iDatTwo ] ) ) );
+							sumZero += log( exp( log( vec4OSpGSp[ i ][ k ][ 0 ][ 0 ] ) + DataZero[ k ]->Get( veciGenesZero[ k ][ iDatOne ], veciGenesZero[ k ][ iDatTwo ] ) ) + exp( log( vec4OSpGSp[ i ][ k ][ 0 ][ 1 ] ) + DataOne[ k ]->Get( veciGenesOne[ k ][ iDatOne ], veciGenesOne[ k ][ iDatTwo ] ) ) );}}
 					sumOne += log( vecPrior[ i ][ 1 ] );
 					sumZero += log( vecPrior[ i ][ 0 ] );
 					Final = (float) ( 1 / ( 1 + exp ( sumZero - sumOne ) ) );
 					DatOutCS[ i ]->Set( iDatOne, iDatTwo, Final );}}}}
 	
-	for( i = 0; i < vecvecstrInputs.size( ); ++i ){
-		DatOutCS[ i ]->Save( ( ( string ) sArgs.directory_arg + '/' + vecstrxInputs[ i ] + c_acDab ).c_str( ) );
-		delete DatOutB[ i ];
-		delete DatOutCS[ i ];}	
+	for( i = 0; i < vecstrxInputs.size( ); ++i ){
+		DatOutCS[ i ]->Save( ( ( string ) sArgs.odirectory_arg + '/' + vecstrxInputs[ i ] + c_acDab ).c_str( ) );
+		delete DatOutCS[ i ];
+		delete DataOne[ i ];
+		delete DataZero[ i ];}}
 
 	return 0;} 

tools/SpeciesConnector/SpeciesConnector.ggo

 purpose	"Cross species connection calculator."
 
 section "Main"
+option	"ddirectory" d	"Data directory"
+						string	typestr="directory"	default="."
 option	"adirectory" w	"Answer directory"
 						string	typestr="directory"	default="."
-option	"ndirectory" n	"Input directory"
+option	"odirectory"	o	"Output directory"
+						string	typestr="directory"	default="."						
+option	"jdirectory"	p	"Learned joint directory"
+						string	typestr="directory"	default="."						
+option	"l1directory"	j	"Likelihood wrt 1 directory"
 						string	typestr="directory"	default="."
-option	"directory"	d	"Output directory"
-						string	typestr="directory"	default="."
+option	"l0directory"	k	"Likelihood wrt 0 directory"
+						string	typestr="directory"	default="."					
+
+section "Stage: Learn/Prediction"						
+option	"learn"	L	"Learn flag"
+						flag	off												
 
 section "Network Features"
 option	"zeros"		Z	"Read zeroed node IDs/outputs from the given file"
 						string	typestr="filename"
 
 section "Optional"
-option	"genex"		G	"Gene exclusion file"
-						string	typestr="filename"
 option	"memmap"	m	"Memory map input/output"
 						flag	off
 option	"random"	r	"Seed random generator"
 						int	default="0"
 option	"verbosity"	v	"Message verbosity"
 						int	default="5"
-option	"holdout"	h	"Holdout target dataset"
-						flag	off	
+option	"genex"		G	"Gene exclusion file"
+						string	typestr="filename"
 option	"genelist"	l	"Print gene list on the screen"
-						flag	off			
+						flag	off
 option	"uniformjoint"		u	"Uniform joint distribution"
 								flag	off
-option	"normaljoint"		g	"Normal joint distribution"
-								flag	off
 option	"threshold"	t	"Threshold for joint"
-						float	default="0.5"
+						float	default="0.5"						
+option	"holdout"	h	"Holdout target dataset"
+						flag	off			

tools/SpeciesConnector/cmdline.c

 const char *gengetopt_args_info_description = "";
 
 const char *gengetopt_args_info_help[] = {
-  "      --help                  Print help and exit",
-  "  -V, --version               Print version and exit",
+  "      --help                   Print help and exit",
+  "  -V, --version                Print version and exit",
   "\nMain:",
-  "  -w, --adirectory=directory  Answer directory  (default=`.')",
-  "  -n, --ndirectory=directory  Input directory  (default=`.')",
-  "  -d, --directory=directory   Output directory  (default=`.')",
+  "  -d, --ddirectory=directory   Data directory  (default=`.')",
+  "  -w, --adirectory=directory   Answer directory  (default=`.')",
+  "  -o, --odirectory=directory   Output directory  (default=`.')",
+  "  -p, --jdirectory=directory   Learned joint directory  (default=`.')",
+  "  -j, --l1directory=directory  Likelihood wrt 1 directory  (default=`.')",
+  "  -k, --l0directory=directory  Likelihood wrt 0 directory  (default=`.')",
+  "\nStage: Learn/Prediction:",
+  "  -L, --learn                  Learn flag  (default=off)",
   "\nNetwork Features:",
-  "  -Z, --zeros=filename        Read zeroed node IDs/outputs from the given file",
+  "  -Z, --zeros=filename         Read zeroed node IDs/outputs from the given file",
   "\nOptional:",
-  "  -G, --genex=filename        Gene exclusion file",
-  "  -m, --memmap                Memory map input/output  (default=off)",
-  "  -r, --random=INT            Seed random generator  (default=`0')",
-  "  -v, --verbosity=INT         Message verbosity  (default=`5')",
-  "  -h, --holdout               Holdout target dataset  (default=off)",
-  "  -l, --genelist              Print gene list on the screen  (default=off)",
-  "  -u, --uniformjoint          Uniform joint distribution  (default=off)",
-  "  -g, --normaljoint           Normal joint distribution  (default=off)",
-  "  -t, --threshold=FLOAT       Threshold for joint  (default=`0.5')",
+  "  -m, --memmap                 Memory map input/output  (default=off)",
+  "  -r, --random=INT             Seed random generator  (default=`0')",
+  "  -v, --verbosity=INT          Message verbosity  (default=`5')",
+  "  -G, --genex=filename         Gene exclusion file",
+  "  -l, --genelist               Print gene list on the screen  (default=off)",
+  "  -u, --uniformjoint           Uniform joint distribution  (default=off)",
+  "  -t, --threshold=FLOAT        Threshold for joint  (default=`0.5')",
+  "  -h, --holdout                Holdout target dataset  (default=off)",
     0
 };
 
 {
   args_info->help_given = 0 ;
   args_info->version_given = 0 ;
+  args_info->ddirectory_given = 0 ;
   args_info->adirectory_given = 0 ;
-  args_info->ndirectory_given = 0 ;
-  args_info->directory_given = 0 ;
+  args_info->odirectory_given = 0 ;
+  args_info->jdirectory_given = 0 ;
+  args_info->l1directory_given = 0 ;
+  args_info->l0directory_given = 0 ;
+  args_info->learn_given = 0 ;
   args_info->zeros_given = 0 ;
-  args_info->genex_given = 0 ;
   args_info->memmap_given = 0 ;
   args_info->random_given = 0 ;
   args_info->verbosity_given = 0 ;
-  args_info->holdout_given = 0 ;
+  args_info->genex_given = 0 ;
   args_info->genelist_given = 0 ;
   args_info->uniformjoint_given = 0 ;
-  args_info->normaljoint_given = 0 ;
   args_info->threshold_given = 0 ;
+  args_info->holdout_given = 0 ;
 }
 
 static
 void clear_args (struct gengetopt_args_info *args_info)
 {
+  args_info->ddirectory_arg = gengetopt_strdup (".");
+  args_info->ddirectory_orig = NULL;
   args_info->adirectory_arg = gengetopt_strdup (".");
   args_info->adirectory_orig = NULL;
-  args_info->ndirectory_arg = gengetopt_strdup (".");
-  args_info->ndirectory_orig = NULL;
-  args_info->directory_arg = gengetopt_strdup (".");
-  args_info->directory_orig = NULL;
+  args_info->odirectory_arg = gengetopt_strdup (".");
+  args_info->odirectory_orig = NULL;
+  args_info->jdirectory_arg = gengetopt_strdup (".");
+  args_info->jdirectory_orig = NULL;
+  args_info->l1directory_arg = gengetopt_strdup (".");
+  args_info->l1directory_orig = NULL;
+  args_info->l0directory_arg = gengetopt_strdup (".");
+  args_info->l0directory_orig = NULL;
+  args_info->learn_flag = 0;
   args_info->zeros_arg = NULL;
   args_info->zeros_orig = NULL;
-  args_info->genex_arg = NULL;
-  args_info->genex_orig = NULL;
   args_info->memmap_flag = 0;
   args_info->random_arg = 0;
   args_info->random_orig = NULL;
   args_info->verbosity_arg = 5;
   args_info->verbosity_orig = NULL;
-  args_info->holdout_flag = 0;
+  args_info->genex_arg = NULL;
+  args_info->genex_orig = NULL;
   args_info->genelist_flag = 0;
   args_info->uniformjoint_flag = 0;
-  args_info->normaljoint_flag = 0;
   args_info->threshold_arg = 0.5;
   args_info->threshold_orig = NULL;
+  args_info->holdout_flag = 0;
   
 }
 
 
   args_info->help_help = gengetopt_args_info_help[0] ;
   args_info->version_help = gengetopt_args_info_help[1] ;
-  args_info->adirectory_help = gengetopt_args_info_help[3] ;
-  args_info->ndirectory_help = gengetopt_args_info_help[4] ;
-  args_info->directory_help = gengetopt_args_info_help[5] ;
-  args_info->zeros_help = gengetopt_args_info_help[7] ;
-  args_info->genex_help = gengetopt_args_info_help[9] ;
-  args_info->memmap_help = gengetopt_args_info_help[10] ;
-  args_info->random_help = gengetopt_args_info_help[11] ;
-  args_info->verbosity_help = gengetopt_args_info_help[12] ;
-  args_info->holdout_help = gengetopt_args_info_help[13] ;
-  args_info->genelist_help = gengetopt_args_info_help[14] ;
-  args_info->uniformjoint_help = gengetopt_args_info_help[15] ;
-  args_info->normaljoint_help = gengetopt_args_info_help[16] ;
-  args_info->threshold_help = gengetopt_args_info_help[17] ;
+  args_info->ddirectory_help = gengetopt_args_info_help[3] ;
+  args_info->adirectory_help = gengetopt_args_info_help[4] ;
+  args_info->odirectory_help = gengetopt_args_info_help[5] ;
+  args_info->jdirectory_help = gengetopt_args_info_help[6] ;
+  args_info->l1directory_help = gengetopt_args_info_help[7] ;
+  args_info->l0directory_help = gengetopt_args_info_help[8] ;
+  args_info->learn_help = gengetopt_args_info_help[10] ;
+  args_info->zeros_help = gengetopt_args_info_help[12] ;
+  args_info->memmap_help = gengetopt_args_info_help[14] ;
+  args_info->random_help = gengetopt_args_info_help[15] ;
+  args_info->verbosity_help = gengetopt_args_info_help[16] ;
+  args_info->genex_help = gengetopt_args_info_help[17] ;
+  args_info->genelist_help = gengetopt_args_info_help[18] ;
+  args_info->uniformjoint_help = gengetopt_args_info_help[19] ;
+  args_info->threshold_help = gengetopt_args_info_help[20] ;
+  args_info->holdout_help = gengetopt_args_info_help[21] ;
   
 }
 
 cmdline_parser_release (struct gengetopt_args_info *args_info)
 {
   unsigned int i;
+  free_string_field (&(args_info->ddirectory_arg));
+  free_string_field (&(args_info->ddirectory_orig));
   free_string_field (&(args_info->adirectory_arg));
   free_string_field (&(args_info->adirectory_orig));
-  free_string_field (&(args_info->ndirectory_arg));
-  free_string_field (&(args_info->ndirectory_orig));
-  free_string_field (&(args_info->directory_arg));
-  free_string_field (&(args_info->directory_orig));
+  free_string_field (&(args_info->odirectory_arg));
+  free_string_field (&(args_info->odirectory_orig));
+  free_string_field (&(args_info->jdirectory_arg));
+  free_string_field (&(args_info->jdirectory_orig));
+  free_string_field (&(args_info->l1directory_arg));
+  free_string_field (&(args_info->l1directory_orig));
+  free_string_field (&(args_info->l0directory_arg));
+  free_string_field (&(args_info->l0directory_orig));
   free_string_field (&(args_info->zeros_arg));
   free_string_field (&(args_info->zeros_orig));
+  free_string_field (&(args_info->random_orig));
+  free_string_field (&(args_info->verbosity_orig));
   free_string_field (&(args_info->genex_arg));
   free_string_field (&(args_info->genex_orig));
-  free_string_field (&(args_info->random_orig));
-  free_string_field (&(args_info->verbosity_orig));
   free_string_field (&(args_info->threshold_orig));
   
   
     write_into_file(outfile, "help", 0, 0 );
   if (args_info->version_given)
     write_into_file(outfile, "version", 0, 0 );
+  if (args_info->ddirectory_given)
+    write_into_file(outfile, "ddirectory", args_info->ddirectory_orig, 0);
   if (args_info->adirectory_given)
     write_into_file(outfile, "adirectory", args_info->adirectory_orig, 0);
-  if (args_info->ndirectory_given)
-    write_into_file(outfile, "ndirectory", args_info->ndirectory_orig, 0);
-  if (args_info->directory_given)
-    write_into_file(outfile, "directory", args_info->directory_orig, 0);
+  if (args_info->odirectory_given)
+    write_into_file(outfile, "odirectory", args_info->odirectory_orig, 0);
+  if (args_info->jdirectory_given)
+    write_into_file(outfile, "jdirectory", args_info->jdirectory_orig, 0);
+  if (args_info->l1directory_given)
+    write_into_file(outfile, "l1directory", args_info->l1directory_orig, 0);
+  if (args_info->l0directory_given)
+    write_into_file(outfile, "l0directory", args_info->l0directory_orig, 0);
+  if (args_info->learn_given)
+    write_into_file(outfile, "learn", 0, 0 );
   if (args_info->zeros_given)
     write_into_file(outfile, "zeros", args_info->zeros_orig, 0);
-  if (args_info->genex_given)
-    write_into_file(outfile, "genex", args_info->genex_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->verbosity_given)
     write_into_file(outfile, "verbosity", args_info->verbosity_orig, 0);
-  if (args_info->holdout_given)
-    write_into_file(outfile, "holdout", 0, 0 );
+  if (args_info->genex_given)
+    write_into_file(outfile, "genex", args_info->genex_orig, 0);
   if (args_info->genelist_given)
     write_into_file(outfile, "genelist", 0, 0 );
   if (args_info->uniformjoint_given)
     write_into_file(outfile, "uniformjoint", 0, 0 );
-  if (args_info->normaljoint_given)
-    write_into_file(outfile, "normaljoint", 0, 0 );
   if (args_info->threshold_given)
     write_into_file(outfile, "threshold", args_info->threshold_orig, 0);
+  if (args_info->holdout_given)
+    write_into_file(outfile, "holdout", 0, 0 );
   
 
   i = EXIT_SUCCESS;
       static struct option long_options[] = {
         { "help",	0, NULL, 0 },
         { "version",	0, NULL, 'V' },
+        { "ddirectory",	1, NULL, 'd' },
         { "adirectory",	1, NULL, 'w' },
-        { "ndirectory",	1, NULL, 'n' },
-        { "directory",	1, NULL, 'd' },
+        { "odirectory",	1, NULL, 'o' },
+        { "jdirectory",	1, NULL, 'p' },
+        { "l1directory",	1, NULL, 'j' },
+        { "l0directory",	1, NULL, 'k' },
+        { "learn",	0, NULL, 'L' },
         { "zeros",	1, NULL, 'Z' },
-        { "genex",	1, NULL, 'G' },
         { "memmap",	0, NULL, 'm' },
         { "random",	1, NULL, 'r' },
         { "verbosity",	1, NULL, 'v' },
-        { "holdout",	0, NULL, 'h' },
+        { "genex",	1, NULL, 'G' },
         { "genelist",	0, NULL, 'l' },
         { "uniformjoint",	0, NULL, 'u' },
-        { "normaljoint",	0, NULL, 'g' },
         { "threshold",	1, NULL, 't' },
+        { "holdout",	0, NULL, 'h' },
         { NULL,	0, NULL, 0 }
       };
 
-      c = getopt_long (argc, argv, "Vw:n:d:Z:G:mr:v:hlugt:", long_options, &option_index);
+      c = getopt_long (argc, argv, "Vd:w:o:p:j:k:LZ:mr:v:G:lut:h", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
           return 0;
         
           break;
+        case 'd':	/* Data directory.  */
+        
+        
+          if (update_arg( (void *)&(args_info->ddirectory_arg), 
+               &(args_info->ddirectory_orig), &(args_info->ddirectory_given),
+              &(local_args_info.ddirectory_given), optarg, 0, ".", ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "ddirectory", 'd',
+              additional_error))
+            goto failure;
+        
+          break;
         case 'w':	/* Answer directory.  */
         
         
             goto failure;
         
           break;
-        case 'n':	/* Input directory.  */
+        case 'o':	/* Output directory.  */
         
         
-          if (update_arg( (void *)&(args_info->ndirectory_arg), 
-               &(args_info->ndirectory_orig), &(args_info->ndirectory_given),
-              &(local_args_info.ndirectory_given), optarg, 0, ".", ARG_STRING,
+          if (update_arg( (void *)&(args_info->odirectory_arg), 
+               &(args_info->odirectory_orig), &(args_info->odirectory_given),
+              &(local_args_info.odirectory_given), optarg, 0, ".", ARG_STRING,
               check_ambiguity, override, 0, 0,
-              "ndirectory", 'n',
+              "odirectory", 'o',
               additional_error))
             goto failure;
         
           break;
-        case 'd':	/* Output directory.  */
+        case 'p':	/* Learned joint directory.  */
         
         
-          if (update_arg( (void *)&(args_info->directory_arg), 
-               &(args_info->directory_orig), &(args_info->directory_given),
-              &(local_args_info.directory_given), optarg, 0, ".", ARG_STRING,
+          if (update_arg( (void *)&(args_info->jdirectory_arg), 
+               &(args_info->jdirectory_orig), &(args_info->jdirectory_given),
+              &(local_args_info.jdirectory_given), optarg, 0, ".", ARG_STRING,
               check_ambiguity, override, 0, 0,
-              "directory", 'd',
+              "jdirectory", 'p',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'j':	/* Likelihood wrt 1 directory.  */
+        
+        
+          if (update_arg( (void *)&(args_info->l1directory_arg), 
+               &(args_info->l1directory_orig), &(args_info->l1directory_given),
+              &(local_args_info.l1directory_given), optarg, 0, ".", ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "l1directory", 'j',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'k':	/* Likelihood wrt 0 directory.  */
+        
+        
+          if (update_arg( (void *)&(args_info->l0directory_arg), 
+               &(args_info->l0directory_orig), &(args_info->l0directory_given),
+              &(local_args_info.l0directory_given), optarg, 0, ".", ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "l0directory", 'k',
+              additional_error))
+            goto failure;
+        
+          break;
+        case 'L':	/* Learn flag.  */
+        
+        
+          if (update_arg((void *)&(args_info->learn_flag), 0, &(args_info->learn_given),
+              &(local_args_info.learn_given), optarg, 0, 0, ARG_FLAG,
+              check_ambiguity, override, 1, 0, "learn", 'L',
               additional_error))
             goto failure;
         
             goto failure;
         
           break;
-        case 'G':	/* Gene exclusion file.  */
-        
-        
-          if (update_arg( (void *)&(args_info->genex_arg), 
-               &(args_info->genex_orig), &(args_info->genex_given),
-              &(local_args_info.genex_given), optarg, 0, 0, ARG_STRING,
-              check_ambiguity, override, 0, 0,
-              "genex", 'G',
-              additional_error))
-            goto failure;
-        
-          break;
         case 'm':	/* Memory map input/output.  */
         
         
             goto failure;
         
           break;
-        case 'h':	/* Holdout target dataset.  */
+        case 'G':	/* Gene exclusion file.  */
         
         
-          if (update_arg((void *)&(args_info->holdout_flag), 0, &(args_info->holdout_given),
-              &(local_args_info.holdout_given), optarg, 0, 0, ARG_FLAG,
-              check_ambiguity, override, 1, 0, "holdout", 'h',
+          if (update_arg( (void *)&(args_info->genex_arg), 
+               &(args_info->genex_orig), &(args_info->genex_given),
+              &(local_args_info.genex_given), optarg, 0, 0, ARG_STRING,
+              check_ambiguity, override, 0, 0,
+              "genex", 'G',
               additional_error))
             goto failure;
         
             goto failure;
         
           break;
-        case 'g':	/* Normal joint distribution.  */
-        
-        
-          if (update_arg((void *)&(args_info->normaljoint_flag), 0, &(args_info->normaljoint_given),
-              &(local_args_info.normaljoint_given), optarg, 0, 0, ARG_FLAG,
-              check_ambiguity, override, 1, 0, "normaljoint", 'g',
-              additional_error))
-            goto failure;
-        
-          break;
         case 't':	/* Threshold for joint.  */
         
         
             goto failure;
         
           break;
+        case 'h':	/* Holdout target dataset.  */
+        
+        
+          if (update_arg((void *)&(args_info->holdout_flag), 0, &(args_info->holdout_given),
+              &(local_args_info.holdout_given), optarg, 0, 0, ARG_FLAG,
+              check_ambiguity, override, 1, 0, "holdout", 'h',
+              additional_error))
+            goto failure;
+        
+          break;
 
         case 0:	/* Long option with no short option */
           if (strcmp (long_options[option_index].name, "help") == 0) {

tools/SpeciesConnector/cmdline.h

 {
   const char *help_help; /**< @brief Print help and exit help description.  */
   const char *version_help; /**< @brief Print version and exit help description.  */
+  char * ddirectory_arg;	/**< @brief Data directory (default='.').  */
+  char * ddirectory_orig;	/**< @brief Data directory original value given at command line.  */
+  const char *ddirectory_help; /**< @brief Data directory help description.  */
   char * adirectory_arg;	/**< @brief Answer directory (default='.').  */
   char * adirectory_orig;	/**< @brief Answer directory original value given at command line.  */
   const char *adirectory_help; /**< @brief Answer directory help description.  */
-  char * ndirectory_arg;	/**< @brief Input directory (default='.').  */
-  char * ndirectory_orig;	/**< @brief Input directory original value given at command line.  */
-  const char *ndirectory_help; /**< @brief Input directory help description.  */
-  char * directory_arg;	/**< @brief Output directory (default='.').  */
-  char * directory_orig;	/**< @brief Output directory original value given at command line.  */
-  const char *directory_help; /**< @brief Output directory help description.  */
+  char * odirectory_arg;	/**< @brief Output directory (default='.').  */
+  char * odirectory_orig;	/**< @brief Output directory original value given at command line.  */
+  const char *odirectory_help; /**< @brief Output directory help description.  */
+  char * jdirectory_arg;	/**< @brief Learned joint directory (default='.').  */
+  char * jdirectory_orig;	/**< @brief Learned joint directory original value given at command line.  */
+  const char *jdirectory_help; /**< @brief Learned joint directory help description.  */
+  char * l1directory_arg;	/**< @brief Likelihood wrt 1 directory (default='.').  */
+  char * l1directory_orig;	/**< @brief Likelihood wrt 1 directory original value given at command line.  */
+  const char *l1directory_help; /**< @brief Likelihood wrt 1 directory help description.  */
+  char * l0directory_arg;	/**< @brief Likelihood wrt 0 directory (default='.').  */
+  char * l0directory_orig;	/**< @brief Likelihood wrt 0 directory original value given at command line.  */
+  const char *l0directory_help; /**< @brief Likelihood wrt 0 directory help description.  */
+  int learn_flag;	/**< @brief Learn flag (default=off).  */
+  const char *learn_help; /**< @brief Learn flag help description.  */
   char * zeros_arg;	/**< @brief Read zeroed node IDs/outputs from the given file.  */
   char * zeros_orig;	/**< @brief Read zeroed node IDs/outputs from the given file original value given at command line.  */
   const char *zeros_help; /**< @brief Read zeroed node IDs/outputs from the given file help description.  */
-  char * genex_arg;	/**< @brief Gene exclusion file.  */
-  char * genex_orig;	/**< @brief Gene exclusion file original value given at command line.  */
-  const char *genex_help; /**< @brief Gene exclusion file 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='0').  */
   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.  */
-  int holdout_flag;	/**< @brief Holdout target dataset (default=off).  */
-  const char *holdout_help; /**< @brief Holdout target dataset help description.  */
+  char * genex_arg;	/**< @brief Gene exclusion file.  */
+  char * genex_orig;	/**< @brief Gene exclusion file original value given at command line.  */
+  const char *genex_help; /**< @brief Gene exclusion file help description.  */
   int genelist_flag;	/**< @brief Print gene list on the screen (default=off).  */
   const char *genelist_help; /**< @brief Print gene list on the screen help description.  */
   int uniformjoint_flag;	/**< @brief Uniform joint distribution (default=off).  */
   const char *uniformjoint_help; /**< @brief Uniform joint distribution help description.  */
-  int normaljoint_flag;	/**< @brief Normal joint distribution (default=off).  */
-  const char *normaljoint_help; /**< @brief Normal joint distribution help description.  */
   float threshold_arg;	/**< @brief Threshold for joint (default='0.5').  */
   char * threshold_orig;	/**< @brief Threshold for joint original value given at command line.  */
   const char *threshold_help; /**< @brief Threshold for joint help description.  */
+  int holdout_flag;	/**< @brief Holdout target dataset (default=off).  */
+  const char *holdout_help; /**< @brief Holdout target dataset help description.  */
   
   unsigned int help_given ;	/**< @brief Whether help was given.  */
   unsigned int version_given ;	/**< @brief Whether version was given.  */
+  unsigned int ddirectory_given ;	/**< @brief Whether ddirectory was given.  */
   unsigned int adirectory_given ;	/**< @brief Whether adirectory was given.  */
-  unsigned int ndirectory_given ;	/**< @brief Whether ndirectory was given.  */
-  unsigned int directory_given ;	/**< @brief Whether directory was given.  */
+  unsigned int odirectory_given ;	/**< @brief Whether odirectory was given.  */
+  unsigned int jdirectory_given ;	/**< @brief Whether jdirectory was given.  */
+  unsigned int l1directory_given ;	/**< @brief Whether l1directory was given.  */
+  unsigned int l0directory_given ;	/**< @brief Whether l0directory was given.  */
+  unsigned int learn_given ;	/**< @brief Whether learn was given.  */
   unsigned int zeros_given ;	/**< @brief Whether zeros was given.  */
-  unsigned int genex_given ;	/**< @brief Whether genex was given.  */
   unsigned int memmap_given ;	/**< @brief Whether memmap was given.  */
   unsigned int random_given ;	/**< @brief Whether random was given.  */
   unsigned int verbosity_given ;	/**< @brief Whether verbosity was given.  */
-  unsigned int holdout_given ;	/**< @brief Whether holdout was given.  */
+  unsigned int genex_given ;	/**< @brief Whether genex was given.  */
   unsigned int genelist_given ;	/**< @brief Whether genelist was given.  */
   unsigned int uniformjoint_given ;	/**< @brief Whether uniformjoint was given.  */
-  unsigned int normaljoint_given ;	/**< @brief Whether normaljoint was given.  */
   unsigned int threshold_given ;	/**< @brief Whether threshold was given.  */
+  unsigned int holdout_given ;	/**< @brief Whether holdout was given.  */
 
   char **inputs ; /**< @brief unamed options (options without names) */
   unsigned inputs_num ; /**< @brief unamed options number */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.