# UKBiobank Research Analysis Platform (RAP) MatrixTable Write Issues

**URL:** <https://discuss.hail.is/t/ukbiobank-research-analysis-platform-rap-matrixtable-write-issues/2256>\
**Category:** Hail Query & hailctl\
**Created:** [September 20, 2021, 12:15pm UTC](https://discuss.hail.is/t/ukbiobank-research-analysis-platform-rap-matrixtable-write-issues/2256 "2021-09-20T12:15:13Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![jsmadsen](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jsmadsen](https://discuss.hail.is/u/jsmadsen)\
**Post date:** [September 23, 2021, 12:54pm UTC](https://discuss.hail.is/t/ukbiobank-research-analysis-platform-rap-matrixtable-write-issues/2256/11 "2021-09-23T12:54:03Z")

</div>

Alright, here is the right way to go about it as per DNAnexus support:

```auto
import pyspark
import dxpy
import hail as hl

sc = pyspark.SparkContext()
spark = pyspark.sql.SparkSession(sc)

hl.init(sc=sc)

spark.sql("CREATE DATABASE test LOCATION 'dnax://'")

id = dxpy.find_one_data_object(name="test")["id"]
hail_matrixtable.write("dnax://" + id + "/matrix.mt")

mt = hl.read_matrix_table("dnax://database-XXX/matrix.mt")

```

Thank you again for the help.

---

_[View the full topic](https://discuss.hail.is/t/ukbiobank-research-analysis-platform-rap-matrixtable-write-issues/2256)._
