Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplified code in application_prediction.get_weighted_ligand_target_links #314

Open
wants to merge 51 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
dd7a859
Merge pull request #261 from saeyslab/devel
csangara Apr 25, 2024
162750e
fixed make_line_plot bugs
csangara May 29, 2024
38fca49
Merge pull request #273 from saeyslab/issue-272-fix
csangara May 29, 2024
50f4001
added check for if underscore is in celltype name
csangara May 29, 2024
7ccddb7
fix assign_ligands_to_celltype
csangara May 29, 2024
236d67d
bump version to 2.1.2
csangara May 29, 2024
c54fba5
changed slot checking
csangara May 29, 2024
fca3811
minor fix
csangara May 29, 2024
a8bade9
Merge pull request #275 from saeyslab/issue-268-fix
csangara May 29, 2024
d9e4228
Merge branch 'master' into issue-265-fix
csangara May 30, 2024
0b52423
Merge branch 'master' into issue-265-fix
csangara May 30, 2024
5ebf85c
bump to 2.1.3, roxygen files
csangara May 30, 2024
ad34615
Merge pull request #274 from saeyslab/issue-265-fix
csangara May 30, 2024
02ccc9c
fixed to handle empty general_ligands vector
csangara May 30, 2024
8146643
bump to 2.1.4
csangara May 30, 2024
a7f9038
Merge pull request #277 from saeyslab/issue-276-fix
csangara May 30, 2024
94e9055
fixed mistake in grouping metadata
csangara May 30, 2024
ddf50b7
bump to version 2.1.5
csangara May 30, 2024
d8a5b5a
Merge pull request #279 from saeyslab/issue-278-fix
csangara May 30, 2024
86cce32
minimal workflow for checking installation
csangara Aug 1, 2024
625ce1c
removed limma dependency
csangara Aug 1, 2024
9fa6211
add pull request
csangara Aug 1, 2024
7af8ca9
add check part to include package installation
csangara Aug 1, 2024
0e91dac
add args
csangara Aug 1, 2024
d5bc10d
only install 'imports'
csangara Aug 1, 2024
193f03e
fix for 1 sender cell type in LFC plot
csangara Aug 20, 2024
24275b1
changed naming order of p_val_adapted columns
csangara Aug 27, 2024
6867057
changed default color column to scaled p-val; added other checks
csangara Aug 27, 2024
8489e1c
add extra tests of prior table and mushroom plot
csangara Aug 27, 2024
27542c0
update alias_to_symbol_seurat behavior for v5 objects
csangara Aug 27, 2024
7bda2d8
Merge pull request #299 from saeyslab/issue-298
csangara Aug 28, 2024
0f387bd
update workflow to include R CMD check
csangara Aug 28, 2024
6a70024
change job name
csangara Aug 28, 2024
b888707
add testthat installation
csangara Aug 28, 2024
11ba965
change default behavior
csangara Aug 28, 2024
c44b091
add clauses about mean_rank_GST_log_pval and limma installation
csangara Aug 28, 2024
157b0ce
Merge branch 'master' into install
csangara Aug 28, 2024
2e834d0
only fail checks on error, not warnings
csangara Aug 28, 2024
aeb6dc2
Merge branch 'install' of https://github.com/saeyslab/nichenetr into …
csangara Aug 28, 2024
842946d
Merge pull request #290 from saeyslab/install
csangara Aug 29, 2024
9508523
Merge branch 'master' into issue-297
csangara Aug 29, 2024
83e88eb
add ranking by default
csangara Aug 29, 2024
6439360
add use_absolute_rank option for multiple receiver cell types
csangara Aug 29, 2024
2ff94b1
update vignette
csangara Aug 29, 2024
f072b81
update tests
csangara Aug 29, 2024
395e1c7
update prioritization weights
csangara Aug 30, 2024
fca57c4
Merge pull request #300 from saeyslab/issue-297
csangara Sep 5, 2024
41e1acf
bump to v2.2.0
csangara Sep 5, 2024
f9906f3
Merge pull request #302 from saeyslab/v2.2.0
csangara Sep 5, 2024
cd20539
simplified code in application_prediction.get_weighted_ligand_target_…
vmedaert Feb 18, 2025
87760a3
removed redundant selects in get_lfc_celltype
vmedaert Feb 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
workflow_dispatch:
pull_request:

name: check-standard

permissions: read-all

jobs:
check-standard:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
extra-packages: |
any::rcmdcheck
any::testthat
any::knitr
any::rmarkdown
local::.
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
args: 'c("--no-manual","--no-build-vignettes","--no-examples")'
build_args: 'c("--no-manual","--no-build-vignettes", "--no-resave-data")'
error-on: '"error"'
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nichenetr
Type: Package
Title: NicheNet: Modeling Intercellular Communication by Linking Ligands to Target Genes
Version: 2.1.0
Title: Modeling Intercellular Communication by Linking Ligands to Target Genes with NicheNet
Version: 2.2.0
Authors@R: c(person("Robin", "Browaeys", role = c("aut")),
person("Chananchida", "Sang-aram", role = c("aut", "cre"), email = "[email protected]"))
Description: This package allows you the investigate intercellular communication from a computational perspective. More specifically, it allows to investigate how interacting cells influence each other's gene expression. Functionalities of this package (e.g. including predicting extracellular upstream regulators and their affected target genes) build upon a probabilistic model of ligand-target links that was inferred by data-integration.
Expand All @@ -10,8 +10,9 @@ Encoding: UTF-8
LazyData: true
URL: https://github.com/saeyslab/nichenetr
BugReports: https://github.com/saeyslab/nichenetr/issues
RoxygenNote: 7.1.2
RoxygenNote: 7.3.1
Depends: R (>= 3.0.0)
biocViews:
Imports:
tidyverse,
data.table,
Expand All @@ -27,7 +28,6 @@ Imports:
fdrtool,
ROCR,
caTools,
limma,
Hmisc,
caret,
randomForest,
Expand All @@ -52,6 +52,7 @@ Suggests:
rmarkdown,
testthat,
doMC,
limma,
mco,
parallel,
covr,
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ importFrom(igraph,get.data.frame)
importFrom(igraph,graph_from_adjacency_matrix)
importFrom(igraph,page_rank)
importFrom(igraph,sample_degseq)
importFrom(limma,wilcoxGST)
importFrom(magrittr,set_colnames)
importFrom(magrittr,set_rownames)
importFrom(purrr,reduce)
Expand Down
8 changes: 3 additions & 5 deletions R/application_prediction.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ get_weighted_ligand_target_links = function(ligand, geneset,ligand_target_matrix
targets = intersect(ligand_target_matrix[,ligand] %>% .[. >= top_n_score ] %>% names(),geneset)
if (length(targets) == 0){
ligand_target_weighted_df = tibble(ligand = ligand, target = NA, weight = NA)
} else if (length(targets) == 1) {
ligand_target_weighted_df = tibble(ligand = ligand, target = targets, weight = ligand_target_matrix[targets,ligand])
} else {
ligand_target_weighted_df = tibble(ligand = ligand, target = names(ligand_target_matrix[targets,ligand])) %>% inner_join(tibble(target = names(ligand_target_matrix[targets,ligand]), weight = ligand_target_matrix[targets,ligand]), by = "target")
ligand_target_weighted_df = tibble(ligand = ligand, target = targets, weight = ligand_target_matrix[targets,ligand])
}
return(ligand_target_weighted_df)
}
Expand Down Expand Up @@ -2189,9 +2187,9 @@ get_lfc_celltype = function(celltype_oi, seurat_obj, condition_colname, conditio
SeuratV4 = c("avg_log2FC") %in% colnames(DE_table_sender)

if(SeuratV4 == TRUE){
DE_table_sender = DE_table_sender %>% as_tibble() %>% select(-p_val) %>% select(gene, avg_log2FC)
DE_table_sender = DE_table_sender %>% as_tibble() %>% select(gene, avg_log2FC)
} else {
DE_table_sender = DE_table_sender %>% as_tibble() %>% select(-p_val) %>% select(gene, avg_logFC)
DE_table_sender = DE_table_sender %>% as_tibble() %>% select(gene, avg_logFC)
}

colnames(DE_table_sender) = c("gene",celltype_oi)
Expand Down
Loading
Loading