I have created a cohort, added some tiles, filtered etc. I now want to export the result, with the tiles as columns, to a table. I point table exported to this cohort but it only yields the EIDs. What do I need to do to get it to yield the other columns?
If you do not have it installed locally, you can run ttyd app or JupyterLab where dx-toolkit should be already installed. This example command worked for me and a csv file was exported:
"participant.eid,participant.p31,participant.p25024_i2" specifies which fields you want to export, I found the coding for "p31", "p25024_i2" etc. in Cohort Browser
You can then "dx upload" the resulting file back to dnax project.
Comments
7 comments
I think you will need to explicitly define all the columns you are interested in.
As an alternative to Table Exporter, you can also try to test the recent dx_extract_dataset feature (which is part of dx toolkit):
https://documentation.dnanexus.com/user/helpstrings-of-sdk-command-line-utilities#extract_dataset
If you do not have it installed locally, you can run ttyd app or JupyterLab where dx-toolkit should be already installed. This example command worked for me and a csv file was exported:
dx extract_dataset record-XXXX --fields "participant.eid,participant.p31,participant.p25024_i2" -o export.csv
record-XXXX should refer to your existing cohort
"participant.eid,participant.p31,participant.p25024_i2" specifies which fields you want to export, I found the coding for "p31", "p25024_i2" etc. in Cohort Browser
You can then "dx upload" the resulting file back to dnax project.
i have dx installed so trying that. not quite sure how to input my cohort i.e. the record-XXXX bit. what goes there exactly?
Each cohort has a unique record-id. One way how you can find it is via clicking on the saved cohort:
Ah that's it, many thanks.
Hello,
Thank you - I have found this thread very useful. One thing I would love, though, is to be able to extract according to UKB_FORMAT headers.
So rather than
I'd prefer
Having looked at the documentation, I can't find an approach similar to this. Is it possible?
Thank you.
Best wishes,
Donald.
Hi Donald,
I don't think it is possible.
As you have found, the dx extract_dataset command doesn't provide options to use ukb-format fields.
The table exporter tool will produce its output in ukb-format, but it expects its input as field names or field titles.
If anybody knows better, please do add an answer.
Hi Rachael,
Ah well. Thank you for your response.
Please sign in to leave a comment.