Skip to content

Commit

Permalink
Fix: added fix for bug that caused some samples with results missing …
Browse files Browse the repository at this point in the history
…in qc report
  • Loading branch information
sohanasingh committed Jul 12, 2024
1 parent d07c3d5 commit e0d5685
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/create_juno_qc_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def get_genus(species_csv: str) -> pd.DataFrame:
"""
df = pd.read_csv(species_csv, usecols=["sample", "genus"])
df["sample"] = df["sample"].astype(str)
if any(df['sample'].str.contains("_")):
df['sample'] = df['sample'].apply(lambda x: x.split('_')[0])
return df


Expand Down Expand Up @@ -100,6 +102,8 @@ def get_transposed_report(quast_tsv: str) -> pd.DataFrame:
inplace=True,
)
df["sample"] = df["sample"].astype(str)
if any(df['sample'].str.contains("_")):
df['sample'] = df['sample'].apply(lambda x: x.split('_')[0])

return df

Expand All @@ -123,6 +127,8 @@ def get_checkm_report(checkm_tsv: str) -> pd.DataFrame:
},
inplace=True,
)
if any(df['sample'].str.contains("_")):
df['sample'] = df['sample'].apply(lambda x: x.split('_')[0])
return df


Expand All @@ -135,6 +141,8 @@ def get_bbtools_report(bbtools_tsv: str) -> pd.DataFrame:
)
df.rename(columns={"Sample": "sample"}, inplace=True)
df["sample"] = df["sample"].astype(str)
if any(df['sample'].str.contains("_")):
df['sample'] = df['sample'].apply(lambda x: x.split('_')[0])

return df

Expand Down

0 comments on commit e0d5685

Please sign in to comment.