Skip to content

Commit

Permalink
Latest changes from Keyang
Browse files Browse the repository at this point in the history
  • Loading branch information
MmPersida committed Sep 5, 2024
1 parent ff6fee7 commit 21eb190
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 22 deletions.
54 changes: 48 additions & 6 deletions components/service/ldh/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MetaNode } from '@/spec/metanode'
import { GeneTerm } from '@/components/core/term'
import { GeneSet } from '@/components/core/set'
import { RegulatoryElementSetInfo, RegulatoryElementSetForGeneSetInfo, setGenomicPositionsForRegulatoryElementSet, MyGeneToRegulatoryElementSetInfo } from '@/components/service/regulatoryElementInfo'
import { RegulatoryElementSetInfo, RegulatoryElementSetForGeneSetInfo, setGenomicPositionsForRegulatoryElementSet, MyGeneToRegulatoryElementSetInfo, MyRegulatoryElementSetInfo } from '@/components/service/regulatoryElementInfo'
import { GeneInfo, GeneInfoFromGeneTerm } from '@/components/service/mygeneinfo'
import { linkeddatahub_icon } from '@/icons'
import { z } from 'zod'
Expand All @@ -24,6 +24,34 @@ export async function myGeneInfoFromLinkDataHub(geneTerm: string): Promise<MyGen
return await res.json()
}


function getREPositionDataFromLinkDataHub(reObjSet: any){
let response: MyRegulatoryElementSetInfo = [];
for(let i in reObjSet){
let rgObj: any = reObjSet[i];

let coordinates = null;
if(rgObj.entContent != null && rgObj.entContent.coordinates != null){
coordinates = rgObj.entContent.coordinates;
}else{
coordinates = {
chromosome: "",
start: 0,
end: 0
};
}
let tempObj = {
entId: rgObj.entId,
ldhId: rgObj.ldhId,
entContent: {
coordinates: coordinates
}
}
response.push(tempObj);
}
return response;
}

export const GetRegulatoryElementsInfoForGeneInfo = MetaNode('GetRegulatoryElementsInfoForGeneInfo')
.meta({
label: 'Identify regulatory element in the vicinity of given gene',
Expand All @@ -38,8 +66,17 @@ export const GetRegulatoryElementsInfoForGeneInfo = MetaNode('GetRegulatoryEleme
if(response.data == null || response.data.ld == null){
throw new Error("Unable to get data from Linked Data Hub API, please try again or wait a few minutes before the next atempt!");
}
let reNamesSet: string[] = response.data.ld.RegulatoryElement.map(({ entId }) => entId );
return await setGenomicPositionsForRegulatoryElementSet(reNamesSet);

let reObjSet: any = response.data.ld.RegulatoryElement;
if(reObjSet == null || reObjSet.length == 0){
throw new Error("Unable to get Regulatory Element data for gene "+props.inputs.geneInfo.symbol+" from Linked Data Hub API, please try again or wait a few minutes before the next atempt!");
}
let reInfoSet = getREPositionDataFromLinkDataHub(reObjSet);
if(reInfoSet == null || reInfoSet.length == 0){
throw new Error("Unable to get Regulatory Element(s) coordinates for gene "+props.inputs.geneInfo.symbol+" from Linked Data Hub API, please try again or wait a few minutes before the next atempt!");
}

return reInfoSet;
})
.story(props => ({
abstract: `Regulatory elements in 10kbps region upstream or downstream of gene ${props.inputs ? ` ${props.inputs.geneInfo.symbol}` : ''}.`
Expand Down Expand Up @@ -81,9 +118,14 @@ export const GetRegulatoryElementsInfoForGeneInfo = MetaNode('GetRegulatoryEleme
continue;
}

let reNamesSet: string[] = response.data.ld.RegulatoryElement.map(({ entId }) => entId );
let reInfoSet = await setGenomicPositionsForRegulatoryElementSet(reNamesSet);

let reObjSet: any = response.data.ld.RegulatoryElement;
if(reObjSet == null || reObjSet.length == 0){
continue;
}
let reInfoSet = getREPositionDataFromLinkDataHub(reObjSet);
if(reInfoSet == null || reInfoSet.length == 0){
continue;
}
let temp = {
gene: g,
regulatoryElements: reInfoSet
Expand Down
10 changes: 2 additions & 8 deletions components/service/regulatoryElementInfo/service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const GetGenesForRegulatoryElementInfo = MetaNode('GetGenesForRegulatoryE
legend: `A list of genes in the vicinity of given regulatory element`,
})).build()


export const REGeneSet = MetaNode('REGeneSet')
.meta({
label: 'Genes Set For Each Regulatory Element In Set',
Expand Down Expand Up @@ -161,7 +160,6 @@ export const GetGenesForRegulatoryElementInfo = MetaNode('GetGenesForRegulatoryE
.story(props => ({ abstract: `Genes linked to the regulatory element set.` }))
.build()


export const GetVariantsForRegulatoryElementInfo = MetaNode('GetVariantListForRegulatoryElementInfo')
.meta({
label: 'Identify Variants Within Regulatory Element',
Expand Down Expand Up @@ -586,7 +584,7 @@ export const RegElementSetInfoFromRegElementTerm = MetaNode('RegElementSetInfoFr
export const GenomicRegionCoordinateTransformationAcrossReferences = MetaNode('GenomicRegionCoordinateTransformationAcrossReferences')
.meta({
label: 'Genomic region coordinate transformation across references',
description: 'Get unique name for genomic region(s) cross refenrce: GRCh38, GRCh37 and NCBI36.',
description: 'Get coordinates for genomic region(s) cross references: GRCh38, GRCh37 and NCBI36.',
icon: [linkeddatahub_icon],
})
.inputs({ regulatoryElement: RegulatoryElementTerm })
Expand Down Expand Up @@ -637,10 +635,6 @@ export const RegElementSetInfoFromRegElementTerm = MetaNode('RegElementSetInfoFr
name="Regulatory Element id"
cellRenderer={row => <Cell key={row+''}>{uniqueRegionsCrossReferenceList[row]?.regElementId}</Cell>}
/>
<Column
name="Position"
cellRenderer={row => <Cell key={row+''}>{uniqueRegionsCrossReferenceList[row]?.rePosition}</Cell>}
/>
<Column
name="Cross Reference(s)"
cellRenderer={row => <Cell key={row+''}>{
Expand All @@ -661,7 +655,7 @@ export const RegElementSetInfoFromRegElementTerm = MetaNode('RegElementSetInfoFr
export const GenomicRegionCoordinateTransformationAcrossReferencesRE_Set = MetaNode('GenomicRegionCoordinateTransformationAcrossReferencesRE_Set')
.meta({
label: 'Genomic region coordinate transformation across references',
description: 'Get unique name for genomic region(s) cross refenrce: GRCh38, GRCh37 and NCBI36.',
description: 'Get coordinates for genomic region(s) cross references: GRCh38, GRCh37 and NCBI36.',
icon: [linkeddatahub_icon],
})
.inputs({ regulatoryElementSet: RegulatoryElementSet })
Expand Down
3 changes: 2 additions & 1 deletion components/service/variantinfo/externalRecords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ export const AlleleRegistryExternalRecordsTable = MetaNode('AlleleRegistryExtern
}
}

//id: caid+"("+variantInfoObj.communityStandardTitle[0]+")"
let arExternalR = {
name: 'Allele Registry',
sources: [{
'@id': variantInfoObj['@id'],
id: caid+"("+variantInfoObj.communityStandardTitle[0]+")"
id: caid
}]
}
alleleInfoExternalResources.push(arExternalR);
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
logging: *default-logging
# app serves the UI & API, it registers user interactions into the database (pg)
pwb-app:
image: maayanlab/playbook-partnership:0.65.9-ui
image: maayanlab/playbook-partnership:0.65.10-ui
build:
context: .
dockerfile: Dockerfile
Expand Down Expand Up @@ -80,7 +80,7 @@ services:
# the workers should be replicated,
# they deal with creating "Resolved" entries for submitted Processes.
pwb-worker:
image: maayanlab/playbook-partnership:0.65.9
image: maayanlab/playbook-partnership:0.65.10
build:
context: .
dockerfile: Dockerfile
Expand Down Expand Up @@ -113,7 +113,7 @@ services:
logging: *default-logging
# app-dev serves a dev version of the app
app-dev:
image: maayanlab/playbook-partnership:0.65.9
image: maayanlab/playbook-partnership:0.65.10
build:
context: .
dockerfile: Dockerfile
Expand Down Expand Up @@ -152,7 +152,7 @@ services:
# a playbook-partnership development environment
# doesn't run in production, just for convenience
dev:
image: maayanlab/playbook-partnership:0.65.9-dev
image: maayanlab/playbook-partnership:0.65.10-dev
build:
context: .
dockerfile: Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "playbook-workflow-builder",
"version": "0.65.9",
"version": "0.65.10",
"description": "A repository for the playbook workflow builder collaboration.",
"private": true,
"workspaces": [
Expand Down

0 comments on commit 21eb190

Please sign in to comment.