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

Set key when creating Seurat objects from Assays #29

Merged
merged 4 commits into from
Nov 19, 2021
Merged

Conversation

mojaveazure
Copy link
Member

Fix issue where keys aren't being set when creating a Seurat object from an Assay
CreateSeuratObject.Assay now checks that the key of an assay has length and nchar
If not, creates a key from the assay name

Fix issue where keys aren't being set when creating a Seurat object from an Assay
CreateSeuratObject.Assay now checks that the key of an assay has length and nchar
If not, creates a key from the assay name
@mojaveazure
Copy link
Member Author

Test case with Signac

> library(Seurat)
Attaching SeuratObject
> library(Signac)
> packageVersion("SeuratObject")
[1] ‘4.0.3.9000> packageVersion("Signac")
[1] ‘1.4.0> data("atac_small")
> atac_small
An object of class Seurat 
1323 features across 100 samples within 3 assays 
Active assay: peaks (323 features, 323 variable features)
 2 other assays present: bins, RNA
 2 dimensional reductions calculated: lsi, umap
> counts <- GetAssayData(atac_small, assay = "peaks", slot = "counts")
> chrom_assay <- CreateChromatinAssay(counts)
> obj <- CreateSeuratObject(chrom_assay, assay = 'peaks')
Warning: Keys should be one or more alphanumeric characters followed by an underscore, setting key from peaks to peaks_
> Key(obj)
   peaks 
"peaks_" 

@mojaveazure mojaveazure merged commit 3186362 into develop Nov 19, 2021
@mojaveazure mojaveazure deleted the fix/assay_key branch November 19, 2021 17:39
@timoast
Copy link
Collaborator

timoast commented Nov 19, 2021

Looks good, and fixes the issues here: stuart-lab/signac#872

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