Skip to content

Commit

Permalink
fix: replace gaps in nucleotide-seq with "N" characters to ensure val…
Browse files Browse the repository at this point in the history
…id translation when `--keep-gaps` flag is given. (forces ambigious AA call)
  • Loading branch information
florianzwagemaker committed Dec 6, 2022
1 parent 0f3d01c commit bf4ed5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AminoExtract/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_args(givenargs: list[str] | None = None) -> argparse.Namespace:
"-kg",
action="store_true",
default=False,
help='If this flag is set then the amino acid translation will be done including gaps in the nucleotide sequence.\nThis results in an "X" on gap positions in the aminoacid sequence.\n [underline]By default, gaps are removed before translation.[/underline]',
help='If this flag is set then the amino acid translation will be done including gaps in the nucleotide sequence.\n This results in an "X" on gapped positions in the aminoacid sequence as gap characters ("-") will be replaced by "N" in the nucleotide sequence.\n [underline]By default, gaps are removed before translation.[/underline]',
required=False,
)

Expand Down
2 changes: 1 addition & 1 deletion AminoExtract/sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def Extract_AminoAcids(

# get the sequence slice from the start to the end position
seq_slice = (
NucSequence[start:end]
NucSequence[start:end].replace("-", "N")
if keep_gaps
else NucSequence[start:end].replace("-", "")
)
Expand Down

0 comments on commit bf4ed5f

Please sign in to comment.