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
302 stars 65 forks source link

Creating metadata file for multiple hashed samples #354

Open learning-MD opened 1 year ago

learning-MD commented 1 year ago

Hi, I have a multiplexed 10x 5' gene expression run (5 samples hashed together) and the TCR/BCR reconstructed using TRUST4. In such a case, where there are multiple samples all within the same file, how would you recommend creating a metadata file that would link the appropriate barcodes with the corresponding sample? That way, I can accurately use the analytical features of immunarch (e.g., grouping by age, disease condition, etc.). Thank you!

learning-MD commented 1 year ago

@Alexander230

I was successful in making the metadata file (using barcodes from my Seurat object to merge with the barcodes from the TRUST4 output).

However, when I convert the TRUST4's *_barcode_report.tsv file to a 10X filtered_contig_annotations files (includes both T and B cell receptors in one file) and try to import it into immunarch, I get the following error:

immdata <- repLoad("immunarch_contigs")

== Step 1/3: loading repertoire files... ==

Processing "immunarch_contigs" ...
  -- [1/36] Parsing "immunarch_contigs/Sample_1.tsv" -- 10x (filt.contigs)
Error in while (is.na(recomb_type) && i < 100 && !is.na(.name[i])) { :                                                                                      
  missing value where TRUE/FALSE needed

I'm not sure what's wrong here - any suggestions would be appreciated. It's similar to https://github.com/immunomind/immunarch/issues/285. This is how the filtered_contig_annotations.csv file for a sample looks like, if it helps:

image

Thanks!

EDIT: I tried both the dev version and the non-dev recent version of immunarch - had the same issue with both.

TheRaspberryFox commented 1 year ago

I am also having this error occur when reading in my filtered_contig_annotations.csv file. Any luck in figuring this out?