Skip to content

fix input, close #87#88

Merged
dimalvovs merged 5 commits intomainfrom
nextflow
Dec 19, 2025
Merged

fix input, close #87#88
dimalvovs merged 5 commits intomainfrom
nextflow

Conversation

@dimalvovs
Copy link
Collaborator

@dimalvovs dimalvovs commented Dec 17, 2025

fix input for main.nh, close #87

in addition, harmonize SD outputs, before:
// IMScores: IMScores.rds with row names holding gene names,
// followed by cell_type1_near_cell_typeN columns, values are IMScores
// LRscores: LRscores.rds with row names holding ligand-receptor pair names,
// followed by cell_type1_near_cell_typeN columns, values are LRscores
and
// IMScores: spacemarkers.csv first column is Gene with gene name,
// followed by cell_type1_cell_typeN columns, values are spacemarkers

now:
// IMScores: IMScores.rds with row names holding gene names,
// followed by cell_type1_near_cell_typeN columns, values are IMScores
// LRscores: LRscores.rds with row names holding ligand-receptor pair names,
// followed by cell_type1_near_cell_typeN columns, values are LRscores
and
// IMScores: spacemarkers.rds with row names holding gene names,
// followed by cell_type1_cell_typeN columns, values are spacemarkers

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes input handling for the main Nextflow workflow and harmonizes SpaceMarkers output format from CSV to RDS for consistency with other pipeline outputs.

  • Changes spaceMarkers output from CSV to RDS format for consistency
  • Updates data structure to use row names for gene identifiers instead of a separate column
  • Modernizes Groovy syntax from tuple() to bracket notation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +131 to +132
sm <- readRDS("$spaceMarkers")
plot_names <- colnames(sm)
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After changing the data format to RDS with genes as rownames (lines 67-69), the data frame no longer contains a "Gene" column. However, the plotIMScores function on line 134 expects the input data frame to have a "Gene" column (see R/utils.R line 156: df$genes <- df$Gene). This will cause the plotting code to fail.

Consider converting rownames back to a "Gene" column before calling plotIMScores, for example:

sm <- readRDS("$spaceMarkers")
sm$Gene <- rownames(sm)
plot_names <- colnames(sm)
plot_names <- plot_names[plot_names != "Gene"]
Suggested change
sm <- readRDS("$spaceMarkers")
plot_names <- colnames(sm)
sm <- readRDS("$spaceMarkers")
sm$Gene <- rownames(sm)
plot_names <- colnames(sm)
plot_names <- plot_names[plot_names != "Gene"]

Copilot uses AI. Check for mistakes.
Copy link
Member

@atuldeshpande atuldeshpande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Do we want a temporary colnames sanity check in hdPipeline.R?

@dimalvovs
Copy link
Collaborator Author

dimalvovs commented Dec 19, 2025

actually I tried integrating in the latest version of the pipeline, and it does not look good:
SD outputs IMscores as Gene and spacemarkers metric

_index
cell_type1_cell_type_2
cell_type1_cell_type_3
...

SD does not output LRscores.

HD outputs IMscores as

_index
cell_interaction
effect_size
gene
n1
n2
p.adj
p.value
statistic

HD outputs LRscores as

_index
celltype0_to_celltype1
celltype0_to_celltype2
...

so IMscores for SD looks similar to LRscores of HD, and IMscores of HD looks unique.

Needs fixing by future gen!

@dimalvovs dimalvovs merged commit 07b53c6 into main Dec 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug in unnamed workflow inputs

3 participants