Skip to content

Commit

Permalink
qc: Fix check_input for info file and indentation: record = info_json…
Browse files Browse the repository at this point in the history
… #TASK-6766
  • Loading branch information
xim56 committed Sep 20, 2024
1 parent 24efa3e commit 3fd69a8
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions opencga-app/app/analysis/qc/variant_qc.main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,20 @@ def check_input(vcf_fpath, info_fpath, qc_type):
# Getting IDs and sample IDs from info JSON file
info_ids = []
info_sample_ids = []
for record in info_json:
# Getting all IDs in info file
info_ids.append(record['id'])
# Family
if qc_type == 'family' and 'members' in record:
info_sample_ids = [sample['id']
for member in record['members'] if 'samples' in member
for sample in member['samples'] if 'id' in sample]
# Individual
elif qc_type == 'individual' and 'samples' in record:
info_sample_ids = [sample['id'] for sample in record['samples'] if 'id' in sample]
# Sample
elif qc_type == 'sample' and 'id' in record:
info_sample_ids.append(record['id'])
record = info_json
# Getting all IDs in info file
info_ids.append(record['id'])
# Family
if qc_type == 'family' and 'members' in record:
info_sample_ids = [sample['id']
for member in record['members'] if 'samples' in member
for sample in member['samples'] if 'id' in sample]
# Individual
elif qc_type == 'individual' and 'samples' in record:
info_sample_ids = [sample['id'] for sample in record['samples'] if 'id' in sample]
# Sample
elif qc_type == 'sample' and 'id' in record:
info_sample_ids.append(record['id'])
info_sample_ids.sort()

# Checking whether input file and info file have the same samples
Expand Down

0 comments on commit 3fd69a8

Please sign in to comment.