Skip to content

Commit

Permalink
Merge pull request #12 from spapa013/main
Browse files Browse the repository at this point in the history
adds PrfMethod table
  • Loading branch information
spapa013 authored May 24, 2022
2 parents bdfb5eb + 3d98a7b commit a9c7b67
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ class ExcelPrfSheet(djp.Part):
path_to_csv : varchar(1000) # path to csv file
"""


@schema
class PrfMethod(djp.Lookup):
enable_hashing = True
hash_name = 'prf_method'
hashed_attrs = 'prf_method_name'
definition = """
prf_method : varchar(6) # method of proofreading
---
prf_method_name : varchar(48) # name of proofreading method
prf_method_desc : varchar(1000) # proofreading description
ts_inserted=CURRENT_TIMESTAMP : timestamp # timestamp inserted
"""
contents = [{
'prf_method_name': 'whole_cell',
'prf_method_desc': 'all dendrites extended and cleaned, axon fully extended and cleaned'
},
{
'prf_method_name': 'projection_only',
'prf_method_desc': 'all dendrites extended and cleaned, only axon projection extended, axon cleaned.'
}
]


@schema
class PrfNucleusSet(djp.Lookup):
hash_name = 'prf_nuc_set'
Expand Down Expand Up @@ -70,6 +94,7 @@ class ExcelPrfSheet(djp.Part):
---
excel_id : int # id of nucleus on excel sheet
area : varchar(10) # visual area
-> PrfMethod
proofreader_den=NULL : varchar(450) # name of dendrite proofreader
time_min_den=NULL : float # time to complete dendrites (min)
notes_den=NULL : varchar(1000) # dendrites note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ def run(self, **kwargs):
df.loc[:, 'finished_ax'] = df.finished_ax.apply(lambda x: 1*eval(x.title()))
df.loc[:, 'finished_den'] = df.finished_den.apply(lambda x: 1*x)
df.loc[:, 'axon_in_white_matter'] = df.axon_in_white_matter.apply(lambda x: 1*x)
df.loc[:75, 'proofreading_method'] = 'whole_cell'
df.loc[76:145, 'proofreading_method'] = 'projection_only'
df.loc[146:, 'proofreading_method'] = 'whole_cell'
df.loc[:75, 'prf_method'] = PrfMethod.hash1({'prf_method_name': 'whole_cell'})
df.loc[76:145, 'prf_method'] = PrfMethod.hash1({'prf_method_name': 'projection_only'})
df.loc[146:, 'prf_method'] = PrfMethod.hash1({'prf_method_name': 'whole_cell'})
df = df.query('finished_den == True and finished_ax == True')
df = df.where(pd.notnull(df), None)
df['ts_inserted'] = str(current_timestamp_for_mysql('US/Central'))
df['import_method'] = params['import_method']
return {'df': df}

class PrfMethod(m65mprf.PrfMethod):
pass

class PrfNucleusSet(m65mprf.PrfNucleusSet):

Expand Down
2 changes: 1 addition & 1 deletion python/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.12"
__version__ = "0.0.13"

0 comments on commit a9c7b67

Please sign in to comment.