Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP: Apply suggestions 1
Co-authored-by: Kabilar Gunalan <[email protected]>
  • Loading branch information
CBroz1 and kabilar authored Jul 8, 2022
commit a777f34941258563a3690f9ca6249d825d1f7471
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.

## [0.1.0] - 2021-05-04
### Added
+ Added version

## 0.1.1 - 2022-07-05
+ Update - Docker and Compose files
+ Update - Requirements for latest releases of Elements
+ Update - Workflow pipeline, ingestion, and populate scripts
+ Update - Pytests
+ Add - Code of conduct

## 0.1.0 - 2022-04-30
+ Add - Analysis schema and Jupyter notebook for event-aligned calcium activity
+ Add - Data exploration Jupyter notebook
+ Add - Docker and Compose files
+ Update - Pytests
+ Update - README

## 0.1.0a2 - 2021-10-18
+ Update - Change version to reflect release phase

## 0.1.1 - 2021-04-01
+ Add - Version
1 change: 0 additions & 1 deletion docker/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM datajoint/djbase:py3.9-debian-8eb1715

ARG GITHUB_USERNAME=datajoint
USER anaconda:anaconda

COPY ./docker/apt_requirements.txt /tmp/
Expand Down
8 changes: 0 additions & 8 deletions docker/docker-compose-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@ services:
networks:
miniscope:
image: datajoint/mysql:5.7
# image: mysql:5-debian
# platform: linux/amd64
# command: --default-authentication-plugin=mysql_native_password
# restart: always
environment:
MYSQL_ROOT_PASSWORD: simple
# MYSQL_USER: datajoint
# MYSQL_PASSWORD: datajoint
# volumes:
# - mysql-miniscope:/var/lib/mysql
container_name: workflow-miniscope-test-db

workflow:
Expand Down
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
datajoint>=0.13.0
element-lab>=0.1.0b0
element-animal>=0.1.0b0
element-session>=0.1.0b0
element-miniscope>=0.1.0
element-lab>=0.1.1
element-animal>=0.1.2
element-session>=0.1.2
element-event @ git+https://github.com/datajoint/element-event.git
element-miniscope @ git+https://github.com/datajoint/element-miniscope.git
element-interface @ git+https://github.com/datajoint/element-interface.git
djarchive-client @ git+https://github.com/datajoint/djarchive-client.git
jupytext>=1.13.7
9 changes: 2 additions & 7 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import sys
from element_interface.utils import find_full_path

# from workflow_miniscope.paths import get_miniscope_root_data_dir

# ------------------- SOME CONSTANTS -------------------

Expand Down Expand Up @@ -89,13 +88,11 @@ def test_data(dj_config):
f'\nError: {str(e)}')

import djarchive_client
from workflow_miniscope import version

client = djarchive_client.client()
workflow_version = version.__version__

client.download('workflow-miniscope-test-set',
workflow_version.replace('.', '_'),
'v1',
str(test_data_dir), create_target=False)
return

Expand Down Expand Up @@ -178,9 +175,7 @@ def sessions_csv():
def ingest_sessions(ingest_subjects, sessions_csv):
from workflow_miniscope.ingest import ingest_sessions
_, sessions_csv_path = sessions_csv
# if not tear_down, skip duplicates
skip_duplicates = not _tear_down
ingest_sessions(sessions_csv_path, skip_duplicates=skip_duplicates, verbose=verbose)
ingest_sessions(sessions_csv_path, verbose=verbose)
return


Expand Down
1 change: 1 addition & 0 deletions tests/test_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test_ingest_subjects(pipeline, ingest_subjects):

def test_ingest_sessions(pipeline, sessions_csv, ingest_sessions):
session = pipeline['session']
miniscope = pipeline['miniscope']
get_miniscope_root_data_dir = pipeline['get_miniscope_root_data_dir']

assert len(session.Session()) == 1
Expand Down
9 changes: 4 additions & 5 deletions workflow_miniscope/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def ingest_subjects(subject_csv_path='./user_data/subjects.csv',
ingest_csv_to_table(csvs, tables, skip_duplicates=skip_duplicates, verbose=verbose)


def ingest_sessions(session_csv_path='./user_data/sessions.csv', skip_duplicates=False,
verbose=True):
def ingest_sessions(session_csv_path='./user_data/sessions.csv', verbose=True):
if verbose:
print('\n---- Insert new `Session` and `Recording` ----')
with open(session_csv_path, newline='') as f:
Expand Down Expand Up @@ -84,13 +83,13 @@ def ingest_sessions(session_csv_path='./user_data/sessions.csv', skip_duplicates

if verbose:
print(f'\n---- Insert {len(session_list)} entry(s) into session.Session ----')
session.Session.insert(session_list, skip_duplicates=skip_duplicates)
session.SessionDirectory.insert(session_dir_list, skip_duplicates=skip_duplicates)
session.Session.insert(session_list)
session.SessionDirectory.insert(session_dir_list)

if verbose:
print(f'\n---- Insert {len(recording_list)} entry(s) into '
+ 'miniscope.Recording ----')
miniscope.Recording.insert(recording_list, skip_duplicates=skip_duplicates)
miniscope.Recording.insert(recording_list)

if verbose:
print('\n---- Successfully completed ingest_sessions ----')
Expand Down
21 changes: 5 additions & 16 deletions workflow_miniscope/populate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,25 @@ def populate(display_progress=True, reserve_jobs=False, suppress_errors=False,
'suppress_errors': suppress_errors}

if verbose:
print('\n---- Populate miniscope.ScanInfo ----')
miniscope.ScanInfo.populate(**populate_settings)
print("\n---- Populate imported and computed tables ----")

miniscope.RecordingInfo.populate(**populate_settings)

if verbose:
print('\n---- Populate miniscope.Processing ----')
miniscope.Processing.populate(**populate_settings)

if verbose:
print('\n---- Populate miniscope.MotionCorrection ----')
miniscope.MotionCorrection.populate(**populate_settings)

if verbose:
print('\n---- Populate miniscope.Segmentation ----')
miniscope.Segmentation.populate(**populate_settings)

if verbose:
print('\n---- Populate miniscope.MaskClassification ----')
miniscope.MaskClassification.populate(**populate_settings)

if verbose:
print('\n---- Populate miniscope.Fluorescence ----')
miniscope.Fluorescence.populate(**populate_settings)

if verbose:
print('\n---- Populate miniscope.Activity ----')
miniscope.Activity.populate(**populate_settings)

if verbose:
print('\n---- Successfully completed workflow_calcium_imaging/populate.py ----')
print('\n---- Successfully completed workflow_miniscope/populate.py ----')


if __name__ == '__main__':
populate()
run()