Skip to content

Commit

Permalink
Fixing problem with CNV import (#386)
Browse files Browse the repository at this point in the history
Closes: #386
Related-Issue: #386
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Mar 11, 2022
1 parent 2e75c4e commit e0bfa14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ HEAD (unreleased)
End-User Summary
================

- Fixing problem with CNV import (#386)

Full Change List
================

- Adding REST API for generating query shortcuts (#367)
- Fixing problem with CNV import (#386)

------
v1.1.0
Expand Down
14 changes: 11 additions & 3 deletions importer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,14 @@ def _clear_old_variant_sets(self, keep_variant_set, table_names):
)

def _import_table(
self, variant_set_info, variant_set, token, path_attr, model_class, default_values=None
self,
variant_set_info,
variant_set,
token,
path_attr,
model_class,
default_values=None,
no_release=True,
):
default_values = default_values or {}
before = timezone.now()
Expand All @@ -490,7 +497,7 @@ def _import_table(
header = inputf.readline().strip()
header_arr = header.split("\t")
try:
release_idx = header_arr.index("release")
release_idx = None if no_release else header_arr.index("release")
case_idx = header_arr.index("case_id")
set_idx = header_arr.index("set_id")
except ValueError as e:
Expand All @@ -511,7 +518,7 @@ def _import_table(
if not line:
break
arr = line.split("\t")
if arr[release_idx] != case_genomebuild:
if release_idx is not None and arr[release_idx] != case_genomebuild:
raise RuntimeError(
"Incompatible genome build in %s TSV: %s vs %s from case"
% (token, arr[release_idx], case_genomebuild)
Expand Down Expand Up @@ -575,6 +582,7 @@ def _perform_import(self, variant_set, variant_set_info):
"SV-gene annotation",
"effectfile_set",
StructuralVariantGeneAnnotation,
no_release=True,
)

def _post_import(self, variant_set, variant_type):
Expand Down

0 comments on commit e0bfa14

Please sign in to comment.