subtractions

Find subtractions

Lists subtractions by their name or nickname by providing a term as a query parameter. Partial matches are supported.

Supports pagination unless the short query parameter is set. In this case, an array of objects containing the id and name of every subtraction is returned.

Request

get
/subtractions

Response

{
  "status": "200"
}

Create a subtraction

Creates a new subtraction.

A job is started to build the data necessary to make the subtraction usable in analyses. The subtraction is usable when the ready property is true.

Parameters

Name Type Required Description
name string true A unique name for the host (eg. Arabidopsis)
nickname string false A nickname of the host
upload_id integer true The unique id of the file

Errors

StatusDescription
400 Upload does not exist
403 Not permitted

Request

post
/subtractions
{
  "name": "Foobar",
  "nickname": "foo",
  "upload_id": 1234
}

Response

{
  "example": {
    "created_at": "2015-10-06T20:00:00Z",
    "deleted": false,
    "file": {
      "id": 1234,
      "name": "test_upload"
    },
    "files": [],
    "id": "abc123",
    "linked_samples": [],
    "name": "Foobar",
    "nickname": "foo",
    "ready": false,
    "user": {
      "administrator": false,
      "handle": "bob",
      "id": "test"
    }
  },
  "status": "201"
}

Delete a subtraction

Deletes an existing subtraction.

Errors

StatusDescription
403 Not permitted
404 Not found
409 Has linked samples

Request

delete
/subtractions/{subtraction_id}

Response

{
  "status": "204"
}

Get a subtraction

Fetches the details of a subtraction.

Errors

StatusDescription
404 Not found

Request

get
/subtractions/{subtraction_id}

Response

{
  "example": {
    "count": 9,
    "created_at": "2021-12-21T23:52:13.185000Z",
    "deleted": false,
    "file": {
      "id": 58,
      "name": "arabidopsis_thaliana_+_plastids.fa.gz"
    },
    "files": [
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.1.bt2",
        "id": 39,
        "name": "subtraction.1.bt2",
        "size": 44200803,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.2.bt2",
        "id": 37,
        "name": "subtraction.2.bt2",
        "size": 30000964,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.3.bt2",
        "id": 42,
        "name": "subtraction.3.bt2",
        "size": 3275,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.4.bt2",
        "id": 40,
        "name": "subtraction.4.bt2",
        "size": 30000958,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.fa.gz",
        "id": 36,
        "name": "subtraction.fa.gz",
        "size": 36160657,
        "subtraction": "q0ek30si",
        "type": "fasta"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.rev.1.bt2",
        "id": 41,
        "name": "subtraction.rev.1.bt2",
        "size": 44200803,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.rev.2.bt2",
        "id": 38,
        "name": "subtraction.rev.2.bt2",
        "size": 30000964,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      }
    ],
    "gc": {
      "a": 0.319,
      "c": 0.18,
      "g": 0.18,
      "n": 0.002,
      "t": 0.319
    },
    "id": "q0ek30si",
    "linked_samples": [
      {
        "id": "2izth91q",
        "name": "21BP074"
      },
      {
        "id": "noni4fpk",
        "name": "21BP075"
      },
      {
        "id": "o3ldvwpm",
        "name": "22SP001-M"
      },
      {
        "id": "gobtw98t",
        "name": "22SP001-R"
      }
    ],
    "name": "Arabidopsis thaliana",
    "nickname": "",
    "ready": true,
    "user": {
      "administrator": true,
      "handle": "igboyes",
      "id": "igboyes"
    }
  },
  "status": "200"
}

Update a subtraction

Updates the name or nickname of an existing subtraction.

Parameters

Name Type Required Description
name string false A unique name for the host
nickname string false A nickname for the host

Errors

StatusDescription
400 Invalid input
403 Not permitted
404 Not found

Request

patch
/subtractions/{subtraction_id}
{
  "name": "Arabidopsis",
  "nickname": "Thale cress"
}

Response

{
  "example": {
    "count": 9,
    "created_at": "2021-12-21T23:52:13.185000Z",
    "deleted": false,
    "file": {
      "id": 58,
      "name": "arabidopsis_thaliana_+_plastids.fa.gz"
    },
    "files": [
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.1.bt2",
        "id": 39,
        "name": "subtraction.1.bt2",
        "size": 44200803,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.2.bt2",
        "id": 37,
        "name": "subtraction.2.bt2",
        "size": 30000964,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.3.bt2",
        "id": 42,
        "name": "subtraction.3.bt2",
        "size": 3275,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.4.bt2",
        "id": 40,
        "name": "subtraction.4.bt2",
        "size": 30000958,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.fa.gz",
        "id": 36,
        "name": "subtraction.fa.gz",
        "size": 36160657,
        "subtraction": "q0ek30si",
        "type": "fasta"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.rev.1.bt2",
        "id": 41,
        "name": "subtraction.rev.1.bt2",
        "size": 44200803,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      },
      {
        "download_url": "/subtractions/q0ek30si/files/subtraction.rev.2.bt2",
        "id": 38,
        "name": "subtraction.rev.2.bt2",
        "size": 30000964,
        "subtraction": "q0ek30si",
        "type": "bowtie2"
      }
    ],
    "gc": {
      "a": 0.319,
      "c": 0.18,
      "g": 0.18,
      "n": 0.002,
      "t": 0.319
    },
    "id": "q0ek30si",
    "linked_samples": [
      {
        "id": "2izth91q",
        "name": "21BP074"
      },
      {
        "id": "noni4fpk",
        "name": "21BP075"
      },
      {
        "id": "o3ldvwpm",
        "name": "22SP001-M"
      },
      {
        "id": "gobtw98t",
        "name": "22SP001-R"
      }
    ],
    "name": "Arabidopsis",
    "nickname": "Thale cress",
    "ready": true,
    "user": {
      "administrator": true,
      "handle": "igboyes",
      "id": "igboyes"
    }
  },
  "status": "200"
}

Download a subtraction file

Downloads a Bowtie2 index or FASTA file for the given subtraction.

Files are attached to the subtraction as part of the creation job. They aren't available for download until the job has completed and the ready field is true.

Errors

StatusDescription
400
404 Not found

Request

get
/subtractions/{subtraction_id}/files/{filename}

Response

{
  "status": "200"
}