//Constructor - user provides a filename for existing file as a c string.
Oligowalk_object::Oligowalk_object(const char filename[], const int type)
	:RNA(filename, type) {

		CommonConstructor();


}
Exemple #2
0
//Pass the constructor parameters directly to the parent TwoRNA class.
Dynalign_object::Dynalign_object(const char sequence1[], const char sequence2[], const bool IsRNA)
	:TwoRNA(sequence1, sequence2, IsRNA) {

	//Do some initilaizations
	CommonConstructor();

}
//Constructor - user provides a sequence as a c string.
Oligowalk_object::Oligowalk_object(const char sequence[])
	:RNA(sequence) {

		CommonConstructor();


}
Exemple #4
0
Dynalign_object::Dynalign_object(const char filename1[], const int type1, const char filename2[], const int type2, const bool IsRNA)
	: TwoRNA(filename1, type1, filename2, type2, IsRNA) {

	//Do some initilaizations
	CommonConstructor();


}
Hdf5DataReader::Hdf5DataReader(const FileFinder& rDirectory,
                               const std::string& rBaseName,
                               std::string datasetName)
    : AbstractHdf5Access(rDirectory, rBaseName, datasetName),
      mNumberTimesteps(1),
      mClosed(false)
{
    CommonConstructor();
}
Exemple #6
0
GTimer::GTimer ()
      : m_ConditionVar(&m_Mutex),
        m_bTimerRunning(false),
        m_bOneShot(false),
        m_pCommand(NULL),
        m_u32MillisecondInterval(0),
        m_bShuttingdown(false),
        m_bThreadStarted(false),
        m_bStopInProgress(false),
        m_pInitConditionVar(NULL)
{
	// This will not return until the timer's thread has entered run_undetached().
	CommonConstructor();
}
Exemple #7
0
OutputFileHandler::OutputFileHandler(const FileFinder& rDirectory,
                                     bool cleanOutputDirectory)
{
    FileFinder output_root("", RelativeTo::ChasteTestOutput);
    std::string relative_path;
    try
    {
        relative_path = rDirectory.GetRelativePath(output_root);
    }
    catch (const Exception&)
    {
        EXCEPTION("The location provided to OutputFileHandler must be inside CHASTE_TEST_OUTPUT; '"
                  << rDirectory.GetAbsolutePath() << "' is not under '"
                  << output_root.GetAbsolutePath() << "'.");
    }
    if (*output_root.GetAbsolutePath().rbegin() != '/' && !relative_path.empty())
    {
        assert(*relative_path.begin() == '/');
        relative_path.erase(0, 1); // Remove leading slash
    }
    CommonConstructor(relative_path, cleanOutputDirectory);
}
Exemple #8
0
//Constructor
//This constructor is used to perform Dynaligh refolding.
Dynalign_object::Dynalign_object(const char* filename, const short maxtrace, const short bpwin, const short awin, const short percent): TwoRNA() {
	int i;

	CommonConstructor();

	//Make sure the filename exists:
	if ((fopen(filename, "r"))== NULL) {
		//the file is not found
		ErrorCodeTwo=106;
		return;
		
	}



	//open the save file to peek at the sizes needed to allocate arrays:
	std::ifstream sav(filename,std::ios::binary);


	read(&sav, &modificationflag);

	//start with structure information
	read(&sav,&GetRNA1()->GetStructure()->numofbases);
	read(&sav,&GetRNA2()->GetStructure()->numofbases);
	sav.close();

	//allocate space for the alignment
	align = new short *[maxtrace];//maximum number of tracebacks and next line and below at delete
	for (i=0;i<maxtrace;i++)  align[i] = new short [GetRNA1()->GetStructure()->numofbases+1];

	refolddynalign(filename,GetRNA1()->GetStructure(),GetRNA2()->GetStructure(),align,maxtrace,bpwin,awin,percent);


	//No errors encountered.
	ErrorCodeTwo=0;
	return;

}
Exemple #9
0
GTimer::GTimer (const GAbsCommand* pCommand, UINT32 u32MillisecondInterval, bool bOneShot, bool bAutoStart)
      : m_ConditionVar(&m_Mutex),
        m_bTimerRunning(false),
        m_bOneShot(false),
        m_pCommand(NULL),
        m_u32MillisecondInterval(0),
        m_bShuttingdown(false),
        m_bThreadStarted(false),
        m_bStopInProgress(false),
        m_pInitConditionVar(NULL)
{
    m_pCommand					= const_cast<GAbsCommand*>(pCommand); 
    m_u32MillisecondInterval	= u32MillisecondInterval; 
    m_bOneShot					= bOneShot; 

	// This will not return until the timer's thread has entered run_undetached().
    CommonConstructor();
    
    if(bAutoStart)
    {
        Start();
    }
}
Exemple #10
0
CEditPoly::CEditPoly( CEditPoly *pCopyFrom )
{
	CommonConstructor( );
	CopyEditPoly( pCopyFrom );
}
ActiveXConstructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, 
                   jsval *rval)
{
    return CommonConstructor(cx, XPCJSRuntime::IDX_ACTIVEX_OBJECT, obj, argc, argv,
                             rval, PR_TRUE);
}
COMObjectConstructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, 
                     jsval *rval)
{
    return CommonConstructor(cx, XPCJSRuntime::IDX_COM_OBJECT, obj, argc,
                             argv, rval, PR_FALSE);
}
Exemple #13
0
TRfd::TRfd(TComponent * owner)
{
    CommonConstructor(owner);
} // End of constructor
Exemple #14
0
//Constructor for reading a dynalign save file.
Dynalign_object::Dynalign_object(const char filename[]): TwoRNA() {
	
	//Open the save file, make the output file
	int ir,ip,jp,kp,cp;
	short i,j,k,l;
	integersize en1;
	
	short maxsep;
	
	integersize crit;
	
	
	dynalignheap heap;

	//Do some initializations
	CommonConstructor();

	//Make sure the filename exists:
	if ((fopen(filename, "r"))== NULL) {
		//the file is not found
		ErrorCodeTwo=106;
		return;	
	}
	
	data = new datatable;
	bool singleinsert,local;
	bool **allowed_alignments;
	

	

	//indicate that a save file was read so that the destructor can do the cleanup
	savefileread=true;
	

	//open the save file to peek at the sizes needed to allocate arrays:
	std::ifstream sav(filename,std::ios::binary);


	read(&sav, &modificationflag);

	//start with structure information
	read(&sav,&(GetRNA1()->GetStructure()->numofbases));
	read(&sav,&(GetRNA2()->GetStructure()->numofbases));
	read(&sav,&maxsep);
	sav.close();
	
	if (maxsep<0) {
	//This means that the allowed alignments were constrained by the HMM alignment
	  //probs and not by the traditional M parameter.
	  //Therefore, space must be allocated for the allowed_alignment arrays.

	  allowed_alignments=new bool *[GetRNA1()->GetStructure()->numofbases+1];
	  for (i=0;i<=GetRNA1()->GetStructure()->numofbases;i++) allowed_alignments[i]=new bool [GetRNA2()->GetStructure()->numofbases+1];

	}
	else allowed_alignments=NULL;
	//fill the low and highend arrays:
	//allocate space:
	lowend = new short [2*GetRNA1()->GetStructure()->numofbases];
	highend = new short [2*GetRNA1()->GetStructure()->numofbases];


	if (modificationflag==1) {
		vmod = new dynalignarray();
	}
	else vmod=NULL;

	v = new varray();
	w = new dynalignarray();

	

	w3 = new wendarray();
	w5 = new wendarray();

	
	opendynalignsavefile(filename, GetRNA1()->GetStructure(), GetRNA2()->GetStructure(), v, w, vmod, w3, w5, data, &singleinsert, &maxsep, &gap, &lowest, &local, allowed_alignments,lowend,highend);
	



	if (maxsep<0) {
	  
		for (i=0;i<=GetRNA1()->GetStructure()->numofbases;i++) delete[] allowed_alignments[i];
		delete[] allowed_alignments;
	}

	
	//delete[] pair[0];
	//delete[] pair[1];
	//delete[] pair;
	
	//No errors encounted
	ErrorCodeTwo=0;
	return;


}
Exemple #15
0
OutputFileHandler::OutputFileHandler(const std::string& rDirectory,
                                     bool cleanOutputDirectory)
{
    CommonConstructor(rDirectory, cleanOutputDirectory);
}
CSocketAddress::CSocketAddress(const sockaddr& addr)
{
    CommonConstructor(addr);
}
CSocketAddress::CSocketAddress(const sockaddr_storage& addr)
{
    CommonConstructor(*(sockaddr*)&addr);
}
Exemple #18
0
CEditPoly::CEditPoly()
{
	CommonConstructor( );
}
//Default Constructor - user provides nothing.
Oligowalk_object::Oligowalk_object(const bool IsRNA)
	:RNA(IsRNA) {

		CommonConstructor();

}
Exemple #20
0
CEditPoly::CEditPoly( CEditBrush *pBrush )
{
	CommonConstructor( );
	m_pBrush = pBrush;
}