Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for new filenames before merge/subset #856

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 13 additions & 1 deletion import-scripts/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import shutil
import re
import csv
import study_directory_uses_original_filenames

# ------------------------------------------------------------------------------
# globals
Expand Down Expand Up @@ -103,7 +104,6 @@
'HYBRIDIZATION REF',
]


# only files fitting patterns placed in these two lists will be merged
NORMAL_MERGE_PATTERNS = [MUTATION_META_PATTERN,
FUSION_META_PATTERN,
Expand Down Expand Up @@ -814,6 +814,15 @@ def organize_files(studies, file_types, merge_clinical):
else:
file_types[SUPP_DATA].append(study_file)

def exit_if_unsupported_filenames_detected(study_paths):
unsupported_filenames_detected = False
for study_path in study_paths:
if not study_directory_uses_original_filenames.study_directory_uses_original_filenames(study_path):
print("unsupported filenames present in study directory '%s' - unable to merge" % study_path)
unsupported_filenames_detected = True
if unsupported_filenames_detected:
sys.exit(2)

def usage():
print >> OUTPUT_FILE, 'merge.py --subset [/path/to/subset] --output-directory [/path/to/output] --study-id [study id] --cancer-type [cancer type] --merge-clinical [true/false] --exclude-supplemental-data [true/false] --excluded-samples [/path/to/exclude_list] <path/to/study path/to/study ...>'

Expand Down Expand Up @@ -919,6 +928,9 @@ def main():
else:
exclude_supp_data = True

# test input study paths for new filenames
exit_if_unsupported_filenames_detected(args)

# get all the filenames
organize_files(args, file_types, merge_clinical)

Expand Down
Loading