forked from IRlabDroso/Lumar_GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7310dbe
commit 9d53040
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import csv | ||
from itertools import zip_longest | ||
|
||
with open ("Data.csv","w", encoding='UTF8', newline='') as f: | ||
writer = csv.writer(f,delimiter=",") | ||
|
||
OR = ["Endogenous","Empty"] + ["DmOR%d" % id for id in range(1, 30)] | ||
promotor = ["OR42b", "OR47b", "OR59b", "OR22ab", "ORCO"] | ||
replaced = ["Gal4","Boosted Gal4"] | ||
KIKO = ["Knockin", "Transgene", "other"] | ||
reporter = ["GCaMP7f"] | ||
d = [OR,promotor,replaced,KIKO,reporter] | ||
rows = zip_longest(*d, fillvalue = '') | ||
writer.writerows(rows) | ||
|
||
def load_csv(filename): | ||
odour = dict() | ||
# Open file in read mode | ||
file = open(filename,"r") | ||
# Reading file | ||
csv_reader = csv.reader(file) | ||
first_line = True | ||
for row in csv_reader: | ||
if first_line: | ||
first_line=False | ||
continue | ||
odour[row[0]] = row[1] | ||
|
||
return odour | ||
|
||
print(load_csv("Data.csv")) |