@@ -1040,8 +1040,6 @@ parse_10x_filt_contigs <- function(.filename, .mode) {
1040
1040
.skip = 0 , .sep = " ," , # .add = c("chain", "raw_clonotype_id", "raw_consensus_id", "barcode", "contig_id")
1041
1041
.add = c(" chain" , " barcode" , " raw_clonotype_id" , " contig_id" , " c_gene" )
1042
1042
)
1043
- # setnames(df, "raw_clonotype_id", "RawClonotypeID")
1044
- # setnames(df, "raw_consensus_id", "RawConsensusID")
1045
1043
1046
1044
# Process 10xGenomics filtered contigs files - count barcodes, merge consensues ids, clonotype ids and contig ids
1047
1045
df <- df [order(df $ chain ), ]
@@ -1052,16 +1050,17 @@ parse_10x_filt_contigs <- function(.filename, .mode) {
1052
1050
lazy_dt() %> %
1053
1051
group_by(barcode , raw_clonotype_id ) %> %
1054
1052
summarise(
1055
- CDR3.nt = paste0(CDR3.nt , collapse = IMMCOL_ADD $ scsep ),
1056
- CDR3.aa = paste0(CDR3.aa , collapse = IMMCOL_ADD $ scsep ),
1057
- V.name = paste0(V.name , collapse = IMMCOL_ADD $ scsep ),
1058
- J.name = paste0(J.name , collapse = IMMCOL_ADD $ scsep ),
1059
- D.name = paste0(D.name , collapse = IMMCOL_ADD $ scsep ),
1060
- chain = paste0(chain , collapse = IMMCOL_ADD $ scsep ),
1061
- # raw_clonotype_id = gsub("clonotype", "", paste0(raw_clonotype_id, collapse = IMMCOL_ADD$scsep)),
1062
- # raw_consensus_id = gsub("clonotype|consensus", "", paste0(raw_consensus_id, collapse = IMMCOL_ADD$scsep)),
1063
- contig_id = gsub(" _contig_" , " " , paste0(contig_id , collapse = IMMCOL_ADD $ scsep )),
1064
- c_gene = paste0(c_gene , collapse = IMMCOL_ADD $ scsep )
1053
+ CDR3.nt = paste0(get(" CDR3.nt" ), collapse = IMMCOL_ADD $ scsep ),
1054
+ CDR3.aa = paste0(get(" CDR3.aa" ), collapse = IMMCOL_ADD $ scsep ),
1055
+ V.name = paste0(get(" V.name" ), collapse = IMMCOL_ADD $ scsep ),
1056
+ J.name = paste0(get(" J.name" ), collapse = IMMCOL_ADD $ scsep ),
1057
+ D.name = paste0(get(" D.name" ), collapse = IMMCOL_ADD $ scsep ),
1058
+ chain = paste0(get(" chain" ), collapse = IMMCOL_ADD $ scsep ),
1059
+ contig_id = gsub(
1060
+ " _contig_" , " " ,
1061
+ paste0(get(" contig_id" ), collapse = IMMCOL_ADD $ scsep )
1062
+ ),
1063
+ c_gene = paste0(get(" c_gene" ), collapse = IMMCOL_ADD $ scsep )
1065
1064
) %> %
1066
1065
as.data.table()
1067
1066
}
@@ -1070,16 +1069,17 @@ parse_10x_filt_contigs <- function(.filename, .mode) {
1070
1069
lazy_dt() %> %
1071
1070
group_by(CDR3.nt , V.name , J.name ) %> %
1072
1071
summarise(
1073
- Clones = length(unique(barcode )),
1074
- CDR3.aa = first(CDR3.aa ),
1075
- D.name = first(D.name ),
1076
- chain = first(chain ),
1077
- barcode = paste0(unique(barcode ), collapse = IMMCOL_ADD $ scsep ),
1078
- raw_clonotype_id = gsub(" clonotype|None" , " " , paste0(unique(raw_clonotype_id ), collapse = IMMCOL_ADD $ scsep )),
1079
- # raw_clonotype_id = gsub("clonotype", "", paste0(raw_clonotype_id, collapse = IMMCOL_ADD$scsep)),
1080
- # raw_consensus_id = gsub("clonotype|consensus", "", paste0(raw_consensus_id, collapse = IMMCOL_ADD$scsep)),
1081
- contig_id = paste0(contig_id , collapse = IMMCOL_ADD $ scsep ),
1082
- c_gene = first(c_gene )
1072
+ Clones = length(unique(get(" barcode" ))),
1073
+ CDR3.aa = first(get(" CDR3.aa" )),
1074
+ D.name = first(get(" D.name" )),
1075
+ chain = first(get(" chain" )),
1076
+ barcode = paste0(unique(get(" barcode" )), collapse = IMMCOL_ADD $ scsep ),
1077
+ raw_clonotype_id = gsub(
1078
+ " clonotype|None" , " " ,
1079
+ paste0(unique(get(" raw_clonotype_id" )), collapse = IMMCOL_ADD $ scsep )
1080
+ ),
1081
+ contig_id = paste0(get(" contig_id" ), collapse = IMMCOL_ADD $ scsep ),
1082
+ c_gene = first(get(" c_gene" ))
1083
1083
) %> %
1084
1084
as.data.table()
1085
1085
0 commit comments