I'm creating a code for "software" that'll ask the user how many sequences of DNA barcodes (n) they want and what is the length (size) of the DNA barcode he wants. And according to the user parameters it must generate a text file containing a total of n sequences of size-nucleotides long DNA barcodes. The file generated has to follow EXACT format showed-> barcode (sequence number): DNA barcode. What I am having trouble is creating a user input in asking how many sequences they want, what size they want the sequence.
import io
#given a DNA(A,C,T,G) string and a 1-letter base string,
#returns number of occurences of base in the sequence
def dna_sequence():
base_counter=0
seq_len=len(seq)
for index in range(0,seq_len):
seq_base=seq[index]
if seq_base==query_base:
base_counter=base_counter+1
return base_counter
#given a DNA(A,C,T,G) sequence string and returns GC content as float
def GC_content(seq):
g_content=dna_sequence(seq,"G")
c_content=dna_sequence(seq,"C")
seq_len=len(seq)
GC=(g_content+c_content)/float(seq_len)
return GC
#opens file I want to create and loop over lines
f=io.open("barcode_generator.txt","rU")
for line in f:
linestripped=line.strip()
linelist=line.split("\t")
id=linelist[0]
sequence=linelist[1]
seqgc=gc_content(sequence)
print(id+"\t"+str(seqgc))
f.close()