-
Notifications
You must be signed in to change notification settings - Fork 0
/
fnxns.py
33 lines (21 loc) · 854 Bytes
/
fnxns.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 3 08:26:27 2013
@author: kalexiou
"""
from supabase_fxns import *
def detect_duplicate_markers(user_marker, species):
user_marker_list = user_marker.split("\n")
marker_data = view_species_data(species)
# data2 = [x[0] for x in data]
# check whether the provided markers are already present in the species database
common_marker_list = list(set(marker_data).intersection(set(user_marker_list)))
return common_marker_list, user_marker_list
def add_markers(species, inlist, username):
list_w_data_to_insert = []
for i in inlist:
list_w_data_to_insert.append({'Marker_name': i, 'Species': species, 'Person': username, 'Date': timestr})
for m in list_w_data_to_insert:
supabase.table("speciesDB").insert(m).execute()
return