ncborcherding / scRepertoire

A toolkit for single-cell immune profiling
https://www.borch.dev/uploads/screpertoire/
MIT License
311 stars 54 forks source link

Unexpected behaviour of `filter.graph` in `clonalNetwork`? #376

Closed denvercal1234GitHub closed 5 months ago

denvercal1234GitHub commented 5 months ago

Hi Nick,

Thank you for the tool!

When I used filter.graph=T, only TMNC only shared with PBMC, but when I used filter.graph=T, there were now also sharing with TMNC as below.

Could you help me understand the difference? I thought filter.graph will only remove the arrows pointing back and it does not remove actual sharing?

Thank you again for your help.

clonalNetwork(proporTbyTCR_Tissue_Type, group.by = "Tissue_Cell_Leiden_w14TTMNC_CD8_26_MapQueryPBMCs_clusterID", cloneCall = "gene", filter.clones = NULL, filter.identity = NULL, chain="both", exportTable = T, reduction = "umap", filter.graph = F) -> df1

df1 %>% dplyr::filter(from == "TMNC_CD8T_25")
Screenshot 2024-06-06 at 00 45 29
clonalNetwork(cxcr5posnegcd8_TCR_TonsilPBMC_OnlyP230_contig_list_combined_wTonsilrefPBMCquery_MERGED_cd8_cxcr5posneg_T230T240T246.data_filtergene_filtercell_list_IndividualDatasetMERGED_denovoUMAP_proporTbyTCR_Tissue_Type, group.by = "Tissue_Cell_Leiden_w14TTMNC_CD8_26_MapQueryPBMCs_clusterID", cloneCall = "gene", filter.clones = NULL, filter.identity = NULL, chain="both", exportTable = T, reduction = "umap", filter.graph = T) -> df1

df1 %>% dplyr::filter(from == "TMNC_CD8T_25")
Screenshot 2024-06-06 at 00 46 27
ncborcherding commented 5 months ago

Hey Quang,

Without more info (or full screen shots) it will be hard to troubleshoot - please see Hadley's rundown of a reproducible example . If data privacy is a concern, please make an example with the built-in data from scRepertoire.

Thanks, Nick