Skip to content

Commit

Permalink
Fixing immcantation testhat example
Browse files Browse the repository at this point in the history
  • Loading branch information
ncborcherding committed Mar 8, 2024
1 parent 9555d2b commit 1adabeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/loadContigs.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,14 @@ loadContigs <- function(input,
for (i in seq_along(df)) {
df[[i]][df[[i]] == ""] <- NA
df[[i]] <- as.data.frame(df[[i]])
df[[i]] <- df[[i]][,c("sequence_id", "locus", "consensus_count", "v_call", "d_call", "j_call", "c_call", "cdr3", "cdr3_aa")]
colnames(df[[i]]) <- c("barcode", "chain", "reads", "v_gene", "d_gene", "j_gene", "c_gene", "cdr3_nt", "cdr3")
if("c_call" %in% colnames(df[[i]])) {
df[[i]] <- df[[i]][,c("sequence_id", "locus", "consensus_count", "v_call", "d_call", "j_call", "c_call", "cdr3", "cdr3_aa")]
colnames(df[[i]]) <- c("barcode", "chain", "reads", "v_gene", "d_gene", "j_gene", "c_gene", "cdr3_nt", "cdr3")
} else {
df[[i]] <- df[[i]][,c("sequence_id", "locus", "consensus_count", "v_call", "d_call", "j_call", "cdr3", "cdr3_aa")]
colnames(df[[i]]) <- c("barcode", "chain", "reads", "v_gene", "d_gene", "j_gene", "cdr3_nt", "cdr3")
df[[i]][,"c_gene"] <- NA
}
df[[i]]$barcode <- str_split(df[[i]][,"barcode"], "_", simplify = TRUE)[,1]
}
return(df)
Expand Down
Binary file modified tests/testthat/testdata/load/loadContigs_Immcantation.rds
Binary file not shown.

0 comments on commit 1adabeb

Please sign in to comment.