void parse_lumpy(std::string lumpy_bede, std::vector<strvcfentry> & entries,
		int min_number_supporting, double max_eval) {
	size_t buffer_size = 2000000;
	char*buffer = new char[buffer_size];
	std::ifstream myfile;
	myfile.open(lumpy_bede.c_str(), std::ifstream::in);
	if (!myfile.good()) {
		std::cout << "Lumpy Parser: could not open file: " << lumpy_bede.c_str()
				<< std::endl;
		exit(0);
	}
	int call_id=entries.size();
	myfile.getline(buffer, buffer_size);
	while (!myfile.eof()) {
		int count = 0;
		short type = -1;
		double eval = 99;

		strregion region;
		int support = 0;
		for (size_t i = 0;
				i < buffer_size && buffer[i] != '\0' && buffer[i] != '\n';
				i++) {
			if (count == 7 && buffer[i - 1] == '\t') {
				eval = atof(&buffer[i]);
			}

			if (count >9 && strncmp(&buffer[i], "TYPE:", 5) == 0) {
				//get type;
				type = get_type(&buffer[i + 5]);
			}

			if (count > 10 && strncmp(&buffer[i], "STRANDS", 7) == 0) {
				//get support val;
				support = get_support(&buffer[i + 7]);
			}

			if (count > 10 && strncmp(&buffer[i], "MAX:", 4) == 0) {
				//get positions;
				region = get_coords(&buffer[i + 4]);
			}

			if (buffer[i] == '\t') {
				count++;
			}
		}

		//filter the parsed SV:
		if (support > min_number_supporting && eval < max_eval) {
			//std::cout<<eval<<" "<<type<<" "<<region.start.pos<<" "<<region.stop.pos<<std::endl;
			//detect overlap with delly:
			//if no overlap construct vcf entry for Lumpy:
			entries.push_back(create_entry(region,eval,support,type,call_id));
			call_id++;
		}
		myfile.getline(buffer, buffer_size);
	}

	myfile.close();
}
Exemple #2
0
__initfunc(int pcwatchdog_init(void))
#endif
{
	int i, found = 0;

	revision = PCWD_REVISION_A;

	printk("pcwd: v%s Ken Hollis ([email protected])\n", WD_VER);

	/* Initial variables */
	is_open = 0;
	supports_temp = 0;
	mode_debug = 0;
	temp_panic = 0;
	initial_status = 0x0000;

#ifndef	PCWD_BLIND
	for (i = 0; pcwd_ioports[i] != 0; i++) {
		current_readport = pcwd_ioports[i];

		if (pcwd_checkcard()) {
			found = 1;
			break;
		}
	}

	if (!found) {
		printk("pcwd: No card detected, or port not available.\n");
		return(-EIO);
	}
#endif

#ifdef	PCWD_BLIND
	current_readport = PCWD_BLIND;
#endif

	get_support();
	revision = get_revision();

	if (revision == PCWD_REVISION_A)
		printk("pcwd: PC Watchdog (REV.A) detected at port 0x%03x\n", current_readport);
	else if (revision == PCWD_REVISION_C)
		printk("pcwd: PC Watchdog (REV.C) detected at port 0x%03x (Firmware version: %s)\n",
			current_readport, get_firmware());
	else {
		/* Should NEVER happen, unless get_revision() fails. */
		printk("pcwd: Unable to get revision.\n");
		return -1;
	}

	debug_off();

	pcwd_showprevstate();

	/*  Disable the board  */
	if (revision == PCWD_REVISION_C) {
		outb_p(0xA5, current_readport + 3);
		outb_p(0xA5, current_readport + 3);
	}

	if (revision == PCWD_REVISION_A)
		request_region(current_readport, 2, "PCWD Rev.A (Berkshire)");
	else
		request_region(current_readport, 4, "PCWD Rev.C (Berkshire)");

	misc_register(&pcwd_miscdev);

	if (supports_temp)
		misc_register(&temp_miscdev);

	return 0;
}