Skip to content

Commit

Permalink
Merge pull request #369 from opentargets/vh-add-tss
Browse files Browse the repository at this point in the history
feat: add tss column to target index
  • Loading branch information
vivienho authored Jan 14, 2025
2 parents 82093f8 + a7641e2 commit b027543
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/scala/io/opentargets/etl/backend/target/Target.scala
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ object Target extends LazyLogging {
.transform(addTargetSafety(inputDataFrames, ensemblIdLookupDf))
.transform(addReactome(reactome))
.transform(removeDuplicatedSynonyms)
.transform(addTss)

val targetEssentialityDF = targetsDF
.transform(addGeneEssentiality(inputDataFrames("geneEssentiality").data, ensemblIdLookupDf))
Expand All @@ -176,6 +177,15 @@ object Target extends LazyLogging {
)
}

private def addTss(dataFrame: DataFrame): DataFrame = {
logger.info("Adding tss column to target dataframe")
dataFrame.withColumn(
"tss",
when(col("canonicalTranscript.strand") === 1, col("canonicalTranscript.start"))
.when(col("canonicalTranscript.strand") === -1, col("canonicalTranscript.end"))
)
}

/** for all alternative names or symbols a target can take is worth cleaning them up from
* duplicated entries
*/
Expand Down

0 comments on commit b027543

Please sign in to comment.