Currently my code functions in so far that I get the appropriate results for the maximum STR counts when I pass a certain sequence. However, I have no clue as to what I should do to progress; I tried searching from the csv file after using DictReader but I get errors saying it's not subscriptable. From what I can tell, I need to actually pass those csv values into an actual dictionary after reading it, then search for the results. Also, even if I do find that the STRs match, how do I go about printing the appropriate name or finding the proper key to said name. (*count is a function I made that counts the maximum number of consecutive STRs in a given sequence)
if len(sys.argv)!=3:
print("python dna.py data.csv sequence.txt")
exit()
if os.path.isfile(sys.argv[2]) and os.path.isfile(sys.argv[1]):
with open(sys.argv[1], 'r') as file: #opening the database file for reading
reader = csv.DictReader(file) #using Dict reader to store csv into dict
AGATC = count(string, 'AGATC')
TTTTTTCT = count(string, 'TTTTTTCT')
AATG = count(string, 'AATG')
TCTAG = count(string, 'TCTAG')
GATA = count(string, 'GATA')
TATC = count(string, 'TATC')
GAAA = count(string, 'GAAA')
TCTG = count(string, 'TCTG')