Skip to content

Commit

Permalink
Merge pull request #347 from VEuPathDB/bipartite-network-api-update
Browse files Browse the repository at this point in the history
Bipartite network api update
  • Loading branch information
d-callan authored Jan 30, 2024
2 parents 97b37ef + 024392b commit 0d5e8c1
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 21 deletions.
8 changes: 4 additions & 4 deletions docs/api.html

Large diffs are not rendered by default.

53 changes: 49 additions & 4 deletions schema/library.raml
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,18 @@ types:
type: object
properties:
pcoaVariance: number[]
FeaturePrefilterThresholds:
type: object
additionalProperties: false
properties:
proportionNonZero?: number
variance?: number
standardDeviation?: number
CorrelationComputeConfig:
type: object
properties:
correlationMethod: CorrelationMethod
prefilterThresholds?: FeaturePrefilterThresholds
CorrelationMethod:
type: string
enum:
Expand Down Expand Up @@ -778,6 +786,15 @@ types:
additionalProperties: false
properties:
isCutoff: boolean
InternalJob:
type: object
properties:
jobId: JobID
status: JobStatus
owned: boolean
created: datetime
grabbed: datetime
finished: datetime
PluginOverview:
displayName: Plugin Overview
type: object
Expand Down Expand Up @@ -939,16 +956,44 @@ types:
variables:
type: VariableMapping[]
required: false
KPartiteNetworkConfig:
type: NetworkConfig
properties:
partitionsMetadata: string[]
NodeIdList:
type: object
additionalProperties: false
properties:
nodeIds: string[]
KPartiteNetworkData:
type: NetworkData
properties:
partitions: NodeIdList[]
KPartiteNetwork:
type: object
additionalProperties: false
properties:
data: KPartiteNetworkData
config: KPartiteNetworkConfig
KPartiteNetworkPostResponse:
type: object
additionalProperties: false
properties:
kpartitenetwork: KPartiteNetwork
BipartiteNetworkConfig:
type: NetworkConfig
properties:
column1Metadata: string
column2Metadata: string
partitionsMetadata:
type: string[]
minItems: 2
maxItems: 2
BipartiteNetworkData:
type: NetworkData
properties:
column1NodeIDs: string[]
column2NodeIDs: string[]
partitions:
type: NodeIdList[]
maxItems: 2
minItems: 2
BipartiteNetwork:
type: object
additionalProperties: false
Expand Down
40 changes: 35 additions & 5 deletions schema/url/networks.raml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,48 @@ types:
type: VariableMapping[]
required: false

KPartiteNetworkConfig:
type: NetworkConfig
properties:
partitionsMetadata: string[]

NodeIdList:
additionalProperties: false
properties:
nodeIds: string[]

KPartiteNetworkData:
type: NetworkData
properties:
partitions: NodeIdList[]

KPartiteNetwork:
additionalProperties: false
properties:
data: KPartiteNetworkData
config: KPartiteNetworkConfig

KPartiteNetworkPostResponse:
additionalProperties: false
properties:
kpartitenetwork: KPartiteNetwork

# a specific case of a KPartiteNetwork w two partitions
BipartiteNetworkConfig:
type: NetworkConfig
properties:
column1Metadata: string
column2Metadata: string
partitionsMetadata:
type: string[]
minItems: 2
maxItems: 2

BipartiteNetworkData:
type: NetworkData
properties:
column1NodeIDs: string[]
column2NodeIDs: string[]

partitions:
type: NodeIdList[]
maxItems: 2
minItems: 2

BipartiteNetwork:
additionalProperties: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,20 @@ protected void writeResults(OutputStream out, Map<String, InputStream> dataStrea
BipartiteNetworkData bipartiteNetworkData = new BipartiteNetworkDataImpl();
bipartiteNetworkData.setLinks(links);
bipartiteNetworkData.setNodes(nodes);
bipartiteNetworkData.setColumn1NodeIDs(uniqueColumn1IDs);
bipartiteNetworkData.setColumn2NodeIDs(uniqueColumn2IDs);
NodeIdList partition1NodeIdList = new NodeIdListImpl();
partition1NodeIdList.setNodeIds(uniqueColumn1IDs);
NodeIdList partition2NodeIdList = new NodeIdListImpl();
partition2NodeIdList.setNodeIds(uniqueColumn2IDs);
List<NodeIdList> partitions = new ArrayList<NodeIdList>();
partitions.add(partition1NodeIdList);
partitions.add(partition2NodeIdList);
bipartiteNetworkData.setPartitions(partitions);

BipartiteNetworkConfig bipartiteNetworkConfig = new BipartiteNetworkConfigImpl();
bipartiteNetworkConfig.setColumn1Metadata(stats.getData1Metadata());
bipartiteNetworkConfig.setColumn2Metadata(stats.getData2Metadata());
List<String> partitionsMetadata = new ArrayList<String>();
partitionsMetadata.add(stats.getData1Metadata());
partitionsMetadata.add(stats.getData2Metadata());
bipartiteNetworkConfig.setPartitionsMetadata(partitionsMetadata);

BipartiteNetwork bipartiteNetwork = new BipartiteNetworkImpl();
bipartiteNetwork.setData(bipartiteNetworkData);
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/api.html

Large diffs are not rendered by default.

0 comments on commit 0d5e8c1

Please sign in to comment.