Replies: 12 comments 3 replies
-
|
Hello, Were you able to subset the data? I would be interested of this feature too. |
Beta Was this translation helpful? Give feedback.
-
|
Hi,
yes, I could subset data!
It would be great if Seurat could provide tools to make susets!
Best,
NA
2024年3月11日(月) 9:44 gretajuu ***@***.***>:
… Hello,
Were you able to subset the data? I would be interested of this feature
too.
—
Reply to this email directly, view it on GitHub
<#7947 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDTAPAYBHXGRORICM5HYSYTYXVVGDAVCNFSM6AAAAAA6UVLX6WVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DONBSGQ4DQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Hi @NA0004, Could you please let me know how you subset the xenium data? Thanks, |
Beta Was this translation helpful? Give feedback.
-
|
Hey
I used subset_opt function
https://github.com/alikhuseynov/add-on_R/blob/develop/R/subset_obj_seurat.R
…On Mon, May 20, 2024, 00:00 Kelvin Mo ***@***.***> wrote:
Hi @NA0004 <https://github.com/NA0004>,
Could you please let me know how you subset the xenium data?
Thanks,
Kelvin
—
Reply to this email directly, view it on GitHub
<#7947 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXOTFKLXRPY7M33XSQ5E3ULZDFYM5AVCNFSM6AAAAAA6UVLX6WVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TIOJSGEZDE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks so much for sharing the function with me @ilovegreentea !! crop <- Crop(xenium.obj[["fov"]], x = c(-96.42, 3370.79), y = c(1162.64, 3130.46)) |
Beta Was this translation helpful? Give feedback.
-
|
Hi Kelvin,
I'm not sure, I understand your question well.
If you added fov to a xenium object before subset,
It also works in cropped images.
2024년 5월 20일 (월) 오전 3:24, Kelvin Mo ***@***.***>님이 작성:
… Thanks so much for sharing the function with me @ilovegreentea
<https://github.com/ilovegreentea> !!
This is my code and does this function work to subset the xenium object
based on coordinates of cropped image?
crop <- Crop(xenium.obj[["fov"]], x = c(-96.42, 3370.79), y = c(1162.64,
3130.46))
xenium.obj[["cropped"]] <- crop
—
Reply to this email directly, view it on GitHub
<#7947 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXOTFKL6GQKW6K5HUVANEADZDGQMJAVCNFSM6AAAAAA6UVLX6WVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TIOJTGIYDA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Sorry for the confusion. So what I did was to crop the image from the xenium data and stored it in xenium.obj[["cropped"]]. However, I was not able to access the metadata of the cropped subset. Can I know how would you use the subset_opt function to subset the xenium.obj based on the cropped image? Thanks, |
Beta Was this translation helpful? Give feedback.
-
|
Oh I got it.
I'm going to send my code.
I used barcode information in ***@***.******@***.***
xenium_obj<- Crop( xenium_obj [["fov"]], x = c(300, 2500), y = c(000,
2300), coords = "plot")
xenium_obj[[" xenium_obj _1"]] <- xenium_obj _1
***@***.***$sample_name <- ifelse( xenium_obj @meta.data$barcode
%in% xenium_obj ***@***.******@***.***, "annotation" ,
***@***.***$sample_name )
I hope I get it right this time.
Thanks,
KyuTae
2024년 5월 20일 (월) 오후 2:56, Kelvin Mo ***@***.***>님이 작성:
… Hi @ilovegreentea <https://github.com/ilovegreentea>
Sorry for the confusion. So what I did was to crop the image from the
xenium data and stored it in xenium.obj[["cropped"]]. However, I was not
able to access the metadata of the cropped subset. Can I know how would you
use the *subset_opt* function to subset the xenium.obj based on the
cropped image?
Thanks,
Kelvin
—
Reply to this email directly, view it on GitHub
<#7947 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXOTFKOWWNKYXCVM7HVKO73ZDJBNHAVCNFSM6AAAAAA6UVLX6WVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TIOJZHA4DO>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you so much @ilovegreentea ! This is helpful. One side question: After you crop the image and place it in xenium.obj[["xenium_obj_1"]], how do you access the cell identities or barcode information? For me, it's just an image under the "fov" of the xenium object without any info. |
Beta Was this translation helpful? Give feedback.
-
|
Why is my code obscured??
***@***.******@***.***
2024년 5월 20일 (월) 오후 3:17, Kelvin Mo ***@***.***>님이 작성:
… Thank you so much @ilovegreentea <https://github.com/ilovegreentea> !
This is helpful.
One side question: After you crop the image and place it in
xenium.obj[["xenium_obj_1"]], how do you access the cell identities or
barcode information? For me, it's just an image under the "fov" of the
xenium object without any info.
—
Reply to this email directly, view it on GitHub
<#7947 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXOTFKPGIEIIFZZKVWEBDATZDJD3VAVCNFSM6AAAAAA6UVLX6WVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TKMBQGAZTQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
You can use the standard subset function for Seurat objects. Once the cropped image is stored as "zoom", just pull out the cells. |
Beta Was this translation helpful? Give feedback.
-
|
My solution to this has been to build a new metadata column just for this operation, because subsetting on metadata works just fine. So, if we have a big object called 'sub' and we want to make a small object called 'demo', defined by a custom FOV/crop: define small cropcropped.coords <- Crop(sub[["PNX3_M2_Sp"]], set a new field of view (fov)sub[["demo"]] <- cropped.coords isolate demo into solitary objectinitialize new metadata columnsub$demo.cells <- NA identify cells to pullcropped.cells <- sub@images$demo$centroids@cells annotate the empty metadat acolumn to identify these desired cells as a groupsub$demo.cells[cropped.cells] <- 'demo' subset based on this group value within the new metadata columndemo <- subset(sub, subset = demo.cells == 'demo') inspect outputdemo |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to know how to subset Xenium object.
Following the tutorial "Analysis of Image-based Spatial Data in Seurat", I cropped xenium.obj using the tutorial codes.
cropped.coords <- Crop(xenium.obj[["fov"]], x = c(1200, 2900), y = c(3750, 4550), coords = "plot")
xenium.obj[["zoom"]] <- cropped.coords
Now I would like to make a new Xenium object of this area by using subset function so that I can analyze specific brain area and DEG between two areas using FindMarker function.
I have tried to use subset command mimicking visium tutorial found on the web, but I have been failing.
It would be very helpful if I could get help for subsetting Xenium object.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions