flatironinstitute / inferelator

Task-based gene regulatory network inference using single-cell or bulk gene expression data conditioned on a prior network.
BSD 2-Clause "Simplified" License
47 stars 12 forks source link

Running StARS LASSO without TFA? #67

Closed OceaneCsn closed 1 year ago

OceaneCsn commented 1 year ago

Hello, Thanks for all the work put into developping the Inferelator! I am trying to run the regression method Stars-LASSO without computing TFA, so that prior information is included only via modulating the LASSO penalty strength. However, I am not sure this is possible in the current implementation. In the tutorial, I saw that for a workflow:

Which are not what I need. However I saw that other options were possible in the code, so I tried :

worker = inferelator_workflow(regression="stars", workflow="base")

worker.set_file_paths(input_dir="data/inferelator_inputs/",
                      output_dir="data/inferelator_outputs",
                      expression_matrix_file="expression.tsv",
                      tf_names_file="tf_names.tsv",
                      priors_file="priors.tsv")

worker.set_run_parameters(num_bootstraps=2, random_seed=42)
worker.set_network_data_flags(use_no_gold_standard=True)
network_result = worker.run()

This raises only a NotImplementedError. Can you help me?

Best regards, Océane

PS:I saw that the original Stars-LASSO was also available in MATLAB (https://github.com/emiraldi/infTRN_lassoStARS/blob/master/Th17_example/example_workflow_Th17.m) but I was hoping to use another language like python or R.

asistradition commented 1 year ago

That is, unfortunately, not currently implemented. The StARS-LASSO implementation here doesn't place a hyperprior on L1 (the BBSR implementation can incorporate prior knowledge in the regression by weighting the g-prior, but is set by default not to). The mLASSO-StARS implementation from that work is available only in matlab to the best of my knowledge.

You can disable the TFA computation by setting worker.set_tfa(tfa_driver=False), but that means that no prior information will be included at all when you run StARS-LASSO.

OceaneCsn commented 1 year ago

Thank you for your fast and detailed reply, this helps a lot. Cheers!