{"name": "help/user-guide/programmatic-access", "title": "Programmatic Access", "status": "released", "aliases": ["4dn-dcic-lab:help__user-guide__programmatic-access"], "content": [{"lab": {"status": "current", "display_title": "4DN DCIC, HMS", "uuid": "828cd4fe-ebb0-4b36-a94a-d2e3a36cc989", "@id": "/labs/4dn-dcic-lab/", "@type": ["Lab", "Item"], "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.lab_submitter", "submits_for.828cd4fe-ebb0-4b36-a94a-d2e3a36cc989"]}}, "body": "## Overview\n\nThere are several ways to access the metadata and data on the 4DN data portal. The most straightforward and intuitive ways to do so are via the search and browse functionality on the web site.\n\n**search box**\n![search box](https://4dn-dcic-public.s3.amazonaws.com/static-pages/home-page-search-box.png)\n\n**browse menu**\n![browse menu](https://4dn-dcic-public.s3.amazonaws.com/static-pages/home-page-data-browse.png)\n\n The web site also facilitates [downloading files]() individually or in bulk from data sets of interest.\n\nHowever, as you become more familiar with the data sets available from the portal you may want to programmatically access metadata and data.  Additionally, while we provide workbooks and easy to use tools for data submission some advanced users may wish to do submissions programmatically.\n\nThe sections below explain some of the options available.\n", "name": "help.user-guide.data-access.overview", "award": {"status": "current", "@type": ["Award", "Item"], "@id": "/awards/2U01CA200059-06/", "display_title": "4D NUCLEOME NETWORK DATA COORDINATION AND INTEGRATION CENTER - PHASE II", "uuid": "71171a4e-dca1-44cb-8375-fafd896c6923", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin"]}}, "status": "released", "aliases": ["4dn-dcic-lab:help.user-guide.data-access.overview"], "options": {"filetype": "md", "collapsible": false, "default_open": true}, "date_created": "2020-12-18T15:30:29.464313+00:00", "section_type": "Page Section", "submitted_by": {"error": "no view permissions"}, "last_modified": {"modified_by": {"error": "no view permissions"}, "date_modified": "2020-12-18T15:41:23.831166+00:00"}, "schema_version": "2", "@id": "/static-sections/926a23c6-8b15-44cc-8b94-790ade5307d2/", "@type": ["StaticSection", "UserContent", "Item"], "uuid": "926a23c6-8b15-44cc-8b94-790ade5307d2", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.owner", "userid.986b362f-4eb6-4a9c-8173-3ab267227777"]}, "display_title": "help.user-guide.data-access.overview", "external_references": [], "content": "## Overview\n\nThere are several ways to access the metadata and data on the 4DN data portal. The most straightforward and intuitive ways to do so are via the search and browse functionality on the web site.\n\n**search box**\n![search box](https://4dn-dcic-public.s3.amazonaws.com/static-pages/home-page-search-box.png)\n\n**browse menu**\n![browse menu](https://4dn-dcic-public.s3.amazonaws.com/static-pages/home-page-data-browse.png)\n\n The web site also facilitates [downloading files]() individually or in bulk from data sets of interest.\n\nHowever, as you become more familiar with the data sets available from the portal you may want to programmatically access metadata and data.  Additionally, while we provide workbooks and easy to use tools for data submission some advanced users may wish to do submissions programmatically.\n\nThe sections below explain some of the options available.\n", "filetype": "md", "content_as_html": "<div class=\"markdown-container\"><h2>Overview</h2>\n<p>There are several ways to access the metadata and data on the 4DN data portal. The most straightforward and intuitive ways to do so are via the search and browse functionality on the web site.</p>\n<p><strong>search box</strong>\n<img alt=\"search box\" src=\"https://4dn-dcic-public.s3.amazonaws.com/static-pages/home-page-search-box.png\"/></p>\n<p><strong>browse menu</strong>\n<img alt=\"browse menu\" src=\"https://4dn-dcic-public.s3.amazonaws.com/static-pages/home-page-data-browse.png\"/></p>\n<p>The web site also facilitates <a href=\"\">downloading files</a> individually or in bulk from data sets of interest.</p>\n<p>However, as you become more familiar with the data sets available from the portal you may want to programmatically access metadata and data.  Additionally, while we provide workbooks and easy to use tools for data submission some advanced users may wish to do submissions programmatically.</p>\n<p>The sections below explain some of the options available.</p></div>"}, {"lab": {"status": "current", "display_title": "4DN DCIC, HMS", "uuid": "828cd4fe-ebb0-4b36-a94a-d2e3a36cc989", "@id": "/labs/4dn-dcic-lab/", "@type": ["Lab", "Item"], "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.lab_submitter", "submits_for.828cd4fe-ebb0-4b36-a94a-d2e3a36cc989"]}}, "body": "## DCIC utils\n\nIf you program in ```Python``` the 4DN-DCIC has developed and maintains a [package of utilities](https://pypi.org/project/dcicutils/) that contains useful functions for accessing 4DN metadata from the portal.  You can install it with ```pip install dcicutils```\n\nTo get started using this package and for some information on useful functions to access metadata see the [documentation here](https://dcic-utils.readthedocs.io/en/latest/)\n\nIf you've already installed the package and want to see some examples of how you can use it look [here](https://dcic-utils.readthedocs.io/en/latest/examples.html)\n\nIf you don't use ```Python``` expand the **REST API** section below.\n", "name": "help.user-guide.data-access.dcicutils", "award": {"status": "current", "@type": ["Award", "Item"], "@id": "/awards/2U01CA200059-06/", "display_title": "4D NUCLEOME NETWORK DATA COORDINATION AND INTEGRATION CENTER - PHASE II", "uuid": "71171a4e-dca1-44cb-8375-fafd896c6923", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin"]}}, "status": "released", "aliases": ["4dn-dcic-lab:help.user-guide.data-access.dcicutils"], "options": {"filetype": "md", "collapsible": false, "default_open": true}, "date_created": "2020-12-18T15:34:18.726727+00:00", "section_type": "Page Section", "submitted_by": {"error": "no view permissions"}, "last_modified": {"modified_by": {"error": "no view permissions"}, "date_modified": "2020-12-18T15:41:06.867579+00:00"}, "schema_version": "2", "@id": "/static-sections/cf116f08-d23a-455c-bc75-b789625c6472/", "@type": ["StaticSection", "UserContent", "Item"], "uuid": "cf116f08-d23a-455c-bc75-b789625c6472", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.owner", "userid.986b362f-4eb6-4a9c-8173-3ab267227777"]}, "display_title": "help.user-guide.data-access.dcicutils", "external_references": [], "content": "## DCIC utils\n\nIf you program in ```Python``` the 4DN-DCIC has developed and maintains a [package of utilities](https://pypi.org/project/dcicutils/) that contains useful functions for accessing 4DN metadata from the portal.  You can install it with ```pip install dcicutils```\n\nTo get started using this package and for some information on useful functions to access metadata see the [documentation here](https://dcic-utils.readthedocs.io/en/latest/)\n\nIf you've already installed the package and want to see some examples of how you can use it look [here](https://dcic-utils.readthedocs.io/en/latest/examples.html)\n\nIf you don't use ```Python``` expand the **REST API** section below.\n", "filetype": "md", "content_as_html": "<div class=\"markdown-container\"><h2>DCIC utils</h2>\n<p>If you program in <code>Python</code> the 4DN-DCIC has developed and maintains a <a href=\"https://pypi.org/project/dcicutils/\" rel=\"noopener noreferrer\" target=\"_blank\">package of utilities</a> that contains useful functions for accessing 4DN metadata from the portal.  You can install it with <code>pip install dcicutils</code></p>\n<p>To get started using this package and for some information on useful functions to access metadata see the <a href=\"https://dcic-utils.readthedocs.io/en/latest/\" rel=\"noopener noreferrer\" target=\"_blank\">documentation here</a></p>\n<p>If you've already installed the package and want to see some examples of how you can use it look <a href=\"https://dcic-utils.readthedocs.io/en/latest/examples.html\" rel=\"noopener noreferrer\" target=\"_blank\">here</a></p>\n<p>If you don't use <code>Python</code> expand the <strong>REST API</strong> section below.</p></div>"}, {"lab": {"status": "current", "display_title": "4DN DCIC, HMS", "uuid": "828cd4fe-ebb0-4b36-a94a-d2e3a36cc989", "@id": "/labs/4dn-dcic-lab/", "@type": ["Lab", "Item"], "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.lab_submitter", "submits_for.828cd4fe-ebb0-4b36-a94a-d2e3a36cc989"]}}, "body": "Overview\n========\n\nThe 4DN-DCIC metadata database can be accessed using a Hypertext-Transfer-Protocol-(HTTP)-based, Representational-state-transfer (RESTful) application programming interface (API) - aka the REST API. In fact, this API is used by the ``import_data`` script used to submit metadata entered into excel spreadsheets as described `on this page </help/submitter-guide/spreadsheet-submission>`_. This API was developed by the `ENCODE`_ project so if you have experience retrieving data from or submitting data to ENCODE, use of the 4DN-DCIC API should be familiar to you. The REST API can be used both for data submission and data retrieval, typically using scripts written in your language of choice. Data objects exchanged with the server conform to the standard JavaScript Object Notation (JSON) format. Libraries written for use with your chosen language are typically used for the network connection, data transfer, and parsing of data (for example, requests and json, respectively for Python). For a good introduction to scripting data retrieval (using GET requests) you can refer to `this page <https://www.encodeproject.org/help/rest-api/>`_ on the `ENCODE`_ web site that also has a good introduction to viewing and understanding JSON formatted data.\n\n.. _ENCODE: https://www.encodeproject.org/\n\nConnecting to the server\n========================\n\nYour script will need to use an access key and secret that you can obtain by following `these instructions </help/submitter-guide/getting-started-with-submissions#getting-connection-keys-for-the-4dn-dcic-servers>`_ to connect to the server. Exactly how you format and pass the connection information to the server depends on your scripting language and the libraries that you use with it.\n\n**Base URL for submitting and fetching data are:** `<https://data.4dnucleome.org/>`_\n\nYou can refer to the ``FDN_key`` and ``FDN_connection`` classes in `the get_field_info.py library <https://github.com/4dn-dcic/Submit4DN/blob/master/wranglertools/get_field_info.py>`_ in Submit4DN for an example of how to generate the necessary information that will be passed to the server with each request.\n\nIdentifying specific items\n==========================\n\nYour script will need to add a uniquely identifying token to the Base URL in order to GET, POST or PATCH metadata for that item. IDs that can be used include: uuids, accessions, certain type specific identifiers and aliases. See the sections on `'Using Aliases' and 'Referencing existing items' </help/submitter-guide/getting-started-with-submissions#referencing-existing-objects>`_ for the types of identifiers that can be used in your requests.\n\nOrdering of POST requests\n=========================\n\nBecause in many cases fields in one Item may refer to another Item, e.g., the ``biosample`` field in the ``experiment_hi_c`` schema, it is necessary to POST the referenced item prior to POSTing the item that refers to it. A sensible POSTing order is specified in the ``sheet_order`` array located around line 228 in the `get_field_info.py <https://github.com/4dn-dcic/Submit4DN/blob/master/wranglertools/get_field_info.py>`_ library.\n\nJSON formatting\n===============\n\nThe most important component of your submission is the proper formatting of the data into json so it will map correctly onto the 4DN metadata schemas. The details of the schemas for all object types in the database can be viewed at `<https://data.4dnucleome.org/profiles/>`_. Individual schemas can be viewed and/or retrieved via GET by appending the schema file name to the above URL (e.g., for the Hi-C experiment schema `<https://data.4dnucleome.org/profiles/experiment_hi_c.json>`_). For a listing of all schema files and associated resource names see `this table </help/submitter-guide/getting-started-with-submissions#schema-information>`_, which should be up to date with the current schemas in the database.\n\nDepending on the Item type that you are submitting there may be fields that require values (e.g., *experiment_type* for experiments), fields for which values should never be submitted (e.g., \u2018date_created\u2019 as this is an automatically generated value) and fields with specific formatting and fields that accept values of specific types. In many cases, the values must be selected from a list of constrained choices. The documentation on field values `described in detail here </help/submitter-guide/spreadsheet-submission#preparing-excel-workbooks>`_ and the annotated json document below can be used as a guide on formatting your json. In addition, the unordered and unfiltered excel workbooks produced by ``get_field_info`` can be a useful reference for determining exactly what fields are associated with what object types. The processed workbook that is actually used for data submission does not reflect the exact schema structure **should not** be used as a direct reference for API submission.\n\n**JSON for an ExperimentHiC POST request** ::\n\n    {\n        \"lab\": \"4dn-dcic-lab\",\n        \"award\": \"/awards/OD008540-01/\",\n        \"aliases\": [\"dcic:myalias\"]\n        \"experiment_type\": \"in situ Hi-C\",\n        \"biosample\":\"4DNBS1NUPXMH\",\n        \"biosample_quantity\": 2000000,\n        \"biosample_quantity_units\": \"cells\",\n        \"dbxrefs\": [\"SRA:SRX764985\", \"GEO:GSM1551599\"],\n        \"description\": \"A useful description of this experiment\",\n        \"documents\": [\"dcf15d5e-40aa-43bc-b81c-32c70c9afb01\"],\n        \"experiment_relation\":[{\"relationship_type\":\"controlled by\",\"experiment\":\"4DNEX067APU1\"}],\n        \"experiment_sets\":[\"431106bc-8535-4448-903e-854af460b260\"],\n        \"files\": [\"4DNFI067APU1\", \"4DNFI067APU2\", \"4DNFI067APA1\"],\n        \"filesets\": [\"4d6ecff9-7c67-4096-bca8-515246767feb\"],\n        \"follows_sop\": \"Yes\",\n        \"crosslinking_method\": \"1% Formaldehyde\",\n        \"crosslinking_time\": 30,\n        \"crosslinking_temperature\": 37,\n        \"digestion_enzyme\": \"MboI\",\n        \"enzyme_lot_number\": \"123456\",\n        \"digestion_temperature\": 37,\n        \"digestion_time\": 30,\n        \"ligation_time\": 30,\n        \"ligation_temperature\": 37,\n        \"ligation_volume\": 1,\n        \"tagging_method\": \"Biotinylated ATP\",\n        \"fragmentation_method\": \"chemical\",\n        \"average_fragment_size\": 100,\n        \"notes\": \"sample dcic notes\",\n        \"protocol\": \"131106bc-8535-4448-903e-854af460b244\"\n    }\n\n**Field specification - how to find out what fields need what format, when to provide values and other useful tips**\n\nThe three fields below are common to every Item - you don't always need to include aliases but they will make some things a lot easier.::\n\n    \"lab\": \"4dn-dcic-lab\",  # required for POST with value of an existing lab identifier - this is an alias\n    \"award\": \"/awards/OD008540-01/\", # required for POST with value of an existing award identifier - this a specific item type identifier\n    \"aliases\": [\"dcic:myalias\", \"dcic:myotheralias\"], # POST or PATCH an array with values that can be used as identifiers\n\nAccession and uuid are automatically assigned during initial posting so can only be used as identifiers to PATCH existing Items - not for POSTing. Note that all item types have a uuid but not all items have accessions.::\n\n    \"accession\":\"4DNEX067APU1\", # PATCH ONLY can be used as an identifier - automatically assigned on POST\n    \"uuid\": \"75041e2f-3e43-4388-8bbb-e861f209c444\", # PATCH ONLY can be used as an identifier - automatically assigned on POST\n\nWhile we encourage you to submit as many fields as possible there are some fields that are absolutely required to post an item. These required fields are identified in the \"required\" field of the schema.::\n\n    \"required\": [\n        \"experiment_type\",\n        \"award\",\n        \"lab\",\n        \"biosample\"\n    ],\n\nIf they are left out of a POST request will cause an error. You don't need to include required fields if you are PATCHing an existing Item.::\n\n    \"experiment_type\": \"in situ Hi-C\", # required for POST string field\n    \"biosample\":\"231111bc-8535-4448-903e-854af460b254\", # required for POST with value of an alias used in Biosample sheet or previously existing biosample identifier\n\nThere are number fields and string fields - the field type can be found by referring to the schema directly or the workbook templates produced by ``get_field_info``. ::\n\n   \"biosample_quantity_units\": {\n        \"title\": \"Quantity Units\",\n        \"description\": \"The units that go along with the biological sample quantity\",\n        \"enum\": [\n            \"g\",\n            \"mg\",\n            \"cells\",\n            \"\u00b5l\",\n            \"ml\",\n            \"ng/\u00b5l\",\n            \"nM\"\n        ],\n        \"type\": \"string\"\n    },\n\nAs you can see the specific field can be found by searching through the schema. If the field is an enum type (sometimes the choices are referred to as controlled vocabularies) your value must match one of the possible entries exactly.::\n\n   \"crosslinking_method\": {\n        \"title\": \"Crosslinking Method\",\n        \"description\": \"The method by which the sample was crosslinked\",\n        \"enum\": [\n            \"3% Formaldehyde\",\n            \"1% Formaldehyde\",\n            \"Fresh Frozen\"\n        ],\n        \"type\": \"string\"\n    },\n\nDates should be submitted in a standard way. Here's an example of an automatically generated date ::\n\n    \"date_created\": \"2017-06-27T16:12:02.601238+00:00\"\n\nA full list of the Item types and their fields is also presented in `this table </help/submitter-guide/getting-started-with-submissions#field-tips>`__. Note that the list below is not complete, but is focused on the most commonly used fields.\n", "name": "help.user-guide.rest-api.rest-api", "award": {"status": "current", "@type": ["Award", "Item"], "@id": "/awards/2U01CA200059-06/", "display_title": "4D NUCLEOME NETWORK DATA COORDINATION AND INTEGRATION CENTER - PHASE II", "uuid": "71171a4e-dca1-44cb-8375-fafd896c6923", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin"]}}, "title": "REST API", "status": "released", "aliases": ["dcic:help.user-guide.rest-api.rest-api"], "options": {"filetype": "rst", "collapsible": true, "default_open": false, "convert_ext_links": true}, "date_created": "2018-02-07T14:55:43.650268+00:00", "section_type": "Page Section", "submitted_by": {"error": "no view permissions"}, "last_modified": {"modified_by": {"error": "no view permissions"}, "date_modified": "2024-08-19T22:06:56.082039+00:00"}, "schema_version": "2", "@id": "/static-sections/442c8aa0-dc6c-43d7-814a-854af460b020/", "@type": ["StaticSection", "UserContent", "Item"], "uuid": "442c8aa0-dc6c-43d7-814a-854af460b020", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.owner", "userid.986b362f-4eb6-4a9c-8173-3ab267307e3a"]}, "display_title": "REST API", "external_references": [], "content": "Overview\n========\n\nThe 4DN-DCIC metadata database can be accessed using a Hypertext-Transfer-Protocol-(HTTP)-based, Representational-state-transfer (RESTful) application programming interface (API) - aka the REST API. In fact, this API is used by the ``import_data`` script used to submit metadata entered into excel spreadsheets as described `on this page </help/submitter-guide/spreadsheet-submission>`_. This API was developed by the `ENCODE`_ project so if you have experience retrieving data from or submitting data to ENCODE, use of the 4DN-DCIC API should be familiar to you. The REST API can be used both for data submission and data retrieval, typically using scripts written in your language of choice. Data objects exchanged with the server conform to the standard JavaScript Object Notation (JSON) format. Libraries written for use with your chosen language are typically used for the network connection, data transfer, and parsing of data (for example, requests and json, respectively for Python). For a good introduction to scripting data retrieval (using GET requests) you can refer to `this page <https://www.encodeproject.org/help/rest-api/>`_ on the `ENCODE`_ web site that also has a good introduction to viewing and understanding JSON formatted data.\n\n.. _ENCODE: https://www.encodeproject.org/\n\nConnecting to the server\n========================\n\nYour script will need to use an access key and secret that you can obtain by following `these instructions </help/submitter-guide/getting-started-with-submissions#getting-connection-keys-for-the-4dn-dcic-servers>`_ to connect to the server. Exactly how you format and pass the connection information to the server depends on your scripting language and the libraries that you use with it.\n\n**Base URL for submitting and fetching data are:** `<https://data.4dnucleome.org/>`_\n\nYou can refer to the ``FDN_key`` and ``FDN_connection`` classes in `the get_field_info.py library <https://github.com/4dn-dcic/Submit4DN/blob/master/wranglertools/get_field_info.py>`_ in Submit4DN for an example of how to generate the necessary information that will be passed to the server with each request.\n\nIdentifying specific items\n==========================\n\nYour script will need to add a uniquely identifying token to the Base URL in order to GET, POST or PATCH metadata for that item. IDs that can be used include: uuids, accessions, certain type specific identifiers and aliases. See the sections on `'Using Aliases' and 'Referencing existing items' </help/submitter-guide/getting-started-with-submissions#referencing-existing-objects>`_ for the types of identifiers that can be used in your requests.\n\nOrdering of POST requests\n=========================\n\nBecause in many cases fields in one Item may refer to another Item, e.g., the ``biosample`` field in the ``experiment_hi_c`` schema, it is necessary to POST the referenced item prior to POSTing the item that refers to it. A sensible POSTing order is specified in the ``sheet_order`` array located around line 228 in the `get_field_info.py <https://github.com/4dn-dcic/Submit4DN/blob/master/wranglertools/get_field_info.py>`_ library.\n\nJSON formatting\n===============\n\nThe most important component of your submission is the proper formatting of the data into json so it will map correctly onto the 4DN metadata schemas. The details of the schemas for all object types in the database can be viewed at `<https://data.4dnucleome.org/profiles/>`_. Individual schemas can be viewed and/or retrieved via GET by appending the schema file name to the above URL (e.g., for the Hi-C experiment schema `<https://data.4dnucleome.org/profiles/experiment_hi_c.json>`_). For a listing of all schema files and associated resource names see `this table </help/submitter-guide/getting-started-with-submissions#schema-information>`_, which should be up to date with the current schemas in the database.\n\nDepending on the Item type that you are submitting there may be fields that require values (e.g., *experiment_type* for experiments), fields for which values should never be submitted (e.g., \u2018date_created\u2019 as this is an automatically generated value) and fields with specific formatting and fields that accept values of specific types. In many cases, the values must be selected from a list of constrained choices. The documentation on field values `described in detail here </help/submitter-guide/spreadsheet-submission#preparing-excel-workbooks>`_ and the annotated json document below can be used as a guide on formatting your json. In addition, the unordered and unfiltered excel workbooks produced by ``get_field_info`` can be a useful reference for determining exactly what fields are associated with what object types. The processed workbook that is actually used for data submission does not reflect the exact schema structure **should not** be used as a direct reference for API submission.\n\n**JSON for an ExperimentHiC POST request** ::\n\n    {\n        \"lab\": \"4dn-dcic-lab\",\n        \"award\": \"/awards/OD008540-01/\",\n        \"aliases\": [\"dcic:myalias\"]\n        \"experiment_type\": \"in situ Hi-C\",\n        \"biosample\":\"4DNBS1NUPXMH\",\n        \"biosample_quantity\": 2000000,\n        \"biosample_quantity_units\": \"cells\",\n        \"dbxrefs\": [\"SRA:SRX764985\", \"GEO:GSM1551599\"],\n        \"description\": \"A useful description of this experiment\",\n        \"documents\": [\"dcf15d5e-40aa-43bc-b81c-32c70c9afb01\"],\n        \"experiment_relation\":[{\"relationship_type\":\"controlled by\",\"experiment\":\"4DNEX067APU1\"}],\n        \"experiment_sets\":[\"431106bc-8535-4448-903e-854af460b260\"],\n        \"files\": [\"4DNFI067APU1\", \"4DNFI067APU2\", \"4DNFI067APA1\"],\n        \"filesets\": [\"4d6ecff9-7c67-4096-bca8-515246767feb\"],\n        \"follows_sop\": \"Yes\",\n        \"crosslinking_method\": \"1% Formaldehyde\",\n        \"crosslinking_time\": 30,\n        \"crosslinking_temperature\": 37,\n        \"digestion_enzyme\": \"MboI\",\n        \"enzyme_lot_number\": \"123456\",\n        \"digestion_temperature\": 37,\n        \"digestion_time\": 30,\n        \"ligation_time\": 30,\n        \"ligation_temperature\": 37,\n        \"ligation_volume\": 1,\n        \"tagging_method\": \"Biotinylated ATP\",\n        \"fragmentation_method\": \"chemical\",\n        \"average_fragment_size\": 100,\n        \"notes\": \"sample dcic notes\",\n        \"protocol\": \"131106bc-8535-4448-903e-854af460b244\"\n    }\n\n**Field specification - how to find out what fields need what format, when to provide values and other useful tips**\n\nThe three fields below are common to every Item - you don't always need to include aliases but they will make some things a lot easier.::\n\n    \"lab\": \"4dn-dcic-lab\",  # required for POST with value of an existing lab identifier - this is an alias\n    \"award\": \"/awards/OD008540-01/\", # required for POST with value of an existing award identifier - this a specific item type identifier\n    \"aliases\": [\"dcic:myalias\", \"dcic:myotheralias\"], # POST or PATCH an array with values that can be used as identifiers\n\nAccession and uuid are automatically assigned during initial posting so can only be used as identifiers to PATCH existing Items - not for POSTing. Note that all item types have a uuid but not all items have accessions.::\n\n    \"accession\":\"4DNEX067APU1\", # PATCH ONLY can be used as an identifier - automatically assigned on POST\n    \"uuid\": \"75041e2f-3e43-4388-8bbb-e861f209c444\", # PATCH ONLY can be used as an identifier - automatically assigned on POST\n\nWhile we encourage you to submit as many fields as possible there are some fields that are absolutely required to post an item. These required fields are identified in the \"required\" field of the schema.::\n\n    \"required\": [\n        \"experiment_type\",\n        \"award\",\n        \"lab\",\n        \"biosample\"\n    ],\n\nIf they are left out of a POST request will cause an error. You don't need to include required fields if you are PATCHing an existing Item.::\n\n    \"experiment_type\": \"in situ Hi-C\", # required for POST string field\n    \"biosample\":\"231111bc-8535-4448-903e-854af460b254\", # required for POST with value of an alias used in Biosample sheet or previously existing biosample identifier\n\nThere are number fields and string fields - the field type can be found by referring to the schema directly or the workbook templates produced by ``get_field_info``. ::\n\n   \"biosample_quantity_units\": {\n        \"title\": \"Quantity Units\",\n        \"description\": \"The units that go along with the biological sample quantity\",\n        \"enum\": [\n            \"g\",\n            \"mg\",\n            \"cells\",\n            \"\u00b5l\",\n            \"ml\",\n            \"ng/\u00b5l\",\n            \"nM\"\n        ],\n        \"type\": \"string\"\n    },\n\nAs you can see the specific field can be found by searching through the schema. If the field is an enum type (sometimes the choices are referred to as controlled vocabularies) your value must match one of the possible entries exactly.::\n\n   \"crosslinking_method\": {\n        \"title\": \"Crosslinking Method\",\n        \"description\": \"The method by which the sample was crosslinked\",\n        \"enum\": [\n            \"3% Formaldehyde\",\n            \"1% Formaldehyde\",\n            \"Fresh Frozen\"\n        ],\n        \"type\": \"string\"\n    },\n\nDates should be submitted in a standard way. Here's an example of an automatically generated date ::\n\n    \"date_created\": \"2017-06-27T16:12:02.601238+00:00\"\n\nA full list of the Item types and their fields is also presented in `this table </help/submitter-guide/getting-started-with-submissions#field-tips>`__. Note that the list below is not complete, but is focused on the most commonly used fields.\n", "filetype": "rst", "content_as_html": "<div class=\"rst-container\"><h2>Overview</h2><p>The 4DN-DCIC metadata database can be accessed using a Hypertext-Transfer-Protocol-(HTTP)-based, Representational-state-transfer (RESTful) application programming interface (API) - aka the REST API. In fact, this API is used by the <code>import_data</code> script used to submit metadata entered into excel spreadsheets as described <a class=\"reference external\" href=\"/help/submitter-guide/spreadsheet-submission\">on this page</a>. This API was developed by the <a class=\"reference external\" href=\"https://www.encodeproject.org/\" rel=\"noopener noreferrer\" target=\"_blank\">ENCODE</a> project so if you have experience retrieving data from or submitting data to ENCODE, use of the 4DN-DCIC API should be familiar to you. The REST API can be used both for data submission and data retrieval, typically using scripts written in your language of choice. Data objects exchanged with the server conform to the standard JavaScript Object Notation (JSON) format. Libraries written for use with your chosen language are typically used for the network connection, data transfer, and parsing of data (for example, requests and json, respectively for Python). For a good introduction to scripting data retrieval (using GET requests) you can refer to <a class=\"reference external\" href=\"https://www.encodeproject.org/help/rest-api/\" rel=\"noopener noreferrer\" target=\"_blank\">this page</a> on the <a class=\"reference external\" href=\"https://www.encodeproject.org/\" rel=\"noopener noreferrer\" target=\"_blank\">ENCODE</a> web site that also has a good introduction to viewing and understanding JSON formatted data.</p><h2>Connecting to the server</h2><p>Your script will need to use an access key and secret that you can obtain by following <a class=\"reference external\" href=\"/help/submitter-guide/getting-started-with-submissions#getting-connection-keys-for-the-4dn-dcic-servers\">these instructions</a> to connect to the server. Exactly how you format and pass the connection information to the server depends on your scripting language and the libraries that you use with it.</p><p><strong>Base URL for submitting and fetching data are:</strong> <a class=\"reference external\" href=\"https://data.4dnucleome.org/\" rel=\"noopener noreferrer\" target=\"_blank\">https://data.4dnucleome.org/</a></p><p>You can refer to the <code>FDN_key</code> and <code>FDN_connection</code> classes in <a class=\"reference external\" href=\"https://github.com/4dn-dcic/Submit4DN/blob/master/wranglertools/get_field_info.py\" rel=\"noopener noreferrer\" target=\"_blank\">the get_field_info.py library</a> in Submit4DN for an example of how to generate the necessary information that will be passed to the server with each request.</p><h2>Identifying specific items</h2><p>Your script will need to add a uniquely identifying token to the Base URL in order to GET, POST or PATCH metadata for that item. IDs that can be used include: uuids, accessions, certain type specific identifiers and aliases. See the sections on <a class=\"reference external\" href=\"/help/submitter-guide/getting-started-with-submissions#referencing-existing-objects\">'Using Aliases' and 'Referencing existing items'</a> for the types of identifiers that can be used in your requests.</p><h2>Ordering of POST requests</h2><p>Because in many cases fields in one Item may refer to another Item, e.g., the <code>biosample</code> field in the <code>experiment_hi_c</code> schema, it is necessary to POST the referenced item prior to POSTing the item that refers to it. A sensible POSTing order is specified in the <code>sheet_order</code> array located around line 228 in the <a class=\"reference external\" href=\"https://github.com/4dn-dcic/Submit4DN/blob/master/wranglertools/get_field_info.py\" rel=\"noopener noreferrer\" target=\"_blank\">get_field_info.py</a> library.</p><h2>JSON formatting</h2><p>The most important component of your submission is the proper formatting of the data into json so it will map correctly onto the 4DN metadata schemas. The details of the schemas for all object types in the database can be viewed at <a class=\"reference external\" href=\"https://data.4dnucleome.org/profiles/\" rel=\"noopener noreferrer\" target=\"_blank\">https://data.4dnucleome.org/profiles/</a>. Individual schemas can be viewed and/or retrieved via GET by appending the schema file name to the above URL (e.g., for the Hi-C experiment schema <a class=\"reference external\" href=\"https://data.4dnucleome.org/profiles/experiment_hi_c.json\" rel=\"noopener noreferrer\" target=\"_blank\">https://data.4dnucleome.org/profiles/experiment_hi_c.json</a>). For a listing of all schema files and associated resource names see <a class=\"reference external\" href=\"/help/submitter-guide/getting-started-with-submissions#schema-information\">this table</a>, which should be up to date with the current schemas in the database.</p><p>Depending on the Item type that you are submitting there may be fields that require values (e.g., <em>experiment_type</em> for experiments), fields for which values should never be submitted (e.g., \u2018date_created\u2019 as this is an automatically generated value) and fields with specific formatting and fields that accept values of specific types. In many cases, the values must be selected from a list of constrained choices. The documentation on field values <a class=\"reference external\" href=\"/help/submitter-guide/spreadsheet-submission#preparing-excel-workbooks\">described in detail here</a> and the annotated json document below can be used as a guide on formatting your json. In addition, the unordered and unfiltered excel workbooks produced by <code>get_field_info</code> can be a useful reference for determining exactly what fields are associated with what object types. The processed workbook that is actually used for data submission does not reflect the exact schema structure <strong>should not</strong> be used as a direct reference for API submission.</p><p><strong>JSON for an ExperimentHiC POST request</strong></p><pre class=\"literal-block\">\n{\n    \"lab\": \"4dn-dcic-lab\",\n    \"award\": \"/awards/OD008540-01/\",\n    \"aliases\": [\"dcic:myalias\"]\n    \"experiment_type\": \"in situ Hi-C\",\n    \"biosample\":\"4DNBS1NUPXMH\",\n    \"biosample_quantity\": 2000000,\n    \"biosample_quantity_units\": \"cells\",\n    \"dbxrefs\": [\"SRA:SRX764985\", \"GEO:GSM1551599\"],\n    \"description\": \"A useful description of this experiment\",\n    \"documents\": [\"dcf15d5e-40aa-43bc-b81c-32c70c9afb01\"],\n    \"experiment_relation\":[{\"relationship_type\":\"controlled by\",\"experiment\":\"4DNEX067APU1\"}],\n    \"experiment_sets\":[\"431106bc-8535-4448-903e-854af460b260\"],\n    \"files\": [\"4DNFI067APU1\", \"4DNFI067APU2\", \"4DNFI067APA1\"],\n    \"filesets\": [\"4d6ecff9-7c67-4096-bca8-515246767feb\"],\n    \"follows_sop\": \"Yes\",\n    \"crosslinking_method\": \"1% Formaldehyde\",\n    \"crosslinking_time\": 30,\n    \"crosslinking_temperature\": 37,\n    \"digestion_enzyme\": \"MboI\",\n    \"enzyme_lot_number\": \"123456\",\n    \"digestion_temperature\": 37,\n    \"digestion_time\": 30,\n    \"ligation_time\": 30,\n    \"ligation_temperature\": 37,\n    \"ligation_volume\": 1,\n    \"tagging_method\": \"Biotinylated ATP\",\n    \"fragmentation_method\": \"chemical\",\n    \"average_fragment_size\": 100,\n    \"notes\": \"sample dcic notes\",\n    \"protocol\": \"131106bc-8535-4448-903e-854af460b244\"\n}\n</pre><p><strong>Field specification - how to find out what fields need what format, when to provide values and other useful tips</strong></p><p>The three fields below are common to every Item - you don't always need to include aliases but they will make some things a lot easier.:</p><pre class=\"literal-block\">\n\"lab\": \"4dn-dcic-lab\",  # required for POST with value of an existing lab identifier - this is an alias\n\"award\": \"/awards/OD008540-01/\", # required for POST with value of an existing award identifier - this a specific item type identifier\n\"aliases\": [\"dcic:myalias\", \"dcic:myotheralias\"], # POST or PATCH an array with values that can be used as identifiers\n</pre><p>Accession and uuid are automatically assigned during initial posting so can only be used as identifiers to PATCH existing Items - not for POSTing. Note that all item types have a uuid but not all items have accessions.:</p><pre class=\"literal-block\">\n\"accession\":\"4DNEX067APU1\", # PATCH ONLY can be used as an identifier - automatically assigned on POST\n\"uuid\": \"75041e2f-3e43-4388-8bbb-e861f209c444\", # PATCH ONLY can be used as an identifier - automatically assigned on POST\n</pre><p>While we encourage you to submit as many fields as possible there are some fields that are absolutely required to post an item. These required fields are identified in the \"required\" field of the schema.:</p><pre class=\"literal-block\">\n\"required\": [\n    \"experiment_type\",\n    \"award\",\n    \"lab\",\n    \"biosample\"\n],\n</pre><p>If they are left out of a POST request will cause an error. You don't need to include required fields if you are PATCHing an existing Item.:</p><pre class=\"literal-block\">\n\"experiment_type\": \"in situ Hi-C\", # required for POST string field\n\"biosample\":\"231111bc-8535-4448-903e-854af460b254\", # required for POST with value of an alias used in Biosample sheet or previously existing biosample identifier\n</pre><p>There are number fields and string fields - the field type can be found by referring to the schema directly or the workbook templates produced by <code>get_field_info</code>.</p><pre class=\"literal-block\">\n\"biosample_quantity_units\": {\n     \"title\": \"Quantity Units\",\n     \"description\": \"The units that go along with the biological sample quantity\",\n     \"enum\": [\n         \"g\",\n         \"mg\",\n         \"cells\",\n         \"\u00b5l\",\n         \"ml\",\n         \"ng/\u00b5l\",\n         \"nM\"\n     ],\n     \"type\": \"string\"\n },\n</pre><p>As you can see the specific field can be found by searching through the schema. If the field is an enum type (sometimes the choices are referred to as controlled vocabularies) your value must match one of the possible entries exactly.:</p><pre class=\"literal-block\">\n\"crosslinking_method\": {\n     \"title\": \"Crosslinking Method\",\n     \"description\": \"The method by which the sample was crosslinked\",\n     \"enum\": [\n         \"3% Formaldehyde\",\n         \"1% Formaldehyde\",\n         \"Fresh Frozen\"\n     ],\n     \"type\": \"string\"\n },\n</pre><p>Dates should be submitted in a standard way. Here's an example of an automatically generated date</p><pre class=\"literal-block\">\n\"date_created\": \"2017-06-27T16:12:02.601238+00:00\"\n</pre><p>A full list of the Item types and their fields is also presented in <a class=\"reference external\" href=\"/help/submitter-guide/getting-started-with-submissions#field-tips\">this table</a>. Note that the list below is not complete, but is focused on the most commonly used fields.</p></div>"}, {"lab": {"status": "current", "display_title": "4DN DCIC, HMS", "uuid": "828cd4fe-ebb0-4b36-a94a-d2e3a36cc989", "@id": "/labs/4dn-dcic-lab/", "@type": ["Lab", "Item"], "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.lab_submitter", "submits_for.828cd4fe-ebb0-4b36-a94a-d2e3a36cc989"]}}, "body": "File download from the 4DN data portal now requires \nauthentication, even if the file is public. Accounts can be \ncreated by anyone, including those not part of the 4DN \nNetwork; for more information on account creation, see the \n[Account Creation](/help/user-guide/account-creation) page. \nFiles can be downloaded from the web portal after logging \nin, as usual; for file download from the command line, the \nprocess is described below.\n\nFirst you need to create a new access key, if you don't have \nan access key already. Note that access keys created for \nJupyterhub can't be used for the rest of the portal.\n\nTo create a new access key, first log in to the data portal, \nthen click on your account in the upper right and click on \nProfile from the dropdown menu. There will be a button near \nthe bottom of the page to add an access key. Save the key \nand secret; typically this is done by creating a file in \nyour home directory called `keypairs.json` with the \nfollowing contents/format (replacing the x\u2019s with the \nappropriate key and secret, of course): ::\n\n  {\n    \"default\": {\n        \"key\": \"XXXXXXXX\",\n        \"secret\": \"xxxxxxxxxxxxxxxx\",\n        \"server\": \"https://data.4dnucleome.org\"\n    }\n  }\n \nOnce the access key is created and stored, the file can be \ndownloaded via curl with the following command: ::\n\n  curl -O -L --user <key>:<secret> <download-url>\n\nFor more information on file downloads see this `page <https://data.4dnucleome.org/help/user-guide/downloading-files>`_\n", "name": "help.downloading-files.downloading-files", "award": {"status": "current", "@type": ["Award", "Item"], "@id": "/awards/2U01CA200059-06/", "display_title": "4D NUCLEOME NETWORK DATA COORDINATION AND INTEGRATION CENTER - PHASE II", "uuid": "71171a4e-dca1-44cb-8375-fafd896c6923", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin"]}}, "title": "Downloading Files", "status": "released", "aliases": ["4dn-dcic-lab:downloading-files"], "options": {"filetype": "rst", "collapsible": false, "default_open": true, "convert_ext_links": true}, "date_created": "2020-12-15T19:11:40.007935+00:00", "section_type": "Page Section", "submitted_by": {"error": "no view permissions"}, "last_modified": {"modified_by": {"error": "no view permissions"}, "date_modified": "2024-08-19T21:19:08.224464+00:00"}, "schema_version": "2", "@id": "/static-sections/1fc42873-f4a8-4b1b-b0b1-b70954bd65ca/", "@type": ["StaticSection", "UserContent", "Item"], "uuid": "1fc42873-f4a8-4b1b-b0b1-b70954bd65ca", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.owner", "userid.e2324f87-0625-4bbc-803b-d47677aebe08"]}, "display_title": "Downloading Files", "external_references": [], "content": "File download from the 4DN data portal now requires \nauthentication, even if the file is public. Accounts can be \ncreated by anyone, including those not part of the 4DN \nNetwork; for more information on account creation, see the \n[Account Creation](/help/user-guide/account-creation) page. \nFiles can be downloaded from the web portal after logging \nin, as usual; for file download from the command line, the \nprocess is described below.\n\nFirst you need to create a new access key, if you don't have \nan access key already. Note that access keys created for \nJupyterhub can't be used for the rest of the portal.\n\nTo create a new access key, first log in to the data portal, \nthen click on your account in the upper right and click on \nProfile from the dropdown menu. There will be a button near \nthe bottom of the page to add an access key. Save the key \nand secret; typically this is done by creating a file in \nyour home directory called `keypairs.json` with the \nfollowing contents/format (replacing the x\u2019s with the \nappropriate key and secret, of course): ::\n\n  {\n    \"default\": {\n        \"key\": \"XXXXXXXX\",\n        \"secret\": \"xxxxxxxxxxxxxxxx\",\n        \"server\": \"https://data.4dnucleome.org\"\n    }\n  }\n \nOnce the access key is created and stored, the file can be \ndownloaded via curl with the following command: ::\n\n  curl -O -L --user <key>:<secret> <download-url>\n\nFor more information on file downloads see this `page <https://data.4dnucleome.org/help/user-guide/downloading-files>`_\n", "filetype": "rst", "content_as_html": "<div class=\"rst-container\"><p>File download from the 4DN data portal now requiresauthentication, even if the file is public. Accounts can becreated by anyone, including those not part of the 4DNNetwork; for more information on account creation, see the[Account Creation](/help/user-guide/account-creation) page.Files can be downloaded from the web portal after loggingin, as usual; for file download from the command line, theprocess is described below.</p><p>First you need to create a new access key, if you don't havean access key already. Note that access keys created forJupyterhub can't be used for the rest of the portal.</p><p>To create a new access key, first log in to the data portal,then click on your account in the upper right and click onProfile from the dropdown menu. There will be a button nearthe bottom of the page to add an access key. Save the keyand secret; typically this is done by creating a file inyour home directory called <cite>keypairs.json</cite> with thefollowing contents/format (replacing the x\u2019s with theappropriate key and secret, of course):</p><pre class=\"literal-block\">\n{\n  \"default\": {\n      \"key\": \"XXXXXXXX\",\n      \"secret\": \"xxxxxxxxxxxxxxxx\",\n      \"server\": \"https://data.4dnucleome.org\"\n  }\n}\n</pre><p>Once the access key is created and stored, the file can bedownloaded via curl with the following command:</p><pre class=\"literal-block\">\ncurl -O -L --user &lt;key&gt;:&lt;secret&gt; &lt;download-url&gt;\n</pre><p>For more information on file downloads see this <a class=\"reference external\" href=\"https://data.4dnucleome.org/help/user-guide/downloading-files\" rel=\"noopener noreferrer\" target=\"_blank\">page</a></p></div>"}, {"lab": {"status": "current", "display_title": "4DN DCIC, HMS", "uuid": "828cd4fe-ebb0-4b36-a94a-d2e3a36cc989", "@id": "/labs/4dn-dcic-lab/", "@type": ["Lab", "Item"], "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.lab_submitter", "submits_for.828cd4fe-ebb0-4b36-a94a-d2e3a36cc989"]}}, "body": "The data portal has an implementation of the `Data Repository Service v1.0 API <https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.0.0/docs/>`_.\n\nThis standard has been developed and adopted as part of the `Global Alliance for Genomics and Health (GA4GH) <https://www.ga4gh.org/>`_ and implementation has been encouraged by the `Common Fund Data Ecosystem <https://www.nih-cfde.org/>`_.\n\nIn brief from the specification, the Data Repository Service (DRS) API provides a generic interface to data repositories so data consumers, including workflow systems, can access data in a single, standard way regardless of where it\u2019s stored and how it\u2019s managed.\n\nA DRS request uses 4DN file accessions as unique identifiers and can be made with the following uri formats:\n\n`drs://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs <https://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs>`_\n\n`drs://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL <https://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL>`_\n\nand will return a json that follows the API specification: ::\n\n    {\n        \"id\": \"/files-processed/4DNFIIA7E3HL/\",\n        \"created_time\": \"2022-02-25T20:40:38.976850+00:00\",\n        \"drs_id\": \"4DNFIIA7E3HL\",\n        \"self_uri\": \"drs://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs\",\n        \"access_methods\": [\n          {\n              \"access_url\": {\n                 \"url\": \"https://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n              },\n              \"type\": \"https\"\n          },\n          {\n              \"access_url\": {\n                 \"url\": \"http://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n              },\n              \"type\": \"http\"\n          }\n       ],\n       \"description\": \"ATAC-seq signal fold change\",\n       \"size\": 2345462672,\n       \"aliases\": [\n           \"4692b7c1-addf-47aa-b4cb-e30dc65a38f6\"\n       ],\n       \"checksums\": [\n          {\n             \"checksum\": \"73a2635fe8382a28339370a22b84de48\",\n             \"type\": \"md5\"\n          }\n       ],\n       \"version\": \"73a2635fe8382a28339370a22b84de48\",\n       \"updated_time\": \"2022-05-03T21:45:53.756034+00:00\"\n    }\n\nA request that specifies the access method will return a uri that can be used for data download e.g.\n\n``https://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL/access/https``\n\nReturns: ::\n\n    {\n        \"url\": \"https://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n    }\n\nAccess to the data via the ``access_url`` respects the authentication and authorization for that data and therefore, attempts to download data to which you do not have access will fail.\n", "name": "help.user-guide.data-access.drsapi", "award": {"status": "current", "@type": ["Award", "Item"], "@id": "/awards/2U01CA200059-06/", "display_title": "4D NUCLEOME NETWORK DATA COORDINATION AND INTEGRATION CENTER - PHASE II", "uuid": "71171a4e-dca1-44cb-8375-fafd896c6923", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin"]}}, "title": "DRS API", "status": "released", "aliases": ["4dn-dcic-lab:drs_api_doc"], "options": {"filetype": "rst", "collapsible": false, "default_open": true, "convert_ext_links": true}, "date_created": "2023-09-11T16:05:13.797299+00:00", "section_type": "Page Section", "submitted_by": {"error": "no view permissions"}, "last_modified": {"modified_by": {"error": "no view permissions"}, "date_modified": "2024-08-19T22:15:20.158532+00:00"}, "schema_version": "2", "@id": "/static-sections/997569ea-34bc-4bc1-9483-0240e5c09624/", "@type": ["StaticSection", "UserContent", "Item"], "uuid": "997569ea-34bc-4bc1-9483-0240e5c09624", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.owner", "userid.986b362f-4eb6-4a9c-8173-3ab267227777"]}, "display_title": "DRS API", "external_references": [], "content": "The data portal has an implementation of the `Data Repository Service v1.0 API <https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.0.0/docs/>`_.\n\nThis standard has been developed and adopted as part of the `Global Alliance for Genomics and Health (GA4GH) <https://www.ga4gh.org/>`_ and implementation has been encouraged by the `Common Fund Data Ecosystem <https://www.nih-cfde.org/>`_.\n\nIn brief from the specification, the Data Repository Service (DRS) API provides a generic interface to data repositories so data consumers, including workflow systems, can access data in a single, standard way regardless of where it\u2019s stored and how it\u2019s managed.\n\nA DRS request uses 4DN file accessions as unique identifiers and can be made with the following uri formats:\n\n`drs://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs <https://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs>`_\n\n`drs://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL <https://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL>`_\n\nand will return a json that follows the API specification: ::\n\n    {\n        \"id\": \"/files-processed/4DNFIIA7E3HL/\",\n        \"created_time\": \"2022-02-25T20:40:38.976850+00:00\",\n        \"drs_id\": \"4DNFIIA7E3HL\",\n        \"self_uri\": \"drs://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs\",\n        \"access_methods\": [\n          {\n              \"access_url\": {\n                 \"url\": \"https://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n              },\n              \"type\": \"https\"\n          },\n          {\n              \"access_url\": {\n                 \"url\": \"http://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n              },\n              \"type\": \"http\"\n          }\n       ],\n       \"description\": \"ATAC-seq signal fold change\",\n       \"size\": 2345462672,\n       \"aliases\": [\n           \"4692b7c1-addf-47aa-b4cb-e30dc65a38f6\"\n       ],\n       \"checksums\": [\n          {\n             \"checksum\": \"73a2635fe8382a28339370a22b84de48\",\n             \"type\": \"md5\"\n          }\n       ],\n       \"version\": \"73a2635fe8382a28339370a22b84de48\",\n       \"updated_time\": \"2022-05-03T21:45:53.756034+00:00\"\n    }\n\nA request that specifies the access method will return a uri that can be used for data download e.g.\n\n``https://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL/access/https``\n\nReturns: ::\n\n    {\n        \"url\": \"https://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n    }\n\nAccess to the data via the ``access_url`` respects the authentication and authorization for that data and therefore, attempts to download data to which you do not have access will fail.\n", "filetype": "rst", "content_as_html": "<div class=\"rst-container\"><p>The data portal has an implementation of the <a class=\"reference external\" href=\"https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.0.0/docs/\" rel=\"noopener noreferrer\" target=\"_blank\">Data Repository Service v1.0 API</a>.</p><p>This standard has been developed and adopted as part of the <a class=\"reference external\" href=\"https://www.ga4gh.org/\" rel=\"noopener noreferrer\" target=\"_blank\">Global Alliance for Genomics and Health (GA4GH)</a> and implementation has been encouraged by the <a class=\"reference external\" href=\"https://www.nih-cfde.org/\" rel=\"noopener noreferrer\" target=\"_blank\">Common Fund Data Ecosystem</a>.</p><p>In brief from the specification, the Data Repository Service (DRS) API provides a generic interface to data repositories so data consumers, including workflow systems, can access data in a single, standard way regardless of where it\u2019s stored and how it\u2019s managed.</p><p>A DRS request uses 4DN file accessions as unique identifiers and can be made with the following uri formats:</p><p><a class=\"reference external\" href=\"https://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs\" rel=\"noopener noreferrer\" target=\"_blank\">drs://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs</a></p><p><a class=\"reference external\" href=\"https://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL\" rel=\"noopener noreferrer\" target=\"_blank\">drs://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL</a></p><p>and will return a json that follows the API specification:</p><pre class=\"literal-block\">\n{\n    \"id\": \"/files-processed/4DNFIIA7E3HL/\",\n    \"created_time\": \"2022-02-25T20:40:38.976850+00:00\",\n    \"drs_id\": \"4DNFIIA7E3HL\",\n    \"self_uri\": \"drs://data.4dnucleome.org/files-processed/4DNFIIA7E3HL/@@drs\",\n    \"access_methods\": [\n      {\n          \"access_url\": {\n             \"url\": \"https://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n          },\n          \"type\": \"https\"\n      },\n      {\n          \"access_url\": {\n             \"url\": \"http://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n          },\n          \"type\": \"http\"\n      }\n   ],\n   \"description\": \"ATAC-seq signal fold change\",\n   \"size\": 2345462672,\n   \"aliases\": [\n       \"4692b7c1-addf-47aa-b4cb-e30dc65a38f6\"\n   ],\n   \"checksums\": [\n      {\n         \"checksum\": \"73a2635fe8382a28339370a22b84de48\",\n         \"type\": \"md5\"\n      }\n   ],\n   \"version\": \"73a2635fe8382a28339370a22b84de48\",\n   \"updated_time\": \"2022-05-03T21:45:53.756034+00:00\"\n}\n</pre><p>A request that specifies the access method will return a uri that can be used for data download e.g.</p><p><code>https://data.4dnucleome.org/ga4gh/drs/v1/objects/4DNFIIA7E3HL/access/https</code></p><p>Returns:</p><pre class=\"literal-block\">\n{\n    \"url\": \"https://data.4dnucleome.org/4DNFIIA7E3HL/@@download\"\n}\n</pre><p>Access to the data via the <code>access_url</code> respects the authentication and authorization for that data and therefore, attempts to download data to which you do not have access will fail.</p></div>"}], "date_created": "2020-12-18T15:38:36.830224+00:00", "submitted_by": {"error": "no view permissions"}, "last_modified": {"modified_by": {"error": "no view permissions"}, "date_modified": "2024-08-19T22:15:28.883594+00:00"}, "schema_version": "3", "content_location": "bottom", "table-of-contents": {"enabled": true, "expanded": true, "header-depth": 4}, "@id": "/pages/510095c4-771d-42d1-83d2-eccbc72ab2f9/", "@type": ["Page", "Item"], "uuid": "510095c4-771d-42d1-83d2-eccbc72ab2f9", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.owner", "userid.986b362f-4eb6-4a9c-8173-3ab267227777"]}, "display_title": "Programmatic Access", "external_references": [], "@context": "/terms/", "aggregated-items": {}, "validation-errors": []}