Skip to content

Commit

Permalink
Fixing bugs in import.
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Oct 20, 2021
1 parent 9729b70 commit 62ce102
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions importer/management/commands/import_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,21 +637,23 @@ def _replace_pk_in_kegg_and_import(self, mapping, path, release_info, table, for
tmp.flush()
return self._import(tmp.name, release_info, table, force=force, truncate=truncate)

def _import_gnomad(self, path, tables, force):
self._import_chromosome_wise(path, tables, force, list(range(1, 23)) + ["X"])
def _import_gnomad(self, path, tables, force, truncate):
self._import_chromosome_wise(path, tables, force, truncate, list(range(1, 23)) + ["X"])

def _import_dbsnp(self, path, tables, force):
self._import_chromosome_wise(path, tables, force, list(range(1, 23)) + ["X", "Y", "MT"])
def _import_dbsnp(self, path, tables, force, truncate):
self._import_chromosome_wise(
path, tables, force, truncate, list(range(1, 23)) + ["X", "Y", "MT"]
)

def _import_chromosome_wise(self, path, tables, force, chroms):
def _import_chromosome_wise(self, path, tables, force, truncate, chroms):
"""Wrapper function to import gnomad tables
:param path: Path to gnomad tables
:param tables: Gnomad models.
:return: Nothing
"""
# Import file is scattered into chromosome pieces, collect them.
for chrom in chroms:
for no, chrom in enumerate(chroms):
# If the any chromosome can't be imported, don't try to import the other chromosomes.
if not self._import(
# Add chromosome to file name
Expand All @@ -660,5 +662,6 @@ def _import_chromosome_wise(self, path, tables, force, chroms):
# Import into info table only once
chrom == 1,
force=force,
truncate=truncate and no == 0,
):
break

0 comments on commit 62ce102

Please sign in to comment.