//Import dependencies
var execSync = require('child_process').execSync;

//Import utils
var UtilsFile = require('../utils/file.js');
var UtilsBiomart = require('../utils/biomart.js');

//Function for import from biomart
module.exports = function(opt)
{
	//Parse the specie
	opt.specie = opt.specie.toLowerCase();

	//Parse the assembly
	opt.assembly = opt.assembly.toLowerCase();

	//Get the output file
	var output = UtilsFile.Biomart(opt.specie, opt.assembly, opt.import);

	//Check the specie and assembly
	if(opt.specie === 'hsapiens' && opt.assembly === 'grch37')
	{
		//Replace on the command
		command = command.replace('{assembly}', 'grch37');
	}
	else
	{
		//Relace by default
		command = command.replace('{assembly}', 'www');
	}

	//Get the query object
	var query = require('./query/' + opt.import + '.json');

	//Get the xml
	var xml = UtilsXML(query, opt.specie);

	//Replace the xml
	command = command.replace('{xml}', xml);

	//Replace the output file
	command = command.replace('{output}', output);

	//Show in console
	console.log('Wait...');

	//Run the import
	var log = execSync(command);

	//Show confirmation
	console.log('Saved as ' + output);
};

@@ -469,16 +469,75 @@
 port);%0A%0A
+%09//Get the command%0A%09var command = UtilsBiomart.Command();%0A%0A
 %09//Check
@@ -636,17 +636,17 @@
 Replace 
-o
+i
 n the co
@@ -905,16 +905,24 @@
  = Utils
+Biomart.
 XML(quer

Add biomart utils methods