Skip to content

Commit

Permalink
fix: correctly parse presets when using a samplesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
florianzwagemaker committed Jan 23, 2023
1 parent f2acedf commit 2ca2149
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ViroConstrictor/ViroConstrictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import snakemake
import yaml
import pandas as pd

from ViroConstrictor import __version__
from ViroConstrictor.functions import color
Expand Down Expand Up @@ -62,10 +63,11 @@ def main():

flags, sampleinfo, samples_df = ValidArgs(sys.argv[1:])
samples_df = samples_df.reset_index(drop=False).rename(columns={"index": "SAMPLE"})

This comment has been minimized.

Copy link
@KHajji

KHajji Jan 24, 2023

Contributor

It seems that this dataframe is not used anymore. Is that correct?

This comment has been minimized.

Copy link
@florianzwagemaker

florianzwagemaker Jan 24, 2023

Author Contributor

Currently that's indeed the case. But it shouldn't really be, it's only as a workaround .

When passing all information through a samplesheet only sampleinfo is currently correct.
sampleinfo and samples_df should be the same information but in a different form (dict and df). This is just a quick fix to get around the issue at hand through another dataframe made from the sampleinfo dict.

I'll have to take another look into the real issue (why sampleinfo and samples_df is not the same) when i have a bit more time, but for the meantime this should do the trick

sampleinfo_df = pd.DataFrame.from_dict(sampleinfo, orient="index").reset_index(drop=False).rename(columns={"index": "SAMPLE"})

preset_fallback_warnings = []
preset_score_warnings = []
for s in samples_df.itertuples():
for s in sampleinfo_df.itertuples():
sample, preset, score, input_target = (
s.SAMPLE,
s.PRESET,
Expand Down

0 comments on commit 2ca2149

Please sign in to comment.