plantcv icon indicating copy to clipboard operation
plantcv copied to clipboard

Json to CSV conversion

Open Uzezi93 opened this issue 3 years ago • 7 comments

Hi,

I'm having some issues with my csv observation output. On my csv file, the sample ID is printed on a line different from the measurement values. The line where this sample ID is printed contains NAs.

Uzezi93 avatar Nov 19 '21 17:11 Uzezi93

Hi @Uzezi93, could you upload the JSON and CSV files here? You may need to upload them as a zip file for compatibility with GitHub

nfahlgren avatar Nov 19 '21 17:11 nfahlgren

Sure, here's the link to the JSON and CSV file. https://github.com/Uzezi93/Files/blob/main/Uzezi_ZIP.zip.

Uzezi93 avatar Nov 19 '21 18:11 Uzezi93

I think one thing going on is that there are repeated measurements for each image. By default when you run plantcv-workflow.py more than once with the same output file it appends results to the existing data. This is configurable with the setting append = True/False.

What might have happened is you ran plantcv-workflow.py more than once to troubleshoot and get things working, so there are multiple outputs stored for each image?

If that's the case you could either delete the JSON file and rerun once or set append to false and force it to overwrite the result file.

nfahlgren avatar Nov 19 '21 19:11 nfahlgren

Sorry for my late response. I applied the 'append = False' setting but it still produced an extra line for my output. I'm not sure if the line is in the right position in my script. I added the append command after the pcv.outputs.clear() command. I've also added a link to my script; https://github.com/Uzezi93/Files/blob/main/seedSize_multiplJSON_files_xRice_editFeb14_20.py

Uzezi93 avatar Nov 30 '21 18:11 Uzezi93

Hi @Uzezi93, am I correct in thinking you have an image with multiple seeds and you want to store measurements for them individually?

nfahlgren avatar Nov 30 '21 19:11 nfahlgren

Yes, that's what I'm trying to do.

Uzezi93 avatar Nov 30 '21 20:11 Uzezi93

It's possible to save all the seed measurements into one results file, per input image. We have an example of doing that here (https://plantcv.readthedocs.io/en/stable/tutorials/seed_analysis_tutorial/) using the label feature of the PlantCV analyze functions.

nfahlgren avatar Nov 30 '21 21:11 nfahlgren