Skip to content

Commit

Permalink
Sorted fe1___.
Browse files Browse the repository at this point in the history
  • Loading branch information
KwatMDPhD committed Aug 1, 2023
1 parent 8483ebb commit 9f77acd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/GSEA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ Run data-rank (single-sample) GSEA.

BioLab.Error.error_missing(output_directory)

# TODO: Remove typing.
_naf, fe_::Vector{String}, sa_::Vector{String}, fe_x_sa_x_sc::Matrix{Float64} =
_naf, fe_, sa_, fe_x_sa_x_sc =
BioLab.DataFrame.separate(BioLab.DataFrame.read(feature_x_sample_x_score_tsv))

BioLab.Error.error_duplicate(fe_)
Expand Down Expand Up @@ -220,6 +219,8 @@ function _write(

se_x_id_x_ra = view(se_x_id_x_ra, id_, :)

fe1___ = view(fe1___, id_)

se_x_st_x_nu[:, 1] = en_

n_ra = size(se_x_id_x_ra, 2)
Expand Down
16 changes: 16 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,22 @@ const SET_X_STATISTIC_X_NUMBERU =

@test size(SET_X_STATISTIC_X_NUMBERU) == (50, 5)

@test names(SET_X_STATISTIC_X_NUMBERU) ==
["Set", "Enrichment", "Normalized Enrichment", "P-Value", "Adjusted P-Value"]

for (id, re) in (
(1, ["HALLMARK_PANCREAS_BETA_CELLS", -0.35266, -1.36616, 0.0200837]),
(2, ["HALLMARK_PROTEIN_SECRETION", -0.272096, -1.25207, 0.0686192]),
(49, ["HALLMARK_MYC_TARGETS_V1", 0.603356, 2.73998, 0.000262812]),
(50, ["HALLMARK_MYC_TARGETS_V2", 0.866579, 3.36557, 0.000262812]),
)

@test SET_X_STATISTIC_X_NUMBERU[id, 1] == re[1]

@test isapprox(collect(SET_X_STATISTIC_X_NUMBERU[id, 2:length(re)]), re[2:end]; atol = 1e-5)

end

@test length(BioLab.Path.read(OUU; ke_ = (r"html$",))) == 6

# ---- #
Expand Down

0 comments on commit 9f77acd

Please sign in to comment.