Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bipartite network api update #347

Merged
merged 5 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me what do we have planned for the partitions metadata?

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 col1NodeIdList = new NodeIdListImpl();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth removing references to columns everywhere. There's no reason we need to even show the bp net in two columns (could be two rows, two blobs of nodes, or even nodes placed based on some layout algorithm but with two different colors), i just didn't have good words for it back in the day (4 months ago).
All that to say, i'd recommend "col1NodIdList" -> "partition1NodeIdList"

col1NodeIdList.setNodeIds(uniqueColumn1IDs);
NodeIdList col2NodeIdList = new NodeIdListImpl();
col2NodeIdList.setNodeIds(uniqueColumn2IDs);
List<NodeIdList> partitions = new ArrayList<NodeIdList>();
partitions.add(col1NodeIdList);
partitions.add(col2NodeIdList);
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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhh i remmber. that's what the metadata is

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.