added sample column to case without variables #882
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes
When converting JSON file to csv, the multi-trait lines that do no have values (i.e. NA) are missing the 'sample' column/value (line 76) as compared to the normal case (line 73).
csv.write(",".join(map(str, meta_row + [var, "NA", "NA"])) + "\n")
The 'sample' value was added to the list on line 73.
csv.write(",".join(map(str, meta_row + [sample, var, "NA", "NA"])) + "\n")
Type of update
Is this a:
Associated issues
This change closes issue #881.
Additional context
Before this modification the resulting csv file could result with some rows having one too few columns, resulting in errors during import (at least this was the case using fread of the data.table library from R). With this change everything appears normal.