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

Stack builder can not find list files if the file names start with a number #11

Closed
raacampbell opened this issue Jan 6, 2017 · 24 comments
Labels

Comments

@raacampbell
Copy link
Collaborator

raacampbell commented Jan 6, 2017

This has apparently happened with data in the MF lab when the sample ID is a number. e.g. "15".

@alexanderbrown
Copy link
Collaborator

Not something I've noticed. Where does it fail?

@raacampbell
Copy link
Collaborator Author

Don't know. I only know about this second-hand. I will invite people to contribute to this issue if they want it fixed.

@ghost
Copy link

ghost commented Jan 6, 2017

I haven't tested longer filenames starting with numbers, however if the sample name is something simple, eg. "17," even if the list files are present, MaSIV will complain that it cannot find them. The channel options will also not be present for building after clicking "New." Renaming the sample (and all sub-folder/sampleID references to it) to something like: "AB_17" fixes the issue.

@raacampbell
Copy link
Collaborator Author

So the image list files start with the characters 17_

@ghost
Copy link

ghost commented Jan 6, 2017

As does the yml, the "stackName" field in the yml, and the "sampleID" field in our mosaic files.

@alexanderbrown
Copy link
Collaborator

OK so one explanation is that matlab variables can't begin with a number. Because the masivMeta object uses the channel name to create a structure, it can't create a variable

@raacampbell
Copy link
Collaborator Author

Yeah, something like this screwed me too in StitchIt when those samples were acquired. In general we don't name our sample IDs with strings that start with a number. So this was a bit of a great occurrence. It will be impossible to do with out custom acquisition software, but TissueVision's software allows it.

Shall we fix this in MaSIV or should we just be crap and create a FAQ that tells users not to have sample IDs that start with a number?

@alexanderbrown
Copy link
Collaborator

I'm seeing if i can come up with a fix. If it's a ballache we'll take the easy route, but i'll just make sure that there isn't an easy fix

@raacampbell
Copy link
Collaborator Author

The easy route is waiting for you if you need it.

@alexanderbrown
Copy link
Collaborator

This may now be fixed in 19e9f26. @Synpaptic please confirm.

@raacampbell
Copy link
Collaborator Author

Doesn't fix it for me. I just mocked this up and it fails with it.

@ghost
Copy link

ghost commented Jan 6, 2017

Works for me

@ghost
Copy link

ghost commented Jan 6, 2017

Confirmed. Rolling back to previous version broke it, and new fixes it again.

@alexanderbrown
Copy link
Collaborator

alexanderbrown commented Jan 6, 2017 via email

@raacampbell
Copy link
Collaborator Author

I think your fix fails if the sample ID is "01". If I rename everything to "10" then it works. I don't know why isnumeric would fail under those circumstances. Maybe there is a different failure point if the first character is zero. Try with the mock up I sent, above.

@ghost
Copy link

ghost commented Jan 6, 2017

Yep, same thing happens here. I was testing with "10," but "01" breaks it

@alexanderbrown
Copy link
Collaborator

alexanderbrown commented Jan 6, 2017 via email

@alexanderbrown
Copy link
Collaborator

alexanderbrown commented Jan 6, 2017 via email

@alexanderbrown
Copy link
Collaborator

Should now be resolved in 2b357eb

The problem was caused when the stackname was read from yaml, converted to numeric and then back in to string, therefore losing the leading zero. I've tweaked the yaml reader to keep any seemingly numeric values as string if they contain leading zeros.

It's possible that this is unwise and could cause some unforeseen problems, but the chances are low and I'm hoping that writing this will reduce those chances further...

@raacampbell
Copy link
Collaborator Author

raacampbell commented Jan 6, 2017

I double-checked that I have the changes pulled but I still don't see the stack appear. At the command line I get this:

>> masiv.yaml.readSimpleYAML('01_Meta.yml')

ans = 

  struct with fields:

             VoxelSize: [1×1 struct]
             stackName: 1
    imageBaseDirectory: '../'

and my YAML file contains:

VoxelSize:
    x: 1
    y: 1
    z: 9

stackName: 01
imageBaseDirectory: ../

So it's definitely importing it as a number. If I get a chance I'll look into this too. If it keeps being annoying we can just list as a known bug and move on.

@alexanderbrown
Copy link
Collaborator

Sorry I tried to replicate this but your example is no longer available

@raacampbell
Copy link
Collaborator Author

Sorry, I put it back. I also see I can drag into a comment to attach it. So here it is:
01_MaSIV.tar.gz

@alexanderbrown
Copy link
Collaborator

Should now be fixed in 8e2739f (I actually tested it this time)

Closing

@raacampbell
Copy link
Collaborator Author

See #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants