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

multiple columns with multiple values #33

Closed
nsheff opened this issue Nov 22, 2019 · 0 comments
Closed

multiple columns with multiple values #33

nsheff opened this issue Nov 22, 2019 · 0 comments
Assignees
Labels
bug

Comments

@nsheff
Copy link
Contributor

@nsheff nsheff commented Nov 22, 2019

Verision 0.2.1 can't handle multiple columns with multiple values.

In other words, if you use a subsample_table that has multiple columns, it will choke with this kind of error:

onfig file: /home/x/code/ews_patients/metadata/project_config.yaml
Loaded config file: /home/x/code/ews_patients/metadata/project_config.yaml
  subprojects: rna,cellrep,bsdat
Error in `[[<-`(`*tmp*`, pluralID, value = iPlural) : 
  recursive indexing failed at level 2

Enter a frame number, or 0 to exit   

1: projectInit("ews_patients")
2: pepr::Project(cfgFile, subproject)
3: methods::new("Project", file = file, subproject = subproject)
4: initialize(value, ...)
5: initialize(value, ...)
6: .deriveAttributes(.Object)
7: .strformat(regex, as.list(samp), exclude, parentDir)

I traced the problem to the .strformat function, which is only tested with 1 multi-variable:

.strformat("$HOME/{VAR1}{VAR2}_file", list(VAR1="hi", VAR2="hello"))
.strformat("$HOME/{VAR1}{VAR2}_file", list(VAR1="hi", VAR2="hello"))
.strformat("$HOME/{VAR1}{VAR2}_file", list(VAR1="hi", VAR2=c("hello", "hello2")))
.strformat("$HOME/{VAR1}{VAR2}_file", list(VAR1="hi", VAR2=c("hello", "hello2", "hello3")))

These should also be possible:

.strformat("$HOME/{VAR1}{VAR2}_file", list(VAR1=c("hi", "hi2"), VAR2=c("hello", "hello2")))
.strformat("$HOME/{VAR1}{VAR2}_file", list(VAR1=c("hi", "hi2"), VAR2=c("hello", "hello2")))

What I've realized is, mutliple multi-variables should be allowed, as long as they each have exactly the same number of values. So, this should fail:

.strformat("$HOME/{VAR1}{VAR2}_file", list(VAR1=c("hi", "hi2"), VAR2=c("hello", "hello2", "hello3")))
@nsheff nsheff added the bug label Nov 22, 2019
@nsheff nsheff self-assigned this Nov 22, 2019
stolarczyk added a commit that referenced this issue Jan 9, 2020
@stolarczyk stolarczyk closed this in 8a7eca0 Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.