Skip to content

Commit

Permalink
Merge pull request #3564 from broadinstitute/gregor-metdata-called-va…
Browse files Browse the repository at this point in the history
…riant-file-filtering

Gregor metadata called variant file filtering
  • Loading branch information
hanars authored Aug 21, 2023
2 parents 68806ba + 43ae552 commit 2830725
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 5 additions & 2 deletions seqr/views/apis/report_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,9 @@ def _get_sample_airtable_metadata(sample_ids, user, include_collaborator=False):
READ_RNA_TABLE_COLUMNS.insert(READ_RNA_TABLE_COLUMNS.index('gene_annotation')+1, 'gene_annotation_details')
READ_RNA_TABLE_COLUMNS.insert(READ_RNA_TABLE_COLUMNS.index('alignment_log_file')+1, 'alignment_postprocessing')
READ_SET_TABLE_COLUMNS = ['aligned_dna_short_read_set_id', 'aligned_dna_short_read_id']
CALLED_VARIANT_FILE_COLUMN = 'called_variants_dna_file'
CALLED_TABLE_COLUMNS = [
'called_variants_dna_short_read_id', 'aligned_dna_short_read_set_id', 'called_variants_dna_file', 'md5sum',
'called_variants_dna_short_read_id', 'aligned_dna_short_read_set_id', CALLED_VARIANT_FILE_COLUMN, 'md5sum',
'caller_software', 'variant_types', 'analysis_details',
]

Expand Down Expand Up @@ -912,7 +913,9 @@ def gregor_export(request):
('experiment_dna_short_read', EXPERIMENT_TABLE_COLUMNS, airtable_rows),
('aligned_dna_short_read', READ_TABLE_COLUMNS, airtable_rows),
('aligned_dna_short_read_set', READ_SET_TABLE_COLUMNS, airtable_rows),
('called_variants_dna_short_read', CALLED_TABLE_COLUMNS, airtable_rows),
('called_variants_dna_short_read', CALLED_TABLE_COLUMNS, [
row for row in airtable_rows if row.get(CALLED_VARIANT_FILE_COLUMN)
]),
('experiment_rna_short_read', EXPERIMENT_RNA_TABLE_COLUMNS, airtable_rna_rows),
('aligned_rna_short_read', READ_RNA_TABLE_COLUMNS, airtable_rna_rows),
('experiment', EXPERIMENT_LOOKUP_TABLE_COLUMNS, experiment_lookup_rows),
Expand Down
9 changes: 3 additions & 6 deletions seqr/views/apis/report_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@
'mean_coverage_wes': '42.8',
'mean_coverage_wgs': '36.1',
'analysis_details': '',
'called_variants_dna_short_read_id': 'NA',
'called_variants_dna_short_read_id': '',
'aligned_dna_short_read_set_id': 'Broad_NA20888_D1',
'called_variants_dna_file': 'NA',
'called_variants_dna_file': '',
'caller_software': 'NA',
'variant_types': 'SNV',
},
Expand Down Expand Up @@ -1031,7 +1031,7 @@ def _assert_expected_gregor_files(self, mock_open, has_second_project=False):
self.assertIn(['Broad_NA20888_D1', 'Broad_exome_NA20888_1'], read_set_file)
self.assertEqual(['Broad_NA20888_D1', 'Broad_genome_NA20888_1_1'] in read_set_file, has_second_project)

self.assertEqual(len(called_file), num_airtable_rows)
self.assertEqual(len(called_file), 2)
self.assertEqual(called_file[0], [
'called_variants_dna_short_read_id', 'aligned_dna_short_read_set_id', 'called_variants_dna_file', 'md5sum',
'caller_software', 'variant_types', 'analysis_details',
Expand All @@ -1040,9 +1040,6 @@ def _assert_expected_gregor_files(self, mock_open, has_second_project=False):
'SX2-3', 'BCM_H7YG5DSX2', 'gs://fc-fed09429-e563-44a7-aaeb-776c8336ba02/COL_FAM1_1_D1.SV.vcf',
'129c28163df082', 'gatk4.1.2', 'SNV', 'DOI:10.5281/zenodo.4469317',
], called_file)
self.assertIn(['NA', 'Broad_NA20888_D1', 'NA', 'a6f6308866765ce8', 'NA', 'SNV', ''], called_file)
self.assertEqual(
['NA', 'Broad_NA20888_D1', 'NA', '2aa33e8c32020b1c', 'NA', 'SNV', ''] in called_file, has_second_project)

self.assertEqual(len(experiment_rna_file), 2)
self.assertEqual(experiment_rna_file[0], [
Expand Down

0 comments on commit 2830725

Please sign in to comment.