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

Add pciseq #7

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Add pciseq #7

wants to merge 8 commits into from

Conversation

habibrehman2002
Copy link

@habibrehman2002 habibrehman2002 commented Oct 30, 2024

Describe your changes

Added the pciSeq method to assignment methods
Modified the basic assignment method to create new cell_id index only from segmentation image, not prior AnnData

Checklist before requesting a review

  • I have performed a self-review of my code

  • Check the correct box. Does this PR contain:

    • Breaking changes
    • New functionality
    • Major changes
    • Minor changes
    • Bug fixes
  • Proposed changes are described in the CHANGELOG.md

  • CI Tests succeed and look good!

@habibrehman2002 habibrehman2002 marked this pull request as ready for review November 13, 2024 14:23
@@ -61,7 +73,7 @@
},
tables={
"table": ad.AnnData(
obs=sdata.tables["table"].obs[["cell_id", "region"]],
obs=pd.DataFrame(cell_id_col), # have to make the series a dataframe for some reason
Copy link
Contributor

Choose a reason for hiding this comment

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

adata.obs must be a data frame, can kick out the comment

'coordinate_system': 'global',
'output': '../pciSeq_assigned_transcripts.zarr',

'input_scrnaseq': '../brain_scrnaseq_subsample_WMB-10X.h5ad',
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you test with task_ist_preprocessing/resources_test/task_ist_preprocessing/mouse_brain_combined/scrnaseq_reference.h5ad ?
good to stick with the given resources in the VIASH START END section

}
## VIASH END

# # Set coordinate system to default if not given
Copy link
Contributor

Choose a reason for hiding this comment

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

can kick out unnecessary comments

# Assign cell ids to transcripts
print('Assigning transcripts to cell ids', flush=True)
y_coords = transcripts.y.compute().to_numpy(dtype=np.int64)
x_coords = transcripts.x.compute().to_numpy(dtype=np.int64)
Copy link
Contributor

Choose a reason for hiding this comment

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

does pciseq require integer positions?

Copy link
Contributor

Choose a reason for hiding this comment

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

use floats if fine for pciseq

# - segmentation 3D, transcripts 2D
# - segmentation 2D, transcripts 3D

# Subset sdata to transcripts with cell ids
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?

shutil.rmtree(par["output"])
sdata_transcripts_only.write(par['output'])

# TODO: is this a problem?
Copy link
Contributor

Choose a reason for hiding this comment

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

Am also confused why this is always printed, it's not a problem. When writing the object (as done here) and loading again, everything is fine.

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.

2 participants