Skip to content

Commit cfa8756

Browse files
committed
feat: exposing transcripts in the target index
1 parent 29fc01e commit cfa8756

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

app/models/entities/Target.scala

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ case class Constraint(
124124

125125
case class ReactomePathway(pathway: String, pathwayId: String, topLevelTerm: String)
126126

127+
case class Transcript(
128+
transcriptId: String,
129+
biotype: String,
130+
isEnsemblCanonical: Boolean,
131+
uniprotId: Option[String],
132+
isUniprotReviewed: Option[Boolean],
133+
translationId: Option[String],
134+
alphafoldId: Option[String],
135+
uniprotIsoformId: Option[String]
136+
)
137+
127138
case class Target(
128139
id: String,
129140
alternativeGenes: Seq[String] = Seq.empty,
@@ -152,7 +163,8 @@ case class Target(
152163
targetClass: Seq[TargetClass] = Seq.empty,
153164
tep: Option[Tep],
154165
tractability: Seq[Tractability] = Seq.empty,
155-
transcriptIds: Seq[String] = Seq.empty
166+
transcriptIds: Seq[String] = Seq.empty,
167+
transcripts: Seq[Transcript] = Seq.empty
156168
)
157169

158170
object Target extends OTLogging {
@@ -202,6 +214,7 @@ object Target extends OTLogging {
202214
implicit val hallmarkAttributeImpF: OFormat[HallmarkAttribute] =
203215
Json.format[models.entities.HallmarkAttribute]
204216
implicit val hallmarksImpF: OFormat[Hallmarks] = Json.format[models.entities.Hallmarks]
217+
implicit val transcriptImpF: OFormat[Transcript] = Json.format[models.entities.Transcript]
205218
implicit val targetImpF: OFormat[Target] =
206219
Json.format[Target]
207220
}

app/models/gql/Objects.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ object Objects extends OTLogging {
137137
)
138138
)
139139

140+
implicit val transcriptImp: ObjectType[Backend, Transcript] =
141+
deriveObjectType[Backend, Transcript](
142+
ObjectTypeDescription("Transcript annotation for a target gene"),
143+
DocumentField("transcriptId", "Ensembl transcript identifier"),
144+
DocumentField("biotype", "Biotype classification of the transcript"),
145+
DocumentField("isEnsemblCanonical", "Whether this is the Ensembl canonical transcript"),
146+
DocumentField("uniprotId", "UniProt accession mapped to the transcript"),
147+
DocumentField("isUniprotReviewed", "Whether the UniProt entry is reviewed (Swiss-Prot)"),
148+
DocumentField("translationId", "Ensembl translation identifier"),
149+
DocumentField("alphafoldId", "AlphaFold structure prediction identifier"),
150+
DocumentField("uniprotIsoformId", "UniProt isoform identifier")
151+
)
152+
140153
implicit lazy val targetImp: ObjectType[Backend, Target] = deriveObjectType(
141154
ObjectTypeDescription(
142155
"Core annotation for drug targets (gene/proteins). Targets are defined based on EMBL-EBI Ensembl database and uses the Ensembl gene ID as the primary identifier. An Ensembl gene ID is considered potential drug target if included in the canonical assembly or if present alternative assemblies but encoding for a reviewed protein product according to the UniProt database."
@@ -191,6 +204,9 @@ object Objects extends OTLogging {
191204
DocumentField("transcriptIds",
192205
"List of Ensembl transcript identifiers associated with the target"
193206
),
207+
DocumentField("transcripts",
208+
"List of transcripts associated with the target including protein and structure annotations"
209+
),
194210
DocumentField("pathways", "Pathway annotations for the target"),
195211
RenameField("go", "geneOntology"),
196212
RenameField("constraint", "geneticConstraint"),

test/controllers/GqlTest.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,9 @@ class GqlTest
555555
"return valid response for subcellular location fragment" taggedAs IntegrationTestTag in {
556556
testQueryAgainstGqlEndpoint(TargetFragment("SubcellularLocation_SubcellularLocationFragment"))
557557
}
558+
"return valid response for target transcripts query" taggedAs IntegrationTestTag in {
559+
testQueryAgainstGqlEndpoint(Target("TargetPage_Transcripts"))(ensgTransform)
560+
}
558561
"return a valid response for genetic contraint query" taggedAs IntegrationTestTag in {
559562
testQueryAgainstGqlEndpoint(Target("GeneticConstraint_GeneticConstraint"))(ensgTransform)
560563
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
query TargetTranscriptsQuery($ensgId: String!) {
2+
target(ensemblId: $ensgId) {
3+
transcripts {
4+
transcriptId
5+
biotype
6+
isEnsemblCanonical
7+
uniprotId
8+
isUniprotReviewed
9+
translationId
10+
alphafoldId
11+
uniprotIsoformId
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)