Skip to content

Commit

Permalink
remove parents without sample from samples_pedigree
Browse files Browse the repository at this point in the history
  • Loading branch information
KorayKirli committed Sep 7, 2020
1 parent ca80176 commit b579c7d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions chalicelib/checks/helpers/cgap_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@
}


def remove_parents_without_sample(samples_pedigree):
individuals = [i['individual'] for i in samples_pedigree]
for a_member in samples_pedigree:
parents = a_member['parents']
new_parents = [i for i in parents if i in individuals]
a_member['parents'] = new_parents
return samples_pedigree


def check_workflow_version(workflows):
errors = []
for a_wf in workflows:
Expand Down
4 changes: 3 additions & 1 deletion chalicelib/checks/wfr_cgap_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,8 @@ def cgapS3_status(connection, **kwargs):
check.full_output['problematic_runs'].append({an_msa['@id']: final_status})
continue
samples_pedigree = an_msa['samples_pedigree']
# remove parent ids that are not in the sample_pedigree as individual
samples_pedigree = cgap_utils.remove_parents_without_sample(samples_pedigree)
# Define run Mode: Trio or Proband only
# order samples by father/mother/proband
run_mode = ""
Expand Down Expand Up @@ -1043,7 +1045,7 @@ def cgapS3_status(connection, **kwargs):
step2_status = ""
else:
s2_input_files = {"input_vcf": step1b_output,
#"bigfile": "20004873-b672-4d84-a7c1-7fd5c0407519",
# "bigfile": "20004873-b672-4d84-a7c1-7fd5c0407519",
'additional_file_parameters': {'input_vcf': {"unzip": "gz"}}
}
s2_tag = an_msa['@id'] + '_Part3step2'
Expand Down

0 comments on commit b579c7d

Please sign in to comment.