Skip to content

Commit

Permalink
Merge pull request #81 from sennetconsortium/maxsibilla/origin_samples
Browse files Browse the repository at this point in the history
Updating documentation from origin_sample to origin_samples
  • Loading branch information
maxsibilla authored Oct 10, 2024
2 parents 68ddcd3 + 639aa5b commit fb25329
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docs/param-search/data-query-download-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ This example uses the command line tool `curl` to execute queries. The [Example

### Example Query and Download

The following query will return all Histology (`dataset_type=Histology`) Datasets run on a Keyence BZ-X800 machine (`ingest_metadata.metadata.acquisition_instrument_model=BZ-X800`) where tissue from a heart was used (`origin_sample.organ=HT`). See the [RESTful parameterized search page](index.html) for further information on querying dataset, organ (`origin_sample.organ` represents the organ in the query and `HT` is the organ code (organ code list available [here](schema-sample.html#organ-attribute-values)) and dataset metadata fields.
The following query will return all Histology (`dataset_type=Histology`) Datasets run on a Keyence BZ-X800 machine (`ingest_metadata.metadata.acquisition_instrument_model=BZ-X800`) where tissue from a heart was used (`origin_samples.organ=HT`). See the [RESTful parameterized search page](index.html) for further information on querying dataset, organ (`origin_samples.organ` represents the organ in the query and `HT` is the organ code (organ code list available [here](schema-sample.html#organ-attribute-values)) and dataset metadata fields.

```
GET https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_sample.organ=HT
GET https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_samples.organ=HT
```

As is, if this query is submitted via HTTP GET it will produce a json Response with an array of dataset objects which match the query. Adding the `produce-clt-manifest=true` option to this query will instead produce a list of Dataset IDs pointing to the Datasets that match this query in a format that will be directly usable by the [SenNet Command Line Transfer Tool](/libraries/clt/).

To run this from the command line and save the results to a file run:
```
curl "https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_sample.organ=HT&produce-clt-manifest=true" > dataset-manifest-for-download.out
curl "https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_samples.organ=HT&produce-clt-manifest=true" > dataset-manifest-for-download.out
```

This results in a file that looks like:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@
"\n",
"### Example Query and Download\n",
"\n",
"The following query will return all Histology (`dataset_type=Histology`) Datasets run on a Keyence BZ-X800 machine (`ingest_metadata.metadata.acquisition_instrument_model=BZ-X800`) where tissue from a heart was used (`origin_sample.organ=HT`). See the [RESTful parameterized search page](https://docs.sennetconsortium.org/index.html) for further information on querying dataset, organ (`origin_sample.organ`) represents the organ in the query and `HT` is the organ code (organ code list available [here](https://docs.sennetconsortium.org/param-search/schema-sample.html#organ-attribute-values)) and dataset metadata fields.\n",
"The following query will return all Histology (`dataset_type=Histology`) Datasets run on a Keyence BZ-X800 machine (`ingest_metadata.metadata.acquisition_instrument_model=BZ-X800`) where tissue from a heart was used (`origin_samples.organ=HT`). See the [RESTful parameterized search page](https://docs.sennetconsortium.org/index.html) for further information on querying dataset, organ (`origin_samples.organ`) represents the organ in the query and `HT` is the organ code (organ code list available [here](https://docs.sennetconsortium.org/param-search/schema-sample.html#organ-attribute-values)) and dataset metadata fields.\n",
"\n",
"```\n",
"GET https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_sample.organ=HT\n",
"GET https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_samples.organ=HT\n",
"```\n",
"\n",
"#### Producing a CLT manifest file\n",
"\n",
"As is, if this query is submitted via HTTP GET it will produce a json Response with an array of dataset objects which match the query. Adding the `produce-clt-manifest=true` option to this query will instead prduce a list of Dataset IDs pointing to the Datasets that match this query in a format that will be directly usable by the [SenNet Command Line Transfer Tool](https://docs.sennetconsortium.org/libraries/clt/).\n",
"\n",
"```\n",
"GET https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_sample.organ=HT&produce-clt-manifest=true\n",
"GET https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_samples.organ=HT&produce-clt-manifest=true\n",
"```\n",
"\n",
"#### Make the query request and get the manifest information\n",
Expand All @@ -62,7 +62,7 @@
"import requests\n",
"\n",
"#run the query, get the results, report any errors\n",
"query_url = 'https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_sample.organ=HT&produce-clt-manifest=true'\n",
"query_url = 'https://search.api.sennetconsortium.org/param-search/datasets?dataset_type=Histology&ingest_metadata.metadata.acquisition_instrument_model=BZ-X800&origin_samples.organ=HT&produce-clt-manifest=true'\n",
"try:\n",
" manifest_text = None\n",
" \n",
Expand Down
8 changes: 4 additions & 4 deletions docs/param-search/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ A json array containing Dataset objects will be returned.

---

To find all Histology datasets (`dataset_type=Histology`) that were run on tissue from a right lung (`origin_sample.organ=RL`):
To find all Histology datasets (`dataset_type=Histology`) that were run on tissue from a right lung (`origin_samples.organ=RL`):
```
GET https://search.api.sennetconsortium.org/param-search/datasets?origin_sample.organ=RL&dataset_type=Histology
GET https://search.api.sennetconsortium.org/param-search/datasets?origin_samples.organ=RL&dataset_type=Histology
```
A json array containing Dataset objects will be returned.

---

To run the same query finding all Histology datasets, but produce a manifest file to download all of the data instead of producing the json of all dataset information, add the `produce-clt-manifest=true` option
```
GET https://search.api.sennetconsortium.org/param-search/datasets?origin_sample.organ=RL&dataset_type=Histology&produce-clt-manifest=true
GET https://search.api.sennetconsortium.org/param-search/datasets?origin_samples.organ=RL&dataset_type=Histology&produce-clt-manifest=true
```

This will produce a list of dataset ids in a format usable by the [SenNet Command Line Transfer Tool](/libraries/clt/) to download the data. A Linux/MAC command line example of how to produce a manifest file:

```
curl "https://search.api.sennetconsortium.org/param-search/datasets?origin_sample.organ=RL&dataset_type=Histology&produce-clt-manifest=true" > manifest.out
curl "https://search.api.sennetconsortium.org/param-search/datasets?origin_samples.organ=RL&dataset_type=Histology&produce-clt-manifest=true" > manifest.out
```

2 changes: 1 addition & 1 deletion docs/param-search/schema-dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This example finds all Datasets of type `RNAseq` where specific molecules are no
| ingest_metadata.metadata | JSON-encoded string for a supported [assay type schema](#assay-type-schemas) | The assay level metadata submitted by data providers with data. Provided as json. Metadata schemas per dataset_type are linked from the [dataset type allowable values section](#dataset_type-allowable-values).|
| dataset_type | string [dataset type allowable values](#dataset_type-allowable-values) | The type of data contained in the dataset (as derived from a specific assay type |
| source | Source Object | The source from which the tissue was taken for the assay. The sub-attributes under source are specified in the [Source Schema](schema-source.html) |
| origin_sample | Sample Object Array | The organ from which the tissue was taken for the assay. The sub-attributes under origin_samples are specified in the [Sample Schema](schema-sample.html). This is modeled as an array because it is possible for data to be derived from multiple organs, but currently SenNet only has data derived from a single organ. |
| origin_samples | Sample Object Array | The organ from which the tissue was taken for the assay. The sub-attributes under origin_sampless are specified in the [Sample Schema](schema-sample.html). This is modeled as an array because it is possible for data to be derived from multiple organs, but currently SenNet only has data derived from a single organ. |


### `data_access_level` attribute values
Expand Down
2 changes: 1 addition & 1 deletion docs/param-search/schema-sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A query string is built by combining schema elements documented below with match

Query terms may be composited from attributes deeper in the schema type of an attribute. For example, the Sample Schema attribute ```metadata``` is has a type of [Sample Metadata Schema](/libraries/ingest-validation-tools/schemas/), and Sample `Block` Metadata Schema has an attribute ```preparation_condition```. Querying Samples supports a term to search for sample blocks with a preparation condition, such as ```metadata.preparation_condition=Frozen%20on%20ice```, and a query like:
```
GET https://search.api.sennetconsortium.org/param-search/samples?metadata.preparation_condition=Frozen%20on%20ice&origin_sample.organ=HT
GET https://search.api.sennetconsortium.org/param-search/samples?metadata.preparation_condition=Frozen%20on%20ice&origin_samples.organ=HT
```

| Attribute | Type | Description |
Expand Down

0 comments on commit fb25329

Please sign in to comment.