alexyermanos / Platypus

R package for the analysis of single-cell immune repertoires
GNU General Public License v3.0
36 stars 16 forks source link

VDJ_clonotype errors using vignette #20

Closed scas224 closed 1 year ago

scas224 commented 2 years ago

Hi,

I've been working through the CNS aging vignette, and I am having some errors under the section "changing the clonotype strategy" with the VDJ_clonotype function. When I run the following code from the vignette: vgm[[1]] <- VDJ_clonotype(platypus.version = "v3", VDJ = vgm[[1]], clone.strategy = "cdr3.aa", global.clonotype = F, output.format = "vgm", VDJ.VJ.1chain = F, hierarchical = T)

it returns the warning: Please consider using the updated function VDJ_clonotype_v3 with increased flexibility for hierarchical clonotyping and overall higher performance. Filtered out 0 cells containing more than one VDJ AND VJ chain, as these likely correspond to doublets Filtered out 0 cells containing more than one VDJ AND VJ chain, as these likely correspond to doublets

And print(length(unique(vgm[[1]]$new_clonal_feature))) returns 0

The same thing happens when running the code that groups by germline genes.

I tried editing the code to use VDJ_clonotype_v3, but then it returned this warning: Parameter output.format is deprecated. Standard output is VGM style VDJ by cell dataframe After function updates, please set hierachical to either 'none', 'single.chains', 'double.and.single.chains'. hierarchical was set to 'single.chains' based on your current input for backwards compatibility Clonotyping strategy: cdr3.aa Filtered out 1 cells containing more than one VDJ AND VJ chain or two VDJ chains, as these likely correspond to doublets Processing sample 1 of 2 Attempting to merge in 9 aberrant cells Processing sample 2 of 2 Attempting to merge in 28 aberrant cells Backing up 10x default clonotyping in columns clonotype_id_10x and clonotype_frequency_10x before updating clonotype_id and clonotype_frequency columns Removing columns from VDJ.GEX.matrix stemming from a previous clonotyping run with same setting

And print(length(unique(vgm[[1]]$new_clonal_feature))) still returns 0

Does anyone know what could be causing these issues and how to fix it? I have been following the vignette exactly.

alexyermanos commented 2 years ago

Hi can you try using the following function and see if this fixes the problem? but we will look into this already in the meantime

https://github.com/alexyermanos/Platypus/blob/master/R/VDJ_clonotype_v3.R

scas224 commented 1 year ago

Hi, I tried using that function and it did not seem to fix the problem. Any other ideas?

vickreiner commented 1 year ago

Hi! Sorry for the late reply: This is an issue in our vignette. We are currently working to update all.

The Clonotype_v3 function updates the vgm in two ways:

  1. It updates the columns clonotype_id and clonotype_frequency (These can be considered the columns containing the currently active clonotyping strategy and downstream functions pull from them)
  2. It adds three new columns containing clonal features, ids and frequencies. These are named according to the clonotyping strategy used. (In your case the id column would be named: clonotype_id_cdr3.aa) This allows users to have multiple different clonotyping results stored in the same vgm and should make comparisons between easier.

After clonotyping with VDJ_clonotype_v3 please check names(vgm[[1]]) to see the names of newly appended columns.

I will push an updated vignette later today. Hope this helps and please let us know about any further questions.