Uploading metadata TSV file including arrays of length 1
I had included this as a follow-up question a week ago to a previously answered question, but seeing as that problem was solved, I figured a new post would be a better way to ask about this.
How do I specify an array of length 1 in a .tsv file which I will upload as sample metadata? I have a column which I want to contain an array of files (with length 1 in this case) for each sample. Here are the patterns I have tried:
- ["gs://path/to/file.fastq"]
- [gs://path/to/file.fastq]
- [ "gs://path/to/file.fastq" ]
- [ gs://path/to/file.fastq ]
The input seems to be processed as a string, then coerced into an array of length 1 containing that string (e.g. the first input would result in an array ["[\"gs://path/to/file.fastq\"]"] )
It still works if I just upload the value as "gs://path/to/file.fastq", but as you said previously, the coercion from this to an array is not intentional and should not be relied upon, so I wanted to figure out how to get the explicit array input working.
Comments
4 comments
Hello Micah,
["gs://path/to/file.fastq"] (option 1) should be the correct way to do what you have described above.
That's what I figured since that's what it looks like when I download the sample metadata TSV for a workspace with array outputs in the table. However, as I described above, that doesn't work when I upload a TSV file. This includes re-uploading TSV files which I downloaded from metadata tables which contained array outputs of length 1.
Ah, sorry I missed that small detail of uploading the .tsv! Let me take another look at this, Micah. Sorry for that miscommunication.
Micah,
At this time, Terra does not support tsv upload to upload an array but if you were to continue to use just String as you were before, it should continue to work. It looks like it was thought that this shouldn't function but we have tested with some examples and with the fix that was released to deal with the corner case of Optional variables it should be all good to go as String. Please let me know if that is not the case while you run your workflows.
Please sign in to leave a comment.