I have a tsv file and I'd like to iterate through all the rows. this is my code:
import csv
with open('tsv2.tsv','r') as tsvin:
tsvin = csv.reader(tsvin, delimiter='\t')
tsv_file = tsvin
def non_synonymous_filter(tsv_file):
non_synonymous_list=[]
for row in range(len(tsv_file)):
if "NON_SYNONYMOUS_CODING" in row[index]:
non_synonymous_list.append(row)
return non_synonymous_list
print(non_synonymous_filter(tsv_file))
The problem is I get this error message: object of type '_csv.reader' has no len()