#This function maps the reads to the genes catalog using the MOSAIK software
import subprocess
subprocess.check_call('chmod +x MosaikAligner', shell=True)
subprocess.check_call('chmod +x MosaikBuild', shell=True)
subprocess.check_call('chmod +x MosaikJump', shell=True)
subprocess.check_call('chmod +x mosaik_build_ref.sh', shell=True)
subprocess.check_call('chmod +x mosaik_read_aligner.sh', shell=True)
import os
cdp=os.getcwd()
os.system('clear')
gene_catalog_named='gatalog.fa' # enter path of gene catalog name
print "To mapping the read sequences to the gene catalog, the following two steps should be implemented"
print "In the first step, the gene catalog should be converted into an acceptable form for the MOSAIK program."
print "In the second step, the reads are mapped to the gene catalog. Refer to the help file for this step"
print
print "Enter d1 for creating an acceptable form of gene catalog."
print "Enter d2 for mapping reads to gene catalog."
print "Enter 0 for back"
x=raw_input()
if x=='d1':
	os.system('clear')
	import subprocess
	subprocess.call("./mosaik_build_ref.sh")
	print
	print "Please press any key to continue"
	c=raw_input()
elif x=='d2':
	import subprocess
	subprocess.call("./mosaik_read_aligner.sh")
