Browse Source

implemented toy directory scanner

automate3
Stephen Lorenz 3 years ago
parent
commit
c15926db9f
  1. BIN
      cjs/.app/database/bug/database.db
  2. 2
      cjs/.app/database/bug/output/test/qualitative_reqbt-3-2.csv
  3. 1
      cjs/.app/database/bug/tmp/reqbt-3-2-settings.json
  4. 16
      cjs/.app/database/bug/tmp/reqbt-3-2.csv
  5. 40
      cjs/.app/database/bug/tmp/reqbt-3.tsv
  6. 1
      cjs/.app/database/bug/tmp/reqbt-4-1-settings.json
  7. 16
      cjs/.app/database/bug/tmp/reqbt-4-1.csv
  8. 31
      cjs/.app/database/bug/tmp/reqbt-4.tsv
  9. 28
      cjs/core/automate.py
  10. 17
      cjs/debug.py
  11. 3
      cjs/setup.py

BIN
cjs/.app/database/bug/database.db

2
cjs/.app/database/bug/output/test/qualitative_reqbt-3-2.csv

@ -0,0 +1,2 @@
"EvidFile" "POI" "log10LR"
"reqbt-3" "reqbt-3-2" "6.65717772882058e-29"

1
cjs/.app/database/bug/tmp/reqbt-3-2-settings.json

@ -0,0 +1 @@
{"resource_dir": "/home/csguest/Desktop/cjs2/cjs/resources", "working_dir": "/home/csguest/Desktop/cjs2/cjs/.app/database/bug", "batch_dir": "test", "evidence_file": "/home/csguest/Desktop/cjs2/cjs/.app/database/bug/tmp/reqbt-3.tsv", "comparison_file": "/home/csguest/Desktop/cjs2/cjs/.app/database/bug/tmp/reqbt-3-2.csv", "test_name": "reqbt-3-2", "evidence_name": "reqbt-3", "comparison_name": "reqbt-3-2", "num_contributors": 2, "num_replicates": 2}

16
cjs/.app/database/bug/tmp/reqbt-3-2.csv

@ -0,0 +1,16 @@
SampleName,Marker,Allele1,Allele2
reqbt-3-2,D3S1358,15,18
reqbt-3-2,D19S433,13.2,16
reqbt-3-2,D5S818,9,13
reqbt-3-2,FGA,25,25
reqbt-3-2,D8S1179,14,14
reqbt-3-2,D7S820,9,9
reqbt-3-2,vWA,14,16
reqbt-3-2,D16S539,11,12
reqbt-3-2,TPOX,8,8
reqbt-3-2,D2S1338,17,20
reqbt-3-2,D18S51,16,17
reqbt-3-2,TH01,6,9.3
reqbt-3-2,D13S317,11,12
reqbt-3-2,CSF1PO,11,12
reqbt-3-2,D21S11,30.2,32

40
cjs/.app/database/bug/tmp/reqbt-3.tsv

@ -1,31 +1,31 @@
Sample Name Marker Allele 1 Allele 2 Allele 3 Allele 4 Allele 5 Allele 6 Allele 7 ADO UD1
reqbt-3_1 D3S1358 15 16 17 18 false
reqbt-3_1 D19S433 15.2 16 17 false
reqbt-3_1 D5S818 9 13 14 false
reqbt-3_1 FGA 19 21 false
reqbt-3_1 D8S1179 11 13 14 false
reqbt-3_1 D7S820 10 12 false
reqbt-3_1 vWA 14 15 16 false
reqbt-3_1 D16S539 11 12 13 false
reqbt-3_1 TPOX 8 9 10 false
reqbt-3_1 D2S1338 17 false
reqbt-3_1 D18S51 12 14 false
reqbt-3_1 TH01 6 7 false
reqbt-3_1 D13S317 8 10 11 false
reqbt-3_1 CSF1PO 9 10 11 12 false
reqbt-3_1 D7S820 10 12 false
reqbt-3_1 D3S1358 15 16 17 18 false
reqbt-3_1 D2S1338 17 false
reqbt-3_1 D8S1179 11 13 14 false
reqbt-3_1 D16S539 11 12 13 false
reqbt-3_1 D21S11 29 30 31 false
reqbt-3_1 D13S317 8 10 11 false
reqbt-3_1 D19S433 15.2 16 17 false
reqbt-3_1 FGA 19 21 false
reqbt-3_1 D5S818 9 13 14 false
reqbt-3_1 TH01 6 7 false
reqbt-3_2 D3S1358 15 16 17 18 false
reqbt-3_2 D19S433 13.2 14 14.2 15 15.2 16 17 false
reqbt-3_2 D5S818 9 12 14 false
reqbt-3_2 FGA 19 21 25 false
reqbt-3_2 D8S1179 11 13 14 false
reqbt-3_2 D7S820 9 10 12 false
reqbt-3_2 vWA 15 16 false
reqbt-3_2 D16S539 11 12 false
reqbt-3_2 TPOX 8 9 10 false
reqbt-3_2 D2S1338 17 false
reqbt-3_2 D18S51 12 13 14 17 false
reqbt-3_2 TH01 6 7 false
reqbt-3_2 D13S317 8 10 13 false
reqbt-3_2 CSF1PO 9 10 false
reqbt-3_2 D7S820 9 10 12 false
reqbt-3_2 D3S1358 15 16 17 18 false
reqbt-3_2 D2S1338 17 false
reqbt-3_2 D8S1179 11 13 14 false
reqbt-3_2 D16S539 11 12 false
reqbt-3_2 D21S11 29 30.2 31 false
reqbt-3_2 D13S317 8 10 13 false
reqbt-3_2 D19S433 13.2 14 14.2 15 15.2 16 17 false
reqbt-3_2 FGA 19 21 25 false
reqbt-3_2 D5S818 9 12 14 false
reqbt-3_2 TH01 6 7 false

1
cjs/.app/database/bug/tmp/reqbt-4-1-settings.json

@ -0,0 +1 @@
{"resource_dir": "/home/csguest/Desktop/cjs2/cjs/resources", "working_dir": "/home/csguest/Desktop/cjs2/cjs/.app/database/bug", "batch_dir": "test", "evidence_file": "/home/csguest/Desktop/cjs2/cjs/.app/database/bug/tmp/reqbt-4.tsv", "comparison_file": "/home/csguest/Desktop/cjs2/cjs/.app/database/bug/tmp/reqbt-4-1.csv", "test_name": "reqbt-4-1", "evidence_name": "reqbt-4", "comparison_name": "reqbt-4-1", "num_contributors": 2, "num_replicates": 2}

16
cjs/.app/database/bug/tmp/reqbt-4-1.csv

@ -0,0 +1,16 @@
SampleName,Marker,Allele1,Allele2
reqbt-4-1,D3S1358,15,16
reqbt-4-1,D19S433,14,15.2
reqbt-4-1,D5S818,11,11
reqbt-4-1,FGA,19,23
reqbt-4-1,D8S1179,13,15
reqbt-4-1,D7S820,11,11
reqbt-4-1,vWA,14,18
reqbt-4-1,D16S539,9,13
reqbt-4-1,TPOX,8,9
reqbt-4-1,D2S1338,20,24
reqbt-4-1,D18S51,14,17
reqbt-4-1,TH01,9,9
reqbt-4-1,D13S317,11,12
reqbt-4-1,CSF1PO,12,12
reqbt-4-1,D21S11,29,29.2

31
cjs/.app/database/bug/tmp/reqbt-4.tsv

@ -0,0 +1,31 @@
Sample Name Marker Allele 1 Allele 2 Allele 3 Allele 4 Allele 5 ADO UD1
reqbt-4_1 D3S1358 15 16 17 false
reqbt-4_1 D19S433 14 15.2 17 false
reqbt-4_1 D5S818 9 11 14 false
reqbt-4_1 FGA 19 21 23 false
reqbt-4_1 D8S1179 11 13 15 false
reqbt-4_1 D7S820 10 11 12 false
reqbt-4_1 vWA 14 15 16 18 false
reqbt-4_1 D16S539 9 11 12 13 false
reqbt-4_1 TPOX 8 9 10 false
reqbt-4_1 D2S1338 17 18 20 24 false
reqbt-4_1 D18S51 12 14 17 false
reqbt-4_1 TH01 6 7 9 false
reqbt-4_1 D13S317 8 10 11 12 false
reqbt-4_1 CSF1PO 9 10 11 12 false
reqbt-4_1 D21S11 28 29 29.2 31 false
reqbt-4_2 D3S1358 15 16 17 false
reqbt-4_2 D19S433 14 15.2 16 17 false
reqbt-4_2 D5S818 9 11 12 14 false
reqbt-4_2 FGA 19 21 23 false
reqbt-4_2 D8S1179 11 13 15 false
reqbt-4_2 D7S820 10 11 12 false
reqbt-4_2 vWA 14 15 16 17 18 false
reqbt-4_2 D16S539 9 11 12 13 false
reqbt-4_2 TPOX 8 9 10 false
reqbt-4_2 D2S1338 17 18 20 24 false
reqbt-4_2 D18S51 12 14 17 false
reqbt-4_2 TH01 6 7 9 false
reqbt-4_2 D13S317 8 10 11 12 false
reqbt-4_2 CSF1PO 9 10 12 false
reqbt-4_2 D21S11 29 29.2 30 31 false

28
cjs/core/automate.py

@ -11,6 +11,10 @@ from subprocess import TimeoutExpired
# pip
import click
import watchdog
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
# local
from core.database import fill_job_queue
@ -20,6 +24,30 @@ from utils.io import read_json
import utils.net
from utils.net import send_email
class FileSystemScanner(FileSystemEventHandler):
def __init__(self):
self.tracked_files = []
def process(self, event):
print('Source Path: %s' % event.src_path) # debug
print('Event Type: %s' % event.event_type)
def on_created(self, event):
self.tracked_files.append(event.src_path)
print(' Tracked: %s' % event.src_path)
def on_deleted(self, event):
self.tracked_files.remove(event.src_path)
print(' Untracked: %s' % event.src_path)
def scan_dir(path, *args, **kwargs):
fss = FileSystemScanner()
obs = Observer()
obs.schedule(fss, path=path)
obs.start()
return fss, obs
class AutomateStatus:
def __init__(self):
self.completed_jobs = 0

17
cjs/debug.py

@ -0,0 +1,17 @@
#!/usr/env/bin python3
import core.automate
from core.automate import scan_dir
fss, obs = scan_dir('debug')
import time
try:
while True:
for i, f in enumerate(fss.tracked_files, start=1):
print('%d. %s' % (i, f))
time.sleep(1)
except KeyboardInterrupt:
obs.stop()
obs.join()

3
cjs/setup.py

@ -10,7 +10,8 @@ setup(
'click',
'marshmallow',
'sqlalchemy',
'matplotlib'
'matplotlib',
'watchdog'
],
entry_points='''
[console_scripts]

Loading…
Cancel
Save