Skip to content

Commit

Permalink
Update IUPAC stuff
Browse files Browse the repository at this point in the history
- temporary disable non-ACGTU base variant call
  • Loading branch information
chaklim committed Dec 4, 2019
1 parent 04484d1 commit aef5b51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clair/call_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from clair.task.genotype import Genotype, genotype_string_from, genotype_enum_from, genotype_enum_for_task
from clair.task.variant_length import VariantLength
from shared.utils import IUPAC_base_to_num_dict as BASE2NUM, IUPAC_base_to_ACGT_base_dict as BASE2ACGT
from shared.utils import IUPAC_base_to_num_dict as BASE2NUM, IUPAC_base_to_ACGT_base_dict as BASE2ACGT, BASIC_BASES
import shared.param as param


Expand Down Expand Up @@ -943,6 +943,9 @@ def batch_output(mini_batch, batch_Y, output_config, output_utilities):
chromosome, position, reference_sequence = chr_pos_seq
position = int(position)

if reference_sequence[tensor_position_center] not in BASIC_BASES:
continue

# read depth
read_depth = sum(
x[tensor_position_center, :, Channel.delete] + x[tensor_position_center, :, Channel.reference]
Expand Down
1 change: 1 addition & 0 deletions shared/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
(0, 1, 2, 3, 3, 0, 1, 1, 0, 2, 0, 1, 0, 0, 0)
))

BASIC_BASES = set("ACGTU")

def is_file_exists(file_name, suffix=""):
if not isinstance(file_name, str) or not isinstance(suffix, str):
Expand Down

0 comments on commit aef5b51

Please sign in to comment.