Skip to content

Commit

Permalink
Merge pull request #14 from Clinical-Genomics/bugfix
Browse files Browse the repository at this point in the history
Fix small bugs
  • Loading branch information
adrosenbaum committed May 21, 2019
2 parents d1e6896 + 3015b6f commit 1ef9ed4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mutacc_auto/build_input/input_assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NoBamException(Exception):

def get_case(case, bam_file_paths, vcf_file_path):

case_id = case['display_name']
case_id = case['_id']

#Instatiate case dictionary with case_id
case_obj = {
Expand All @@ -49,7 +49,6 @@ def get_case(case, bam_file_paths, vcf_file_path):
'case': case_obj,
'samples': samples_obj,
'variants': vcf_file_path

}


Expand All @@ -70,13 +69,19 @@ def assemble_samples(individuals, bam_files = None):
samples = []

for individual in individuals:
sex = 'unknown'
if individual['sex'] == '1':
sex = 'male'
if individual['sex'] == '2':
sex = 'female'

samples.append(
{
'sample_id': individual['individual_id'],
'sex': 'male' if (individual['sex'] == '1') else 'female',
'sex': sex,
'phenotype': 'affected' if (individual['phenotype'] == 2) else 'unaffected',
'father': individual['father'],
'mother': individual['mother'],
'father': individual['father'] if individual['father'] else '0',
'mother': individual['mother'] if individual['mother'] else '0',
'analysis_type': individual['analysis_type'],
'bam_file': bam_files.get(individual['individual_id']) if bam_files else None
}
Expand Down

0 comments on commit 1ef9ed4

Please sign in to comment.