Skip to content

Commit

Permalink
filtering for the network
Browse files Browse the repository at this point in the history
  • Loading branch information
savvas-paragkamian committed Feb 28, 2024
1 parent 92a7874 commit af6ebaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scripts/isd_crete_biodiversity.R
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,9 @@ total_reads <- sum(crete_biodiversity$abundance)
# filtering taxa that have more than 100 reads and appear to more than 5% of the
# samples (n=7)
network_taxa_metadata <- asv_metadata |>
filter(total_reads_srs>=50) |>
mutate(prevalence_class=ifelse(n_samples>1 & mean_rel_abundance>(-0.01*proportion_samples+0.001),
"prevalent", "no prevalent")) |>
filter(prevalence_class=="prevalent") |>
ungroup()

filtered_reads <- sum(network_taxa_metadata$total_reads)
Expand Down
5 changes: 4 additions & 1 deletion scripts/isd_crete_network.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ using Graphs
using FlashWeave

data_path = string("results/network_community_matrix.tsv")
metadata_path = string("results/sample_metadata.tsv")

#meta_data_path = "results/sample_metadata.tsv"
netw_results = learn_network(data_path, sensitive=true, heterogeneous=false)
netw_results = learn_network(data_path, sensitive=true, heterogeneous=false, verbose=true, max_k=3, alpha=0.05, FDR=true)

#netw_results_heterogenous = learn_network(data_path, metadata_path, sensitive=false, heterogeneous=true, verbose=true, max_k=6, alpha=0.01, FDR=true)

save_network("results/network_output.gml", netw_results, detailed=true)

0 comments on commit af6ebaa

Please sign in to comment.