Messenger is a Rails API that stores aggregated text transcriptions, allowing researchers to review, accept, and reject consensus transcriptions. It authenticates with the Panoptes API: only project owners and collaborators are able to add and update transcriptions for their projects.
It is called Messenger because early in the process of gene expresssion, the transcription step results in 'messenger' RNA (mRNA) that is template for protien synthesis through translation.
Transcription comes first, then the messenger, then a legible and useful result!
Authorization is provided by a JWT token from Panoptes sent in the request's Authorization header. Messenger uses the JSONAPI spec throughout.
Here are the pieces:
A Panoptes project. Project#id
is consistent with Panoptes project ids and should be set manually.
- Has many Transcriptions
Attribute | Type | Description |
---|---|---|
slug |
String | The project url slug |
GET /projects
- Publicly accessible
- Filterable by
slug
{
"data": [{
"id": "1",
"type": "projects",
"attributes": {
"slug": "project-owner/project-name"
},
"links": {
"self": "/projects/1",
"transcriptions": "/transcriptions?filter[project_id]=1"
}
}],
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "/projects?page[number]=1&page[size]=1",
"next": "/projects?page[number]=2&page[size]=1",
"last": "/projects?page[number]=123&page[size]=1"
}
}
GET /projects/:id
- Publicly accessible
{
"data": [{
"id": "1",
"type": "projects",
"attributes": {
"slug": "project-owner/project-name"
},
"links": {
"self": "/projects/1",
"transcriptions": "/transcriptions?filter[project_id]=1"
}
}],
"jsonapi": {
"version": "1.0"
}
}
POST /projects
- Accessible by project owners, collaborators, and site admins. The id will be the same as the project's Panoptes id,
slug
is the only required parameter.
{
"properties": {
"data": {
"properties": {
"slug": {
"type": "string"
}
},
"type": "object",
"required": [
"slug"
],
"additionalProperties": false
}
},
"type": "object",
"required": [
"data"
]
}
{
"data": {
"type": "projects",
"attributes": {
"slug": "project-owner/project-name"
}
}
}
PUT /projects/:id
- Not permitted
DELETE /projects/:id
- Not permitted
A text transcription of a Panoptes subject.
- Belongs to Project
Attribute | Type | Description |
---|---|---|
id |
Integer | The Panoptes ID of the transcribed subject. |
status |
String | The current status: 'accepted', 'rejected', 'amended', or 'unreviewed'. |
text |
Text | The text content of the annotation in whatever format is required. |
GET /transcriptions
- Scoped by project owner or collaborator roles
- Site admins can access all transcriptions
- Filterable by
project_id
andstate
{
"data": [{
"id": "1",
"type": "transcriptions",
"attributes": {
"state": "accepted",
"project_id": 1,
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sit amet sem luctus, facilisis erat sit amet, volutpat arcu. Cras ultricies malesuada quam a gravida. Mauris pulvinar ipsum eget urna vulputate pulvinar. Duis quis quam leo. Cras neque nisi, cursus at gravida nec, viverra non est. Curabitur aliquam sodales sapien. Donec commodo sodales velit, a placerat diam volutpat id. Proin tempus, leo in faucibus consequat, turpis erat molestie orci, eget ornare neque lacus et nisi. Quisque ut lobortis diam. Nulla iaculis lacus a erat feugiat tincidunt. Nulla sem purus, eleifend sit amet ipsum ac, auctor venenatis magna. Maecenas molestie ullamcorper velit luctus posuere."
},
"links": {
"self": "/transcriptions/1"
}
}],
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "/transcriptions?page[number]=1&page[size]=1",
"next": "/transcriptions?page[number]=2&page[size]=1",
"last": "/transcriptions?page[number]=123&page[size]=1"
}
}
GET /transcriptions/:id
- Publicly accessible
{
"data": [{
"id": "1",
"type": "transcriptions",
"attributes": {
"state": "unreviewed",
"project_id": 1,
"text": "A bunch more text"
},
"links": {
"self": "/transcriptions/1"
}
}],
"jsonapi": {
"version": "1.0"
}
}
POST /transcriptions
- Accessible by project owners, collaborators, and site admins. ID property should be the corresponding Panoptes subject ID.
{
"properties": {
"data": {
"properties": {
"id": {
"oneOf": [{
"type": "integer",
"minimum": 1
}, {
"type": "string",
"pattern": "^[1-9]\\d*$"
}]
},
"project_id": {
"oneOf": [{
"type": "integer",
"minimum": 1
}, {
"type": "string",
"pattern": "^[1-9]\\d*$"
}]
},
"text": {
"type": "text"
},
"status": {
"enum": ["accepted", "rejected", "amended", "unreviewed"]
}
},
"type": "object",
"required": ["project_id", "status", "text"],
"additionalProperties": false
}
},
"type": "object",
"required": ["data"]
}
{
"data": {
"attributes": {
"text": "Curabitur ut magna in lectus semper vulputate ac non urna. Suspendisse mattis nisi enim, non dapibus augue sodales dapibus. Donec vitae sapien at metus ultricies ullamcorper. Quisque varius posuere mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In et eleifend mauris, eu sodales nibh. Mauris laoreet, justo tincidunt egestas pulvinar, ex lectus rhoncus urna, quis faucibus mauris lectus a ex.",
"state": "unreviewed"
},
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "1"
}
}
}
}
}
PUT /transcriptions/:id
- Accessible by project owners, collaborators, and site admins
{
"properties": {
"data": {
"properties": {
"project_id": {
"oneOf": [{
"type": "integer",
"minimum": 1
}, {
"type": "string",
"pattern": "^[1-9]\\d*$"
}]
},
"text": {
"type": "text"
},
"status": {
"enum": ["accepted", "rejected", "amended", "unreviewed"]
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"required": ["data"]
}
{
"data": {
"attributes": {
"text": "A way, way better transctiption",
"status": "amended"
}
}
}
DELETE /transcriptions/:id
- Accessible by project owners, collaborators, and site admins