Skip to content

Can't duplicate sample_name #368

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

Closed
nsheff opened this issue Mar 22, 2021 · 3 comments
Closed

Can't duplicate sample_name #368

nsheff opened this issue Mar 22, 2021 · 3 comments

Comments

@nsheff
Copy link
Contributor

nsheff commented Mar 22, 2021

If I have a sample sheet with sample but not sample_name columns, I should be able to:

pep_version: "2.0.0"
sample_table: "samplesheet_test.csv"

sample_modifiers:
  duplicate:
    sample: sample_name

But this leads to:

Traceback (most recent call last):
  File "/home/nsheff/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2895, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'sample_name'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/nsheff/.local/bin/eido", line 8, in <module>
    sys.exit(main())
  File "/home/nsheff/.local/lib/python3.8/site-packages/eido/eido.py", line 352, in main
    inspect_project(p, args.sample_name, args.attr_limit)
  File "/home/nsheff/.local/lib/python3.8/site-packages/eido/eido.py", line 302, in inspect_project
    print(p)
  File "/home/nsheff/.local/lib/python3.8/site-packages/peppy/project.py", line 581, in __str__
    sample_names = list(self[SAMPLE_DF_KEY][self.sample_name_colname])
  File "/home/nsheff/.local/lib/python3.8/site-packages/pandas/core/frame.py", line 2902, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/nsheff/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc
    raise KeyError(key) from err
KeyError: 'sample_name'

I think it may check for sample_name too early.

@stolarczyk
Copy link
Member

I seem to be able to instantiate such a peppy.Project object. What did you actually execute? Maybe that's actually a problem in eido or looper? I see some eido code in the traceback.

@stolarczyk
Copy link
Member

I got the same result when ran:

eido inspect <cfg>

I'm transferring this to eido

@stolarczyk stolarczyk transferred this issue from pepkit/peppy Jun 7, 2021
@stolarczyk
Copy link
Member

that's an issue in peppy.Project.__str__, that's why it was pronounced only in eido inspect. Moving back to peppy...

@stolarczyk stolarczyk transferred this issue from pepkit/eido Jun 7, 2021
@nsheff nsheff closed this as completed in 6e7485a May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants