-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreprocess.py
More file actions
executable file
·51 lines (45 loc) · 2.22 KB
/
Copy pathpreprocess.py
File metadata and controls
executable file
·51 lines (45 loc) · 2.22 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
Preprocessing script that extracts information from experimental data produced by an imager run.
To use this file, first change the variable DATA_PATH to be the path to your data, then run
python preprocess.py
"""
import sys
import matplotlib as mpl
from tools.metadata import read_metadata
from transaction.extract_intensity import extract_intensity_all_files, extract_intensity_movies
from transaction.extract_peaks import extract_peaks_images, extract_peaks_movies
from transaction.fastq_tile_segmentation import fastq_tile_segmentation
from transaction.filter_fastq import filter_fastq
from transaction.match_tiles import match_tiles, match_tiles_movies
from transaction.summarize import create_summaries
from transaction.summarize_movie import summarize_movie
if __name__ == '__main__':
# make matplotlib color palette more colorblind friendly
mpl.rcParams['axes.prop_cycle'] = mpl.cycler(color=['#377eb8', '#ff7f00', '#4daf4a',
'#f781bf', '#a65628', '#984ea3',
'#999999', '#e41a1c', '#dede00'])
if len(sys.argv) == 1:
# Change this variable to be the path to your experimental directory
DATA_PATH = "/Volumes/T7/imager_data/20220509_ISDV2_glu/"
N_CORES = 8
else:
DATA_PATH = sys.argv[1]
N_CORES = int(sys.argv[2])
# read _metadata.csv, _config.csv which are located at DATA_PATH
metadata = read_metadata(DATA_PATH)
# sort fastq records by the sequencer tile
fastq_tile_segmentation(metadata, n_cores=N_CORES)
# remove fastq records that don't match the regex specified by SEQUENCER_INDEX
filter_fastq(metadata, N_CORES)
# detect peaks in the images
extract_peaks_images(metadata, N_CORES)
# extract_peaks_movies(metadata, N_CORES)
# align the coordinates from the detected peaks with those the fastq-coords
match_tiles(metadata, N_CORES)
# match_tiles_movies(metadata, N_CORES)
# calculate the intensity of the clusters
extract_intensity_all_files(metadata, N_CORES)
# extract_intensity_movies(metadata, N_CORES)
# accumulate all cycles together
create_summaries(metadata, N_CORES)
# summarize_movie(metadata, N_CORES)