-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document service configuration, as part of #438.
Rename MiSeq Monitor to MiCall Watcher. Pull find_groups out of the resistance module, to avoid unnecessary requirements.
- Loading branch information
Showing
11 changed files
with
142 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from collections import namedtuple | ||
|
||
from micall.utils.sample_sheet_parser import sample_sheet_parser | ||
|
||
SampleGroup = namedtuple('SampleGroup', 'enum names') | ||
|
||
|
||
def find_groups(file_names, sample_sheet_path, included_projects=None): | ||
""" Group HCV samples with their MIDI partners. | ||
:param list[str] file_names: a list of FASTQ file names without paths | ||
:param sample_sheet_path: path to the SampleSheet.csv file | ||
:param included_projects: project codes to include, or None to include | ||
all | ||
""" | ||
with open(sample_sheet_path) as sample_sheet_file: | ||
run_info = sample_sheet_parser(sample_sheet_file) | ||
|
||
midi_files = {row['sample']: row['filename'] | ||
for row in run_info['DataSplit'] | ||
if row['project'] == 'MidHCV'} | ||
wide_names = {row['filename']: row['sample'] | ||
for row in run_info['DataSplit'] | ||
if (row['project'] != 'MidHCV' and | ||
(included_projects is None or | ||
row['project'] in included_projects))} | ||
trimmed_names = {'_'.join(file_name.split('_')[:2]): file_name | ||
for file_name in file_names} | ||
for trimmed_name, file_name in sorted(trimmed_names.items()): | ||
sample_name = wide_names.get(trimmed_name) | ||
if sample_name is None: | ||
# Project was not included. | ||
continue | ||
midi_trimmed = midi_files.get(sample_name + 'MIDI') | ||
midi_name = trimmed_names.get(midi_trimmed) | ||
yield SampleGroup(sample_name, (file_name, midi_name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Requirements for running the tests, doing development, and using utilities | ||
-r requirements-test.txt | ||
-r requirements-monitor.txt | ||
-r requirements-watcher.txt | ||
# Used for plotting profiling results. | ||
gprof2dot==2016.10.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.