Skip to content

Commit

Permalink
Fix: Bugs in network_inference.direct.flashweave pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dileep-kishore committed Feb 16, 2021
1 parent 9a9b9a5 commit 4100643
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions micone/pipelines/envs/micone-flashweave/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ channels:
dependencies:
- python=3.8
- pip>=20.2.4
- pip:
- pandas>=1.2.1
- networkx>=2.5
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def main(otu_file, network_file, output_file):
directed = nx.is_directed(graph)
for source, target, data in graph.edges(data=True):
if (source in nodes) and (target in nodes):
interaction_table[source, target] = data["weight"]
interaction_table.loc[source, target] = data["weight"]
if not directed:
interaction_table[target, source] = data["weight"]
interaction_table.loc[target, source] = data["weight"]
interaction_table.to_csv(output_file, sep="\\t", index=True, float_format="%.4f")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ using DataFrames

# data
data_path = "${otu_file}"
new_data_path = "${otu_file.baseName}.tsv"
if data_path != new_data_path
cp(data_path, new_data_path, force=true, follow_symlinks=true)
end
metadata_path = "${sample_metadata}"
metadata = CSV.read(metadata_path, DataFrame; transpose=true)
new_metadata_path = "transposed_" * metadata_path
new_metadata_path = "${sample_metadata.baseName}_transposed.tsv"
CSV.write(new_metadata_path, metadata; delim="\\t")

# options
Expand All @@ -21,7 +25,7 @@ heterogeneous = ${heterogeneous}
FDR = ${fdr_correction}

netw_results = learn_network(
data_path,
new_data_path,
new_metadata_path,
sensitive=sensitive,
heterogeneous=heterogeneous,
Expand Down

0 comments on commit 4100643

Please sign in to comment.