Skip to content

Commit

Permalink
Merge pull request #330 from JHYSiu/loadContigs_Immcantation
Browse files Browse the repository at this point in the history
Update loadContigs.R Immcantation loading
  • Loading branch information
ncborcherding authored Mar 7, 2024
2 parents 50eb0fa + baf8377 commit 83ab850
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/loadContigs.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ loadContigs <- function(input,

if (format %in% c("10X", "WAT3R", "Omniscope")) {
df <- lapply(contig.files, read.csv)
} else if("json") {
} else if(format %in% c("json")) {
df <- lapply(contig.files, function(x) {
tmp <- as.data.frame(fromJSON(x))
})
Expand Down Expand Up @@ -229,9 +229,9 @@ 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_gene", "cdr3", "cdr3_aa")]
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")
df[[i]] <- str_split(df[[i]][,"barcode"], "_", simplify = TRUE)[,1]
df[[i]]$barcode <- str_split(df[[i]][,"barcode"], "_", simplify = TRUE)[,1]
}
return(df)
}

0 comments on commit 83ab850

Please sign in to comment.