Skip to content

Commit

Permalink
Add tqdm descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraluebbert committed May 21, 2024
1 parent dfef190 commit b5c72a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gget/gget_mutate.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ def mutate(
if isinstance(mutation_df, str):
mutation_df = pd.read_csv(mutation_df)

logging.info("Extracting mutation types...")
# Get all mutation types
tqdm.pandas(desc="Extracting mutation types")
mutation_df["mutation_type"] = mutation_df[mut_column].progress_apply(
extract_mutation_type
)
Expand Down Expand Up @@ -367,6 +367,7 @@ def mutate(
# Create mutated sequences
logging.info("Mutating sequences...")
if not mutation_dict["substitution"].empty:
tqdm.pandas(desc="Performing substitutions")
mutation_dict["substitution"]["mutant_sequence_kmer"] = mutation_dict[
"substitution"
].progress_apply(
Expand All @@ -378,6 +379,7 @@ def mutate(
axis=1,
)
if not mutation_dict["deletion"].empty:
tqdm.pandas(desc="Performing deletions")
mutation_dict["deletion"]["mutant_sequence_kmer"] = mutation_dict[
"deletion"
].progress_apply(
Expand All @@ -389,6 +391,7 @@ def mutate(
axis=1,
)
if not mutation_dict["delins"].empty:
tqdm.pandas(desc="Performing delins")
mutation_dict["delins"]["mutant_sequence_kmer"] = mutation_dict[
"delins"
].progress_apply(
Expand All @@ -400,6 +403,7 @@ def mutate(
axis=1,
)
if not mutation_dict["insertion"].empty:
tqdm.pandas(desc="Performing insertions")
mutation_dict["insertion"]["mutant_sequence_kmer"] = mutation_dict[
"insertion"
].progress_apply(
Expand All @@ -411,6 +415,7 @@ def mutate(
axis=1,
)
if not mutation_dict["duplication"].empty:
tqdm.pandas(desc="Performing duplications")
mutation_dict["duplication"]["mutant_sequence_kmer"] = mutation_dict[
"duplication"
].progress_apply(
Expand All @@ -422,6 +427,7 @@ def mutate(
axis=1,
)
if not mutation_dict["inversion"].empty:
tqdm.pandas(desc="Performing inversions")
mutation_dict["inversion"]["mutant_sequence_kmer"] = mutation_dict[
"inversion"
].progress_apply(
Expand All @@ -433,6 +439,7 @@ def mutate(
axis=1,
)
if not mutation_dict["unknown"].empty:
tqdm.pandas(desc="Performing unknown mutations")
mutation_dict["unknown"]["mutant_sequence_kmer"] = mutation_dict[
"unknown"
].progress_apply(
Expand Down

0 comments on commit b5c72a4

Please sign in to comment.