immunomind / immunarch

🧬 Immunarch: an R Package for Fast and Painless Exploration of Single-cell and Bulk T-cell/Antibody Immune Repertoires
https://immunarch.com
Apache License 2.0
312 stars 65 forks source link

what is the best way to merge different samples into a single immunarch object? #300

Closed eroesti closed 2 years ago

eroesti commented 2 years ago

❓ Questions and Help

Hi, Thank you for developing the package!!

I have a question regarding the correct way to merge different samples that were obtained from different 10X run (i.e. 5 different cellranger multi output).

What is the best way to unite them and proceed with your analysis with one object and 5 inner samples?

Thank you in advance, Eli

ivan-balashov commented 2 years ago

Hi, eroesti!

My name is Ivan, I am Immunarch developer;

I have a question regarding the correct way to merge different samples that were obtained from different 10X run (i.e. 5 different cellranger multi output).

Please, could you provide more details about your task: do you want to perform analysis within different samples (e.g. find most abundant clone in each samples separately) or you want to combine this 5 samples into one and after that use Immunarch functions for only one sample?

What is the best way to unite them and proceed with your analysis with one object and 5 inner samples?

The Immunarch data format is a list with data and meta objects inside; data is a named list (names is a sample names, it should match with Sample column in metadata table and values is a table(data.frame) with sample data), meta is a data.frame with Sample columns and other columns which you want to provide; you can inspect immdata/scdata/bcrdata (using data(immdata), for example) structure if something not clear; You can combine several data.frames into Immunarch compatible object with code like:

my_immdata<-list(data = list(Sample1 = df1, Sample2 = df2), meta = data.frame(Sample = c(Sample1, Sample2))) where df1 and df2 are data.frames you have containinig data about your cells or clonotypes;

Cheers, Ivan

eroesti commented 2 years ago

Hi Ivan,

Thank you for developing the package, and for your reply. Apologies for my delayed response.

Regarding question 1:

Please, could you provide more details about your task: do you want to perform analysis within different samples (e.g. find most abundant clone in each samples separately) or you want to combine this 5 samples into one and after that use Immunarch functions for only one sample?

Yes, that would be the second option.

The Immunarch data format is a list with data and meta objects inside; data is a named list (names is a sample names, it should match with Sample column in metadata table and values is a table(data.frame) with sample data), meta is a data.frame with Sample columns and other columns which you want to provide; you can inspect immdata/scdata/bcrdata (using data(immdata), for example) structure if something not clear; You can combine several data.frames into Immunarch compatible object with code like:

my_immdata<-list(data = list(Sample1 = df1, Sample2 = df2), meta = data.frame(Sample = c(Sample1, Sample2))) where df1 and df2 are data.frames you have containinig data about your cells or clonotypes.

Perfect!! Thank you very much, this should do it:)

Cheers Eli