Skip to content

Commit

Permalink
unique_vep function
Browse files Browse the repository at this point in the history
- added return type for function
- changed delimiter returned from ' & ' to '&'.
  • Loading branch information
RSWilson1 committed May 2, 2023
1 parent a5b05c9 commit 2cdcdeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/home/dnanexus/generate_workbook/utils/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def split(self, vcf_df) -> Union[pd.DataFrame, int]:
return vcf_df


def unique_vep(self, vcf_df):
def unique_vep(self, vcf_df) -> pd.DataFrame:
"""
Handle known bug in VEP annotation where it duplicates COSMIC IDs
This creates a
Expand All @@ -55,7 +55,7 @@ def unique_vep(self, vcf_df):
# Join the 'csq' columns using '&' and remove duplicates
for col in csq_columns:
vcf_df[col] = vcf_df[col].apply(
lambda x: ' & '.join(sorted(set(x.split('&')))) if isinstance(x, str) else x
lambda x: '&'.join(sorted(set(x.split('&')))) if isinstance(x, str) else x
)

return vcf_df
Expand Down

0 comments on commit 2cdcdeb

Please sign in to comment.