Skip to content

Commit bb3eb46

Browse files
authored
Merge pull request #5027 from broadinstitute/post-cleanup-coverage
Post-cleanup fix test coverage
2 parents b8d2303 + f3ff552 commit bb3eb46

File tree

13 files changed

+27
-108
lines changed

13 files changed

+27
-108
lines changed

clickhouse_search/managers.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,11 +1117,7 @@ def search_padded_interval(self, chrom, pos, padding):
11171117
return self.filter(interval_q).result_values()
11181118

11191119
@staticmethod
1120-
def _interval_query(chrom, start, end, offset=None, **kwargs):
1121-
if offset:
1122-
offset_pos = int((end - start) * offset)
1123-
start = max(start - offset_pos, MIN_POS)
1124-
end = min(end + offset_pos, MAX_POS)
1120+
def _interval_query(chrom, start, end, **kwargs):
11251121
return Q(xpos__range=(get_xpos(chrom, start), get_xpos(chrom, end)))
11261122

11271123
def _filter_seqr_frequency(self, entries, ac=None, hh=None, **kwargs):

clickhouse_search/search.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,6 @@ def _get_comp_het_results_queryset(annotations_cls, primary_q, secondary_q, num_
189189
{2: ('arrayIntersect(primary_familyGuids, secondary_familyGuids)', 'has({value}, {field})')},
190190
]),
191191
}
192-
elif results.has_annotation('secondary_genotypes'):
193-
genotype_expressions = {
194-
'primary_familyGenotypes': ArrayFilter('primary_familyGenotypes', conditions=[
195-
{1: ('secondary_familyGuids', 'has({value}, {field})')},
196-
]),
197-
'secondary_genotypes': ArrayFilter('secondary_genotypes', conditions=[
198-
{2: (None, 'arrayExists(g -> g.1 = {field}, primary_familyGenotypes)')},
199-
]),
200-
}
201192
else:
202193
genotype_expressions = {
203194
'primary_familyGenotypes': ArrayFilter('primary_familyGenotypes', conditions=[
@@ -699,10 +690,11 @@ def delete_clickhouse_family(project, family_guid, dataset_type, sample_type=Non
699690
return f'Clickhouse does not support deleting individual families from project. Manually delete {dataset_type} data for {family_guid} in project {project.guid}'
700691

701692

693+
SV_DATASET_TYPES = {
694+
Sample.SAMPLE_TYPE_WGS: Sample.DATASET_TYPE_SV_CALLS,
695+
Sample.SAMPLE_TYPE_WES: 'GCNV',
696+
}
702697
def _clickhouse_dataset_type(dataset_type, sample_type):
703698
if dataset_type == Sample.DATASET_TYPE_SV_CALLS:
704-
if not sample_type:
705-
raise ValueError('sample_type is required when dataset_type is SV')
706-
if sample_type == Sample.SAMPLE_TYPE_WES:
707-
return 'GCNV'
699+
dataset_type = SV_DATASET_TYPES[sample_type]
708700
return dataset_type

clickhouse_search/search_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def test_location_search(self):
599599
[SV_VARIANT1, SV_VARIANT2], locus=sv_locus,
600600
)
601601
self._assert_expected_search(
602-
[SV_VARIANT1], locus={'rawItems': 'chr1:9292894-9369532'}
602+
[SV_VARIANT1], locus={'rawItems': 'chr1:9297894-9369732%10'}
603603
)
604604

605605
self._reset_search_families()

reference_data/management/commands/utils/__init__.py

Whitespace-only changes.

reference_data/management/commands/utils/update_utils.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

seqr/management/commands/check_for_new_samples_from_pipeline.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
'GCNV': f'{Sample.DATASET_TYPE_SV_CALLS}_WES',
3737
Sample.DATASET_TYPE_SV_CALLS: f'{Sample.DATASET_TYPE_SV_CALLS}_WGS',
3838
}
39-
USER_EMAIL = 'manage_command'
4039
RELATEDNESS_CHECK_NAME = 'relatedness_check'
4140

4241
PDO_COPY_FIELDS = [
@@ -255,7 +254,7 @@ def _load_new_samples(cls, metadata_path, genome_version, dataset_type, run_vers
255254
# Reload saved variant JSON
256255
update_projects_saved_variant_json([
257256
(project.id, project.guid, project.name, project.genome_version, families) for project, families in families_by_project.items()
258-
], user_email=USER_EMAIL, dataset_type=dataset_type, update_function=cls._update_project_saved_variant_genotypes, samples=updated_samples, clickhouse_dataset_type=clickhouse_dataset_type)
257+
], dataset_type=dataset_type, update_function=cls._update_project_saved_variant_genotypes, samples=updated_samples, clickhouse_dataset_type=clickhouse_dataset_type)
259258

260259
@classmethod
261260
def _is_internal_project(cls, project):
@@ -390,7 +389,7 @@ def _update_individuals_sample_qc(cls, sample_type, family_guids, sample_qc_map)
390389
)
391390

392391
@classmethod
393-
def _update_project_saved_variant_genotypes(cls, project_id, genome_version, user_email, family_guids, project_guid, samples=None, clickhouse_dataset_type=None, **kwargs):
392+
def _update_project_saved_variant_genotypes(cls, project_id, genome_version, family_guids, project_guid, samples=None, clickhouse_dataset_type=None, **kwargs):
394393
updates = {}
395394
for family_guid in family_guids:
396395
variant_models_by_key = {

seqr/management/commands/reload_saved_variant_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ def handle(self, *args, **options):
3030

3131
family_ids = [family_guid] if family_guid else None
3232
project_list = [(*project, family_ids) for project in projects.order_by('id').values_list('id', 'guid', 'name', 'genome_version')]
33-
update_projects_saved_variant_json(project_list, user_email='manage_command', update_function=update_project_saved_variant_json)
33+
update_projects_saved_variant_json(project_list, update_function=update_project_saved_variant_json)
3434
logger.info("Done")

seqr/utils/communication_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ def _post_to_slack(channel, message):
2525
return None
2626

2727
slack = Slacker(SLACK_TOKEN)
28-
response = slack.chat.post_message(
28+
slack.chat.post_message(
2929
channel, message, as_user=False, icon_emoji=":beaker:", username="Beaker (engineering-minion)",
3030
)
31-
return response.raw
3231

3332

3433
def send_welcome_email(user, referrer):

seqr/utils/search/utils.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,6 @@ def _filter_inheritance_family_samples(samples, inheritance_filter):
560560
]
561561

562562

563-
def _format_interval(chrom=None, start=None, end=None, offset=None, **kwargs):
564-
if offset:
565-
offset_pos = int((end - start) * offset)
566-
start = max(start - offset_pos, MIN_POS)
567-
end = min(end + offset_pos, MAX_POS)
568-
return [chrom, start, end]
569-
570-
571563
LIFTOVERS = {
572564
GENOME_VERSION_GRCh38: None,
573565
GENOME_VERSION_GRCh37: None,

seqr/views/apis/data_manager_api_tests.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,9 +1274,6 @@ def _test_expected_vcf_responses(self, response, url):
12741274
response = self.client.get(url, content_type='application/json')
12751275
self.assertEqual(response.status_code, 200)
12761276

1277-
def _assert_expected_read_vcf_header_subprocess_calls(self, body):
1278-
return True
1279-
12801277
def test_validate_callset(self):
12811278
url = reverse(validate_callset)
12821279
self.check_pm_login(url)

0 commit comments

Comments
 (0)