Ive defined this python function for some reason its giving me an indentation error for the print line statement present after the:
print '-------------------------------------------------------------'
I could not figure out why.
def seq_type(file_handle):
is_DNA = True
is_RNA = True
is_protein = True
proteins = 'arndcqeghilkmfpstwyv'
for line in file_handle:
line.strip()
if line[0] == '>': #skip this line since its fasta headear and therefore
continue #no sequence at this line
print line
if is_RNA == True:
for char in line:
print 'Character is: ', char
if char.lower() == 'a' or char.lower() == 'u' or char.lower() == 'c' or char.lower() == 'g'or char == '\n':
is_RNA = True
print is_RNA
else:
is_RNA = False
print 'is RNA? ', is_RNA
break
print is_RNA
print '-------------------------------------------------------------------'
print line
if is_DNA == True:
for char in line:
print 'Character is: ', char
if char.lower() == 'a' or char.lower() == 't' or char.lower() == 'c' or char.lower() == 'g'or char == '\n':
is_DNA = True
print is_DNA
else:
is_DNA = False
print 'is DNA? ', is_DNA
break
print is_DNA