Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to assign replicates #42

Open
arisp99 opened this issue Jun 6, 2022 · 0 comments
Open

Failure to assign replicates #42

arisp99 opened this issue Jun 6, 2022 · 0 comments
Labels
bug unexpected problem or unintended behavior

Comments

@arisp99
Copy link
Member

arisp99 commented Jun 6, 2022

Bug Description

Following the fixes in #22 where the sample sheet preparation was updated, I have been unable to generate a sample sheet without running into errors. Namely, the error occurs when the script attempts to assign a replicate number to each grouped sample and sample set here:

sample_sheet["Replicate"] = sample_sheet.groupby(
["sample_name", "sample_set"])["replicate"].transform(
assign_replicate).astype(int)

Digging into the code a bit more, the new replicate column is filled with NaN. Somehow, the assign_replicate function is generating NaN instead of the true replicate number. This causes the astype(int) command to fail as it cannot coerse NaN into an integer.

Steps to Reproduce

  1. Build or download the development version of the container.
  2. Isolate a capture plate and sample plate from a sequencing run.
  3. Run:
    $ singularity exec -B /work/apascha1/sample-sheet-prep:/opt/analysis \
      $miptools_dev.sif python /opt/src/sample_sheet_prep.py \
      --capture-plates capture_plates.tsv --sample-plates sample_plates.tsv --output-file samples.tsv

This should raise the following exception:

Exception: Error in assigning replicates. Please make sure the 'sample_name' and 'sample_set' fields have valid, non-empty values in all provided files.

Expected Behavior

There should be no NaNs in the replicate column after assigning replicates.


@aydemiro Do you have any idea what might be going wrong in the assign_replicate function?

@arisp99 arisp99 added the bug unexpected problem or unintended behavior label Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant