Skip to content

Commit

Permalink
variable renaming from allele to locus for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
saramonzon authored and luissian committed Apr 19, 2024
1 parent 2a6e353 commit 68a5f3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions taranis/allele_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def _get_allele_details(
)
return allele_details

def _classify_allele(allele_file: str, match_sequence: str) -> str:
def _classify_allele(locus_file: str, match_sequence: str) -> str:
"""Find the allele name in the schema that match the sequence
Args:
Expand All @@ -271,7 +271,7 @@ def _classify_allele(allele_file: str, match_sequence: str) -> str:
# Read the fasta file and create a dictionary mapping sequences to their record IDs
sequence_dict = {
str(record.seq): record.id
for record in SeqIO.parse(allele_file, "fasta")
for record in SeqIO.parse(locus_file, "fasta")
}

# Check if the match_sequence is in the dictionary and return the corresponding record ID part
Expand Down Expand Up @@ -417,6 +417,7 @@ def fix_protein(sample_allele_data):
match_allele_schema = _classify_allele(
locus_file, sample_allele_data["sample_allele_seq"]
)

# PLOT, TPR, ASM, ALM, INF, EXC are possible classifications
if match_allele_schema:
# exact match found labelled as EXC
Expand Down

0 comments on commit 68a5f3c

Please sign in to comment.