Skip to content

DIG-2209: Changing /experiments to /biosamples#15

Merged
daisieh merged 9 commits intodevelopfrom
daisieh/biosamples
Feb 18, 2026
Merged

DIG-2209: Changing /experiments to /biosamples#15
daisieh merged 9 commits intodevelopfrom
daisieh/biosamples

Conversation

@daisieh
Copy link
Copy Markdown
Member

@daisieh daisieh commented Feb 14, 2026

We are changing the /experiments endpoint because it was confusing: it does not return something that is anything like the ENA model's experiment. We are refactoring that endpoint to something that corresponds more closely to that model.

Testing should be performed in CanDIG/CanDIGv2#1252.

Copy link
Copy Markdown
Contributor

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't understand why the endpoint says it returns arrays but the schema specifies an object. I thought the object types should be consistent not vary amongst different endpoint returns.

@daisieh
Copy link
Copy Markdown
Member Author

daisieh commented Feb 17, 2026

The result is something like

{
    "analyses": {
      "sequence_variation": [
        "local-multisample_2"
      ]
    },
    "biosample_id": "local-SAMPLE_NULL_0002",
    "experiments": {
      "wgs": [
        "local-SEQ_NULL_0002"
      ],
      "wts": []
    },
    "program": "local-SYNTH_01",
    "runs": []
  }

So experiments and analyses are objects, with keys corresponding to the types of the thing, and each key's value is an array of the IDs of the objects.

Copy link
Copy Markdown
Contributor

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the experiments lists should be unique right? It looks like if there are multiple analyses per experiment it adds the experiment to the list twice e.g.:

{
    "analyses": {
      "reference_alignment": [
        "local-NA02102-cram",
        "local-NA02102-bam"
      ]
    },
    "biosample_id": "local-SAMPLE_0004",
    "experiments": {
      "wgs": [
        "local-SEQ_0004",
        "local-SEQ_0004"
      ],
      "wts": []
    },
    "program": "local-SYNTH_01",
    "runs": []
  },

daisieh and others added 2 commits February 17, 2026 15:28
Co-authored-by: Marion <mshadbolt@users.noreply.github.com>
@daisieh
Copy link
Copy Markdown
Member Author

daisieh commented Feb 17, 2026

I think the problem is that the ingest test file has a duplicate experiment in it; I don't know why. If it's not supposed to have a duplicate (maybe we meant it as a test that shouldn't be double-ingested?), we should fix the problem in the test data.

@daisieh
Copy link
Copy Markdown
Member Author

daisieh commented Feb 17, 2026

If we don't want to allow duplicate ingest (which we probably shouldn't), we need a ticket to fix ingest to catch that error.

@daisieh
Copy link
Copy Markdown
Member Author

daisieh commented Feb 18, 2026

The double-adding thing was a good catch! It is fixed now.

@daisieh daisieh requested a review from mshadbolt February 18, 2026 01:30
Copy link
Copy Markdown
Contributor

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests passing, working as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants