summaryrefslogtreecommitdiff
path: root/wk6/pset/dna
diff options
context:
space:
mode:
Diffstat (limited to 'wk6/pset/dna')
-rw-r--r--wk6/pset/dna/dna.py17
-rw-r--r--wk6/pset/dna/test.py16
2 files changed, 2 insertions, 31 deletions
diff --git a/wk6/pset/dna/dna.py b/wk6/pset/dna/dna.py
index 5994878..bd7f4ec 100644
--- a/wk6/pset/dna/dna.py
+++ b/wk6/pset/dna/dna.py
@@ -8,17 +8,9 @@ def main():
if len(sys.argv) < 2 and len(sys.argv) > 3:
print("Oopsie you used the wrong number of arguments D: you should use two next time :3")
return
- # # check to see if arg 0 is a csv file
- # if not sys.argv[0].endswith('.csv'):
- # print("Oh no, that isn't a csv file :( that won't work can you fix that please?")
- # return
- # # check to see if arg 1 is a txt file
- # if not sys.argv[1].endswith('.txt'):
- # print("Oh no, that isn't a txt file :( that won't work can you fix that please?")
- # return
# TODO: Read database file into a variable
- database = 'databases/' + sys.argv[1]
+ database = sys.argv[1]
rows = []
fields = []
with open(database) as file:
@@ -28,7 +20,7 @@ def main():
rows.append(row)
# TODO: Read DNA sequence file into a variable
- text = 'sequences/' + sys.argv[2]
+ text = sys.argv[2]
sequence = ''
with open(text) as file:
sequence = sequence.join(file.readlines())
@@ -41,13 +33,8 @@ def main():
else:
matches.append('')
- # print(rows)
- # print(fields)
- # print(matches)
-
# TODO: Check database for matching profiles
for person in rows:
- # print(person)
counter = 1
for i in range(len(fields)):
if fields[i] != 'name':
diff --git a/wk6/pset/dna/test.py b/wk6/pset/dna/test.py
deleted file mode 100644
index e540471..0000000
--- a/wk6/pset/dna/test.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import csv, sys
-
-# Open the CSV file
-with open(sys.argv[1]) as csvfile:
- # Create a CSV reader object
- reader = csv.reader(csvfile)
-
- # Get the header (first line)
- header = next(reader)
-
- # Get the rest of the data
- data = list(reader)
-
-# Print the header and data to verify
-print("Header:", header)
-print("Data:", data)