Giter VIP home page Giter VIP logo

gsea.jl's People

Contributors

katharineme avatar kwatmdphd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

roger-luo simrit1

gsea.jl's Issues

Write out additional dict containing running enrichment score data for all sets

In order to produce some of the results tables users currently expect and reproduce features like leading edge analysis, we need to produce a parseable file that contains additional scoring information from the enrichment calculation. We'd basically want it to contain everything you'd need to produce the enrichment plot but for all sets.

Plotting: Saving plot from the HTML as PNG uses generic name

Not sure if this is fixable by default, but when saving a plot from the HTML page as a png using the built in save option it uses the generic name "newplot.png" by default. It'd be nice if when saving the plot as png it automatically used the gene set name.png to prevent users needing to manually rename each plot on save.

Rename arguments

Run standard GSEA

Args

<js>
<se>
<tst>
<tsd>
<ou> output directory

This and other commands need a plain text description of what part of the data each parameter is supposed to accept, without it we just have to guess which makes it difficult to tell if we're doing something wrong or the code is actually erroring.

Install Instructions Result in Dependencies Error

Hey Kwat,

I know this is still an ongoing process, but I thought I'd take a look at the install instructions just to see if I could get it to work.

git clone https://github.com/KwatMDPhD/GSEA.jl &&

cd GSEA.jl &&

julia --project deps/build.jl

results in the error

julia --project deps/build.jl
ERROR: LoadError: ArgumentError: Package Comonicon [863f3e99-da2a-4334-8734-de3dacbe5542] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

Stacktrace:
 [1] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1012
 [2] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:936
 [3] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:923
 [4] include
   @ ./Base.jl:384 [inlined]
 [5] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1235
 [6] top-level scope
   @ none:1
 [7] eval
   @ ./boot.jl:360 [inlined]
 [8] eval(x::Expr)
   @ Base.MainInclude ./client.jl:446
 [9] top-level scope
   @ none:1
in expression starting at /Users/acastanza/github/GSEA.jl/src/GSEA.jl:1
ERROR: LoadError: Failed to precompile GSEA [f74a9ba8-6f1f-48f2-98b6-a79c46cc06f7] to /Users/acastanza/.julia/compiled/v1.6/GSEA/jl_DeTjfv.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1385
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1329
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1043
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:936
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:923
in expression starting at /Users/acastanza/github/GSEA.jl/deps/build.jl:1

This is probably simple for someone fluent in julia to resolve (based on the error message it seem like it just needs to be told to first install dependencies with Pkg.instantiate()?) But I thought I'd let you know anyway. The Julia binary on Mac that I'm using is the latest 1.6.x (1.6.4 (Nov 19, 2021))

Plotting: Change Hover Marker Color

By default, when hovering over the plot it highlights the set gene at that point (great!) however, the hover line color is white, matching the background. This may be a darkmode issue (unconfirmed), but a midtone like a grey might be preferred.

Current behavior:
Screen Shot 2022-02-22 at 2 16 01 PM

Make cli gif a static image

It would be great if we could get a static image instead of a gif of the cli example. The gif loops too quickly to see what the cli help actually looks like and it'd be simpler to just have a static image.

Plotting: Annotate Maximum deviation from zero on plot

It would be nice if the point at which the Enrichment score was obtained (the maximum deviation from zero on the mountain plot) was annotated in some way - like a dot on that peak or a faint/dashed line. This can improve assessment of the mountain plot/ability to identify the leading edge, especially in cases where there might be multiple genes close together in the plot around the area where the ES was obtained.

InitError(mod=:Blink, error=AssertionError(msg="isfile(f)"))

gsea Wed Feb 9 10:34:43 2022
β”Œ Warning: Error requiring Mux from WebIO
β”‚ exception =
β”‚ LoadError: ArgumentError: Package WebIO does not have JSON in its dependencies:
β”‚ - If you have WebIO checked out for development and have
β”‚ added JSON as a dependency but haven't updated your primary
β”‚ environment's manifest file, try Pkg.resolve().
β”‚ - Otherwise you may need to report an issue with WebIO
β”‚ Stacktrace:
β”‚ [1] require(into::Module, mod::Symbol)
β”‚ @ Base /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [2] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
β”‚ @ Base /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [3] include_string(m::Module, txt::String, fname::String)
β”‚ @ Base /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [4] top-level scope
β”‚ @ /Users/kwat/.julia/packages/WebIO/Y7bGU/src/WebIO.jl:104
β”‚ [5] (::WebIO.var"#75#87")()
β”‚ @ WebIO /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [6] macro expansion
β”‚ @ timing.jl:299 [inlined]
β”‚ [7] err(f::Any, listener::Module, modname::String, file::String, line::Any)
β”‚ @ Requires /Users/kwat/.julia/packages/Requires/Z8rfN/src/require.jl:47
β”‚ [8] (::WebIO.var"#74#86")()
β”‚ @ WebIO /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [9] withpath(f::Any, path::String)
β”‚ @ Requires /Users/kwat/.julia/packages/Requires/Z8rfN/src/require.jl:37
β”‚ [10] (::WebIO.var"#73#85")()
β”‚ @ WebIO /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [11] listenpkg(f::Any, pkg::Base.PkgId)
β”‚ @ Requires /Users/kwat/.julia/packages/Requires/Z8rfN/src/require.jl:20
β”‚ [12] init()
β”‚ @ WebIO /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ in expression starting at /Users/kwat/.julia/packages/WebIO/Y7bGU/src/providers/mux.jl:1
β”” @ Requires /Users/kwat/.julia/packages/Requires/Z8rfN/src/require.jl:51
β”Œ Warning: Error requiring WebSockets from WebIO
β”‚ exception =
β”‚ LoadError: ArgumentError: Package WebIO does not have Sockets in its dependencies:
β”‚ - If you have WebIO checked out for development and have
β”‚ added Sockets as a dependency but haven't updated your primary
β”‚ environment's manifest file, try Pkg.resolve().
β”‚ - Otherwise you may need to report an issue with WebIO
β”‚ Stacktrace:
β”‚ [1] require(into::Module, mod::Symbol)
β”‚ @ Base /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [2] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
β”‚ @ Base /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [3] include_string(m::Module, txt::String, fname::String)
β”‚ @ Base /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [4] top-level scope
β”‚ @ /Users/kwat/.julia/packages/WebIO/Y7bGU/src/WebIO.jl:122
β”‚ [5] (::WebIO.var"#84#96")()
β”‚ @ WebIO /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [6] macro expansion
β”‚ @ timing.jl:299 [inlined]
β”‚ [7] err(f::Any, listener::Module, modname::String, file::String, line::Any)
β”‚ @ Requires /Users/kwat/.julia/packages/Requires/Z8rfN/src/require.jl:47
β”‚ [8] (::WebIO.var"#83#95")()
β”‚ @ WebIO /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [9] withpath(f::Any, path::String)
β”‚ @ Requires /Users/kwat/.julia/packages/Requires/Z8rfN/src/require.jl:37
β”‚ [10] (::WebIO.var"#82#94")()
β”‚ @ WebIO /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ [11] listenpkg(f::Any, pkg::Base.PkgId)
β”‚ @ Requires /Users/kwat/.julia/packages/Requires/Z8rfN/src/require.jl:20
β”‚ [12] init()
β”‚ @ WebIO /Applications/gsea/lib/julia/sys.dylib:-1
β”‚ in expression starting at /Users/kwat/.julia/packages/WebIO/Y7bGU/src/providers/generic_http.jl:1
β”” @ Requires /Users/kwat/.julia/packages/Requires/Z8rfN/src/require.jl:51
fatal: error thrown and no exception handler available.
InitError(mod=:Blink, error=AssertionError(msg="isfile(f)"))
YY.26_63796.clone_1.clone at /Applications/gsea/lib/julia/sys.dylib (unknown line)
jfptr_YY.26_63797.clone_1 at /Applications/gsea/lib/julia/sys.dylib (unknown line)
jl_apply_generic at /Applications/gsea/lib/julia/libjulia-internal.1.7.dylib (unknown line)
__init___63794.clone_1.clone at /Applications/gsea/lib/julia/sys.dylib (unknown line)
jfptr___init___63795.clone_1 at /Applications/gsea/lib/julia/sys.dylib (unknown line)
jl_apply_generic at /Applications/gsea/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_module_run_initializer at /Applications/gsea/lib/julia/libjulia-internal.1.7.dylib (unknown line)
_finish_julia_init at /Applications/gsea/lib/julia/libjulia-internal.1.7.dylib (unknown line)
julia_init at /Applications/gsea/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_init at /Applications/gsea/lib/julia/libjulia-internal.1.7.dylib (unknown line)
main at /Applications/gsea/bin/./gsea (unknown line)

Add comparison functions

Pearson correlation
Cosine distance
Mean difference
Median difference

What else? Comment below.

Use Julia LTS release

It looks like the latest development work has moved the GSEA.jl package to Julia 1.7.0.
Unless this is strictly needed for language features, I'd suggest using the latest LTS release instead, which has finally been upgraded to 1.6.4 from 1.0.
(Might be a discussion topic for the meeting today)

v0.3 ERROR: MethodError: Cannot `convert` an object of type InlineStrings.String31 to an object of type Bool

cmd: gsea run-standard-gsea /Users/acastanza/test/data/convert_output/c2.cp.wikipathways.v7.4.symbols.js /Users/acastanza/test/data/setting_for_standard_gsea.json /Users/acastanza/test/data/convert_output/score.gene_by_sample.tsv /Users/acastanza/test/data/convert_output/score.target_by_sample.tsv /Users/acastanza/test/data/sarc_out_test

ERROR: MethodError: Cannot `convert` an object of type InlineStrings.String31 to an object of type Bool
Closest candidates are:
  convert(::Type{T}, ::Ptr) where T<:Integer at pointer.jl:23
  convert(::Type{T}, ::Base.TwicePrecision) where T<:Number at twiceprecision.jl:262
  convert(::Type{T}, ::AbstractChar) where T<:Number at char.jl:185
  ...
Stacktrace:
 [1] setindex!(A::Vector{Bool}, x::InlineStrings.String31, i1::Int64)
   @ Base ./array.jl:903
 [2] fill_bitarray_from_itr!(B::BitVector, itr::DataFrames.DataFrameRow{DataFrames.DataFrame, DataFrames.Index})
   @ Base /Applications/gsea/lib/julia/sys.dylib:-1
 [3] gen_bitarray(#unused#::Base.HasLength, itr::DataFrames.DataFrameRow{DataFrames.DataFrame, DataFrames.Index})
   @ Base /Applications/gsea/lib/julia/sys.dylib:-1
 [4] run_standard_gsea(js::String, se::String, tst::String, tsd::String, ou::String)
   @ GSEA /Applications/gsea/lib/julia/sys.dylib:-1
 [5] command_main(ARGS::Vector{String})
   @ GSEA /Applications/gsea/lib/julia/sys.dylib:-1
 [6] julia_main()
   @ GSEA /Applications/gsea/lib/julia/sys.dylib:-1
 [7] top-level scope
   @ none:1

Input files that were successfully produced with the built-in convert commands (.txt extension added to allow github upload):
score.target_by_sample.tsv.txt
c2.cp.wikipathways.v7.4.symbols.js.txt
score.gene_by_sample.tsv.txt

settings json:
setting_for_standard_gsea.json.txt

run-standard-gsea Identical Statistics and No Plots

I ran sarcopenia data (my exact files here: https://drive.google.com/drive/folders/1ynugc7IRbQAWYBnQa9PaqwlEyyjMMUp1?usp=sharing) using the version I've built and installed on MacOS

With the command:

gsea run-standard-gsea /Users/acastanza/GSEA/setting_for_standard_gsea.json /Users/acastanza/GSEA/m2.cp.wikipathways.v0.2.symbols.gmt /Users/acastanza/GSEA/Sarcopenia_bianry_from_cls.tsv /Users/acastanza/Downloads/gse111016_allsamplescounts_htseqcov1_sss_forgeo.sarcopenia.vs.normal_counts_collapsed_to_symbols.tsv /Users/acastanza/GSEA/New_GSEA_test

The only value I changed in the json file was to set to 1000 permutations.

It seems to finish sucessfully

995/1000
  996/1000
  997/1000
  998/1000
  999/1000
  1000/1000
/Users/acastanza/GSEA/New_GSEA_test/set_by_statistic.tsv
Plotting

But when I open the set_by_statistic.tsv file (also included in the above drive link), It appears that all the sets have the exact same result statistics

Set	Enrichment	P-Value	Q-Value
WP_HOMOLOGOUS_RECOMBINATION	-0.9999999999997834	0.001	0.001
WP_METAPATHWAY_BIOTRANSFORMATION	-0.9999999999997834	0.001	0.001
WP_ACETYLCHOLINE_SYNTHESIS	-0.9999999999997834	0.001	0.001
WP_SREBF_AND_MIR33_IN_CHOLESTEROL_AND_LIPID_HOMEOSTASIS	-0.9999999999997834	0.001	0.001
WP_CALCIUM_REGULATION_IN_THE_CARDIAC_CELL	-0.9999999999997834	0.001	0.001
WP_IRON_HOMEOSTASIS	-0.9999999999997834	0.001	0.001

Also, no plots were produced. Any idea what I might've done wrong/what might be going on here?

Accept string `.cls`

When specifying the assignment of phenotypes to samples in the third line of the CLS file, the gsea convert-gct-and-cls command appears to only allow numeric values and not strings. If supplying strings (see attached cls file) the following error is recieved:

ERROR: ArgumentError: cannot parse "Normal" as Float64
Stacktrace:
[1] _parse_failure(T::Type, s::SubString{String}, startpos::Int64, endpos::Int64) (repeats 2 times)
@ Base ./parse.jl:373
[2] convert_gct_and_cls(gct::String, cls::String, output_directory::String)
@ GSEA /Applications/gsea/lib/julia/sys.dylib:-1
[3] command_main(ARGS::Vector{String})
@ GSEA /Applications/gsea/lib/julia/sys.dylib:-1
[4] julia_main()
@ GSEA /Applications/gsea/lib/julia/sys.dylib:-1
[5] top-level scope
@ none:1

File (.txt extension appended for GitHub upload):
sarcopenia.cls.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.