print("create a new operon text")
operon_name = input("promoter name : ")
promoter = operon_name
inhibition = input("inhibition? ")
num_proteins = input("number of proteins in operon: " )
proteins = []
operon_length = input("length of operon: " )

inhibitor = {'Tet':'TetR','Lac':'LacI'}
for i in range(0,int(num_proteins)):
  protein = input("#"+str(i+1)+" protein name: ")
  proteins.append(protein)

#constants
print("\n")
print("include gro")
print("include constants")
print("mRNA_p"+operon_name+"_length :="+operon_length+";")
print("k_mRNA_p"+promoter+" := k_mRNA_p"+promoter+"_raw/mRNA_p"+promoter+"_length; // mRNA/min")

#initialize gro program
print("\n")
print("program p() := {")
print("\t" +"mRNA_p"+operon_name+":= 0;")
for i in proteins:
  print("\t" +i+" := 0;")

#mRNA
print("\n")
print("\t" +"//mRNA//")
print("\t" +"//operon: p"+operon_name)
if inhibition == 0:
  print("\t" +"rate( k_mRNA_p" + operon_name + " * volume ) : {")
else:
  print("\t" +"rate( k_mRNA_p" + operon_name + " * volume * repression theta_"+inhibitor[promoter]+" "+inhibitor[promoter]+" n_"+inhibitor[promoter]+" ) : {")
print("\t" +"\t" + "mRNA_p"+operon_name+":=""mRNA_p"+operon_name+"+1"+"};")
print("\t" +"rate( g_mRNA_p" + operon_name + " * mRNA_p"+operon_name+ ") : {")
print("\t" +"\t" + "mRNA_p"+operon_name+":=""mRNA_p"+operon_name+"-1"+"};")

#proteins
print("\n")
print("\t" +"//proteins//")
for i in proteins:
  print("\t" +"//protein :"+i)
  print("\t" +"rate( k_protein_" + i + " * mRNA_p"+operon_name+ " ) : {")
  print("\t" +"\t" +i+":="+i+"+1 };")
  print("\t" +"rate( g_protein_" + i + " * "+i+ " ) : {")
  print("\t" +"\t" +i+":="+i+"-1 };")
  print("\n")
print("};")
print("\n"+"ecoli ( [ x:= 0, y:= 10 ], program p() );")
