Ejemplo n.º 1
0
	void GetStats(double &time1, double &time2, double &time3, uint64 &_n_unique, uint64 &_n_cutoff_min, uint64 &_n_cutoff_max, uint64 &_n_total, uint64 &_n_reads, uint64 &_tmp_size, uint64 &_tmp_size_strict_mem, uint64 &_max_disk_usage, uint64& _n_total_super_kmers) {
		if (is_selected)
		{
			kmc->GetStats(time1, time2, time3, _n_unique, _n_cutoff_min, _n_cutoff_max, _n_total, _n_reads, _tmp_size, _tmp_size_strict_mem, _max_disk_usage, _n_total_super_kmers);
		}
		else
			app_1->GetStats(time1, time2, time3, _n_unique, _n_cutoff_min, _n_cutoff_max, _n_total, _n_reads, _tmp_size, _tmp_size_strict_mem, _max_disk_usage, _n_total_super_kmers);
	}
Ejemplo n.º 2
0
//----------------------------------------------------------------------------------
// Main function
int _tmain(int argc, _TCHAR* argv[])
{
	CStopWatch w0, w1;
	double time1, time2, time3;
	uint64 n_unique, n_cutoff_min, n_cutoff_max, n_total, n_reads, tmp_size, tmp_size_strict_mem, max_disk_usage, n_total_super_kmers;

	omp_set_num_threads(1);

#ifdef WIN32
	_setmaxstdio(2040);
#endif

	if(!parse_parameters(argc, argv))
	{
		usage();
		return 0;
	}

	if(Params.p_quake)
	{
		CApplication<CKmerQuake, KMER_WORDS, true> *app = new CApplication<CKmerQuake, KMER_WORDS, true>(Params);

		if(!app->Process())
		{
			cout << "Not enough memory or some other error\n";
			delete app;
			return 0;
		}
		app->GetStats(time1, time2, time3, n_unique, n_cutoff_min, n_cutoff_max, n_total, n_reads, tmp_size, tmp_size_strict_mem, max_disk_usage, n_total_super_kmers);
		delete app;
	}
	else
	{
		CApplication<CKmer, KMER_WORDS, false> *app = new CApplication<CKmer, KMER_WORDS, false>(Params);

		if(!app->Process())
		{
			cout << "Not enough memory or some other error\n";
			delete app;
			return 0;
		}
		app->GetStats(time1, time2, time3, n_unique, n_cutoff_min, n_cutoff_max, n_total, n_reads, tmp_size, tmp_size_strict_mem, max_disk_usage, n_total_super_kmers);
		delete app;
	}

	cout << "1st stage: " << time1 << "s\n";
	cout << "2nd stage: " << time2  << "s\n";
	if (Params.p_strict_mem)
		cout << "3rd stage: " << time3 << "s\n";
	if (Params.p_strict_mem)
		cout << "Total    : " << (time1 + time2 + time3) << "s\n";
	else
		cout << "Total    : " << (time1+time2) << "s\n";	
	if (Params.p_strict_mem)
	{
		cout << "Tmp size : " << tmp_size / 1000000 << "MB\n";
		cout << "Tmp size strict memory : " << tmp_size_strict_mem / 1000000 << "MB\n";
		//cout << "Tmp total: " << (tmp_size + tmp_size_strict_mem) / 1000000 << "MB\n";
		cout << "Tmp total: " << max_disk_usage / 1000000 << "MB\n";
	}
	else
		cout << "Tmp size : " << tmp_size / 1000000 << "MB\n";
	cout << "\nStats:\n";
	cout << "   No. of k-mers below min. threshold : " << setw(12) << n_cutoff_min << "\n";
	cout << "   No. of k-mers above max. threshold : " << setw(12) << n_cutoff_max << "\n";
	cout << "   No. of unique k-mers               : " << setw(12) << n_unique << "\n";
	cout << "   No. of unique counted k-mers       : " << setw(12) << n_unique-n_cutoff_min-n_cutoff_max << "\n";
	cout << "   Total no. of k-mers                : " << setw(12) << n_total << "\n";
if(Params.p_file_type != multiline_fasta)
	cout << "   Total no. of reads                 : " << setw(12) << n_reads << "\n";
else
	cout << "   Total no. of sequences             : " << setw(12) << n_reads << "\n";
	cout << "   Total no. of super-k-mers          : " << setw(12) << n_total_super_kmers << "\n";
	return 0;
}