scRepertoire - combineTCR error
0
1
Entering edit mode
11 months ago
sudeshna ▴ 20

Hello,

I am currently using the package scRepertoire for single-cell TCR and BCR repertoire analysis. I have 4 filtered_contig_annotations.csv TCR files obtained from the 10X Genomics Cell Ranger 5.0.0 pipeline and as mentioned in the scRepertoire vignette, I have created the object tcr_list. However, when I call combineTCR, I get the following error

combine_tcr<-combineTCR(tcr_list,samples=c("Control","Control","Patient","Patient"),
                    ID=c("T1","T2","T1","T2") ,cells="T-AB")

Error in `$<-.data.frame`(`*tmp*`, "sample", value = "Control"): replacement has 1 row, data has 0

The tcr_list object looks like this-

str(tcr_list)

List of 4
 $ :'data.frame':   3528 obs. of  18 variables:
  ..$ barcode         : chr [1:3528] "AAACCTGAGCTTCGCG-1" "AAACCTGAGCTTCGCG-1" "AAACCTGAGTCTCGGC-1" "AAACCTGAGTCTCGGC-1" ...
  ..$ is_cell         : chr [1:3528] "true" "true" "true" "true" ...
  ..$ contig_id       : chr [1:3528] "AAACCTGAGCTTCGCG-1_contig_1" "AAACCTGAGCTTCGCG-1_contig_2" "AAACCTGAGTCTCGGC-1_contig_1" "AAACCTGAGTCTCGGC-1_contig_2" ...
  ..$ high_confidence : chr [1:3528] "true" "true" "true" "true" ...
  ..$ length          : int [1:3528] 492 471 484 574 496 486 499 646 465 496 ...
  ..$ chain           : chr [1:3528] "TRB" "TRA" "TRB" "TRA" ...
  ..$ v_gene          : chr [1:3528] "TRBV27" "TRAV13-1" "TRBV4-2" "TRAV19" ...
  ..$ d_gene          : chr [1:3528] "" "" "TRBD2" "" ...
  ..$ j_gene          : chr [1:3528] "TRBJ1-5" "TRAJ52" "TRBJ2-1" "TRAJ45" ...
  ..$ c_gene          : chr [1:3528] "TRBC1" "TRAC" "TRBC2" "TRAC" ...
  ..$ full_length     : chr [1:3528] "true" "true" "true" "true" ...
  ..$ productive      : chr [1:3528] "true" "true" "true" "true" ...
  ..$ cdr3            : chr [1:3528] "CASSLVPNHQPQHF" "CAASIGAGGTSYGKLTF" "CASSHGTSGTYNEQFF" "CALSEWYSGGGADGLTF" ...
  ..$ cdr3_nt         : chr [1:3528] "TGTGCCAGCAGTTTAGTGCCCAATCATCAGCCCCAGCATTTT" "TGTGCAGCAAGTATAGGAGCTGGTGGTACTAGCTATGGAAAGCTGACATTT" "TGTGCCAGCAGCCACGGGACTAGCGGGACCTACAATGAGCAGTTCTTC" "TGTGCTCTGAGTGAGTGGTATTCAGGAGGAGGTGCTGACGGACTCACCTTT" ...
  ..$ reads           : int [1:3528] 4640 4362 3889 1027 4755 3193 17028 2292 1076 7997 ...
  ..$ umis            : int [1:3528] 7 8 5 2 12 6 32 4 3 20 ...
  ..$ raw_clonotype_id: chr [1:3528] "clonotype339" "clonotype339" "clonotype6" "clonotype6" ...
  ..$ raw_consensus_id: chr [1:3528] "clonotype339_consensus_1" "clonotype339_consensus_2" "clonotype6_consensus_1" "clonotype6_consensus_2" ...
 $ :'data.frame':   3823 obs. of  18 variables:
  ..$ barcode         : chr [1:3823] "AAACCTGAGACAGGCT-1" "AAACCTGAGACAGGCT-1" "AAACCTGAGTGTACCT-1" "AAACCTGAGTGTACCT-1" ...
  ..$ is_cell         : chr [1:3823] "true" "true" "true" "true" ...
  ..$ contig_id       : chr [1:3823] "AAACCTGAGACAGGCT-1_contig_1" "AAACCTGAGACAGGCT-1_contig_2" "AAACCTGAGTGTACCT-1_contig_1" "AAACCTGAGTGTACCT-1_contig_2" ...
  ..$ high_confidence : chr [1:3823] "true" "true" "true" "true" ...
  ..$ length          : int [1:3823] 503 610 491 492 522 520 549 623 513 501 ...
  ..$ chain           : chr [1:3823] "TRB" "TRA" "TRA" "TRB" ...
  ..$ v_gene          : chr [1:3823] "TRBV5-1" "TRAV8-6" "TRAV24" "TRBV27" ...
  ..$ d_gene          : chr [1:3823] "" "" "" "TRBD1" ...
  ..$ j_gene          : chr [1:3823] "TRBJ1-5" "TRAJ15" "TRAJ47" "TRBJ2-7" ...
  ..$ c_gene          : chr [1:3823] "TRBC1" "TRAC" "TRAC" "TRBC2" ...
  ..$ full_length     : chr [1:3823] "true" "true" "true" "true" ...
  ..$ productive      : chr [1:3823] "true" "true" "true" "true" ...
  ..$ cdr3            : chr [1:3823] "CASSLGSGINQPQHF" "CAVSFNQAGTALIF" "CASPMEYGNKLVF" "CASSLWTGAHEQYF" ...
  ..$ cdr3_nt         : chr [1:3823] "TGCGCCAGCAGCCTCGGCTCAGGAATCAATCAGCCCCAGCATTTT" "TGTGCTGTGAGTTTCAACCAGGCAGGAACTGCTCTGATCTTT" "TGTGCCTCCCCCATGGAATATGGAAACAAGCTGGTCTTT" "TGTGCCAGCAGTTTATGGACAGGGGCCCACGAGCAGTACTTC" ...
  ..$ reads           : int [1:3823] 9902 1551 1408 1710 692 2377 3960 5885 1440 497 ...
  ..$ umis            : int [1:3823] 20 4 3 3 3 4 5 15 7 1 ...
  ..$ raw_clonotype_id: chr [1:3823] "clonotype81" "clonotype81" "clonotype289" "clonotype289" ...
  ..$ raw_consensus_id: chr [1:3823] "clonotype81_consensus_1" "clonotype81_consensus_2" "clonotype289_consensus_2" "clonotype289_consensus_1" ...
 $ :'data.frame':   3855 obs. of  18 variables:
  ..$ barcode         : chr [1:3855] "AAACCTGAGAGACTAT-1" "AAACCTGAGGACAGAA-1" "AAACCTGAGGACAGAA-1" "AAACCTGAGGTGTTAA-1" ...
  ..$ is_cell         : chr [1:3855] "true" "true" "true" "true" ...
  ..$ contig_id       : chr [1:3855] "AAACCTGAGAGACTAT-1_contig_1" "AAACCTGAGGACAGAA-1_contig_1" "AAACCTGAGGACAGAA-1_contig_2" "AAACCTGAGGTGTTAA-1_contig_1" ...
  ..$ high_confidence : chr [1:3855] "true" "true" "true" "true" ...
  ..$ length          : int [1:3855] 559 547 499 501 476 685 518 540 470 526 ...
  ..$ chain           : chr [1:3855] "TRA" "TRA" "TRB" "TRB" ...
  ..$ v_gene          : chr [1:3855] "TRAV21" "TRAV21" "TRBV7-9" "TRBV27" ...
  ..$ d_gene          : chr [1:3855] "" "" "" "TRBD2" ...
  ..$ j_gene          : chr [1:3855] "TRAJ45" "TRAJ43" "TRBJ1-4" "TRBJ2-7" ...
  ..$ c_gene          : chr [1:3855] "TRAC" "TRAC" "TRBC1" "TRBC2" ...
  ..$ full_length     : chr [1:3855] "true" "true" "true" "true" ...
  ..$ productive      : chr [1:3855] "true" "true" "true" "true" ...
  ..$ cdr3            : chr [1:3855] "CAVSLYSGGGADGLTF" "CAVKGYMSNDMRF" "CASSLRPGTGPNEKLFF" "CASRGTGTSGSLAEQYF" ...
  ..$ cdr3_nt         : chr [1:3855] "TGTGCTGTGAGTTTGTATTCAGGAGGAGGTGCTGACGGACTCACCTTT" "TGTGCTGTGAAGGGTTATATGAGCAATGACATGCGCTTT" "TGTGCCAGCAGCCTTCGTCCCGGGACAGGACCGAATGAAAAACTGTTTTTT" "TGTGCCAGCAGGGGGACCGGCACTAGCGGGAGTTTAGCCGAGCAGTACTTC" ...
  ..$ reads           : int [1:3855] 940 394 1574 1430 3553 1218 1726 478 1872 3653 ...
  ..$ umis            : int [1:3855] 2 1 2 4 5 4 5 1 2 5 ...
  ..$ raw_clonotype_id: chr [1:3855] "clonotype17" "clonotype5" "clonotype5" "clonotype63" ...
  ..$ raw_consensus_id: chr [1:3855] "clonotype17_consensus_1" "clonotype5_consensus_2" "clonotype5_consensus_1" "clonotype63_consensus_1" ...
 $ :'data.frame':   4483 obs. of  18 variables:
  ..$ barcode         : chr [1:4483] "AAACCTGAGTGTCTCA-1" "AAACCTGAGTGTCTCA-1" "AAACCTGCAGCTCCGA-1" "AAACCTGCAGCTCCGA-1" ...
  ..$ is_cell         : chr [1:4483] "true" "true" "true" "true" ...
  ..$ contig_id       : chr [1:4483] "AAACCTGAGTGTCTCA-1_contig_1" "AAACCTGAGTGTCTCA-1_contig_2" "AAACCTGCAGCTCCGA-1_contig_1" "AAACCTGCAGCTCCGA-1_contig_2" ...
  ..$ high_confidence : chr [1:4483] "true" "true" "true" "true" ...
  ..$ length          : int [1:4483] 529 466 508 522 552 501 459 494 492 536 ...
  ..$ chain           : chr [1:4483] "TRA" "TRB" "TRB" "TRA" ...
  ..$ v_gene          : chr [1:4483] "TRAV14/DV4" "TRBV28" "TRBV12-4" "TRAV21" ...
  ..$ d_gene          : chr [1:4483] "" "" "" "" ...
  ..$ j_gene          : chr [1:4483] "TRAJ3" "TRBJ1-1" "TRBJ2-1" "TRAJ13" ...
  ..$ c_gene          : chr [1:4483] "TRAC" "TRBC1" "TRBC2" "TRAC" ...
  ..$ full_length     : chr [1:4483] "true" "true" "true" "true" ...
  ..$ productive      : chr [1:4483] "true" "true" "true" "true" ...
  ..$ cdr3            : chr [1:4483] "CAMREREYSSASKIIF" "CASRPTGNTEAFF" "CASSLEGSNEQFF" "CAVRPSGGYQKVTF" ...
  ..$ cdr3_nt         : chr [1:4483] "TGTGCAATGAGAGAGAGGGAGTACAGCAGTGCTTCCAAGATAATCTTT" "TGTGCCAGCAGACCTACAGGGAACACTGAAGCTTTCTTT" "TGTGCCAGCAGTTTGGAGGGGAGTAATGAGCAGTTCTTC" "TGTGCTGTGAGGCCATCTGGGGGTTACCAGAAAGTTACCTTT" ...
  ..$ reads           : int [1:4483] 494 3153 1211 1788 2537 982 767 731 2237 3865 ...
  ..$ umis            : int [1:4483] 1 10 6 3 9 3 2 1 4 13 ...
  ..$ raw_clonotype_id: chr [1:4483] "clonotype6" "clonotype6" "clonotype570" "clonotype570" ...
  ..$ raw_consensus_id: chr [1:4483] "clonotype6_consensus_2" "clonotype6_consensus_1" "clonotype570_consensus_1" "clonotype570_consensus_2" ...

.I was wondering what could be wrong and how to solve the problem.

Thank you

scRNA seq tcr clonotypes 10x R • 538 views
ADD COMMENT
1
Entering edit mode

The problem has been solved. In my dataset, the columns is_cell =" true" and productive ="true" are in lowercase. For the function combineTCR to work, it should be in uppercase - is_cell =" TRUE" and productive ="TRUE"

ADD REPLY

Login before adding your answer.

Traffic: 2466 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6