Hi, I have a question regarding the `DEFINE_CLONES...
# airrflow
j
Hi, I have a question regarding the
DEFINE_CLONES
element of the airrflow pipeline. For context I have bulk BCR data with UMIs with 2 timepoints per individual. In the sample sheet, these are represented with a different sample_id eg: R101T0 or R101T5, the subject_id for these samples would be the same R101 My question is, if the default
--clone_by
is set to
subject_id
, does the pipeline separate out clones seen in the 2 timepoints, but same subject - will they have different clone_id values, are they collapsed into a single clone and we loose that data or are they represented with the same clone_id and just on a separate row as the timepoints/sample_id is different? For example would it look like this: sampleID subject_ID junction_aa clone_id duplicate_count 101T0 101 ABC 1 1 101T5 101 ABC 1 1 or this 101T0 101 ABC 1 1 101T5 101 ABC 2 1 or 101T0 101 ABC 1 2 I am mainly worried about "exact" matches, as I can see that there are a few samples that have some differences in either sequence or V/J gene allele but assigned the same clone but different timepoints/sample_id For reference running airrflow=4.3.1,
--clonal-thresold=0.15
✅ 1
h
Hi, James. By default --clone_by is set to subject_id that means in your case, samples from different timepoints but the same subject will be put together to infer the clones. However, in the step of collapse duplicates, it's at sample level. As a result, sequences from samples of different timepoints will not be collapsed to one sequence even if they are the same and from same subject.
In Airrflow pipeline, scoper function
hierarchicalClones
was used to infer clones. The function provides a hierarchical agglomerative clustering approach to infer clonal relationships in high-throughput Adaptive Immune Receptor Repertoire sequencing (AIRR-seq) data. This approach clusters B or T cell receptor sequences based on junction region sequence similarity within partitions that share the same V gene, J gene, and junction length, allowing for ambiguous V or J gene annotations. In your case, as you set the clonal_threshold to 0.15, which means you allow sequences of the same V/J gene, junction length and maximum of 15% difference be assigned to the same clone.
j
Ok great - so the clone_id will be the same for the 2 timepoints but the duplicate_counts will be based on the sequence collapsed by sample_id?
h
Yes.
👍 1