Skip to content

guess_baits.py into target triggers "TypeError: sequence item 0: expected str instance, numpy.float64 found" error #766

Description

@Quentin-Bayard

Hello,
Thanks for this very complete Copy Number analysis workflow.
I'm trying to process a WES dataset without the baits.bed provided file.
Following your documentation I'm trying to infer this information using the guess_bait.py provided script.
Unfortunately when I use the output file into either target or skg_convert.py I get this error:

Traceback (most recent call last):
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff_/lib/python3.8/s
ite-packages/pandas/core/groupby/groupby.py", line 736, in apply
result = self.python_apply_general(f)
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff
/lib/python3.8/s
ite-packages/pandas/core/groupby/groupby.py", line 752, in python_apply_general
keys, values, mutated = self.grouper.apply(f, self.selected_obj, self.axis)
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff
/lib/python3.8/s
ite-packages/pandas/core/groupby/ops.py", line 206, in apply
res = f(group)
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff
/lib/python3.8/s
ite-packages/pandas/core/groupby/groupby.py", line 720, in f
return func(g, *args, **kwargs)
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff_/lib/python3.8/s
ite-packages/skgenome/merge.py", line 47, in flatten_overlapping
all_row_groups = itertools.chain(*row_groups)
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff
/lib/python3.8/s
ite-packages/skgenome/merge.py", line 45, in
row_groups = (tuple(flatten_tuples(row_group, combine))
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff
/lib/python3.8/s
ite-packages/skgenome/merge.py", line 81, in flatten_tuples
extra_fields = {key: combine[key]([getattr(r, key)
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff
/lib/python3.8/s
ite-packages/skgenome/merge.py", line 81, in
extra_fields = {key: combine[key]([getattr(r, key)
File "/data/processingNGS_WES/omics_preprocessing_v0/dna-seq/.snakemake/conda/47ea29d1f5abacf7e1f884dc867e65ff_/lib/python3.8/s
ite-packages/skgenome/combiners.py", line 53, in join_strings
return sep.join(pd.unique(elems))
TypeError: sequence item 0: expected str instance, numpy.float64 found

Here the header of the initial bed file I use as guess_bait.pyfollowed by the output.

chr1    12190   12227
chr1    12595   12721
chr1    13403   13639
chr1    30366   30503
chr1    35137   35174
chr1    35276   35481
chr1    35720   35736
chr1    69089   70010
chr1    450738  451680
chr1    491124  491591
chr1    12190   12227   -       52.2919
chr1    12595   12721   -       22.8143
chr1    13403   13639   -       39.0975
chr1    69089   70010   -       57.2879
chr1    450738  451680  -       27.3987
chr1    685714  686656  -       29.2246
chr1    729105  729728  -       9.42215
chr1    786025  786532  -       87.2552
chr1    826700  827191  -       82.2721

I'm assuming the error is induced by the presence of floats values in the 5th column of the file I try to use as target input, so did I miss something in the documentation about this?

Regards,
Quentin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions