Save vj_sequences in a dataframe
This commit is contained in:
parent
a7c1df5ce2
commit
83819b296b
|
@ -32,13 +32,13 @@ get_vj_sequence <- function(metadata, names, vdj_segments) {
|
|||
}
|
||||
|
||||
fetch_vj_sequences <- function(sequences, vdj_segments) {
|
||||
vj_sequences <- mclapply(names(sequences),
|
||||
vj_sequences <- sapply(names(sequences),
|
||||
names(vdj_segments),
|
||||
vdj_segments,
|
||||
FUN = get_vj_sequence,
|
||||
mc.cores = detectCores()
|
||||
FUN = get_vj_sequence
|
||||
)
|
||||
return(c(vj_sequences[1], vj_sequences[2]))
|
||||
results <- data.frame(t(vj_sequences))
|
||||
return(results)
|
||||
}
|
||||
|
||||
align_sequence <- function(sequence, vdj_segment) {
|
||||
|
@ -52,15 +52,10 @@ align_sequence <- function(sequence, vdj_segment) {
|
|||
|
||||
# TODO Extract CDR3
|
||||
get_hvr_sequences <- function(sequences, vdj_segments) {
|
||||
vj_sequences <- fetch_vj_sequences(sequences, vdj_segments)
|
||||
v_alignment <- parallel::mcmapply(sequences,
|
||||
vj_sequences[1],
|
||||
FUN = align_sequence
|
||||
)
|
||||
j_alignment <- parallel::mcmapply(sequences,
|
||||
vj_sequences[2],
|
||||
FUN = align_sequence
|
||||
)
|
||||
df <- fetch_vj_sequences(sequences, vdj_segments)
|
||||
v_alignment <- parallel::mcmapply(sequences, df$v_seq, FUN = align_sequence)
|
||||
j_alignment <- parallel::mcmapply(sequences, df$j_seq, FUN = align_sequence)
|
||||
print(v_alignment)
|
||||
}
|
||||
|
||||
data <- parse_data(file = "data/curesim_sequence.fastq")
|
||||
|
|
Loading…
Reference in New Issue