This is a test version of Biostars. For the public version, visit https://www.biostars.org.
merge two maf objects

I am trying to use maftools to analyze some data. I already have two maf files and I could load them into R and analyze both. For each of them, the Tumor_Sample_Barcoad = __UNKNOWN__, and I would like to merge them together. By using these codes, I set their barcode differently:

del@variants.per.sample$Tumor_Sample_Barcode = "del"
wt@variants.per.sample$Tumor_Sample_Barcode = "wt"

Then, follow this post (Here), I merge them together by:

maf = maftools::merge_mafs( maf = c(del,wt), verbose = TRUE)

What I expected is a maf object with two samples (i.e., the barcode with del and wt); however, I got:

maf@variants.per.sample$Tumor_Sample_Barcode

[1] __UNKNOWN__
Levels: __UNKNOWN__

which makes me extremely confused. I tried to save the two maf objects into maf files and merge them using cat:

save(del, file = "del.maf")
save(wt, file = "wt.maf")

cat "del.maf" "wt.maf" > try.maf (linux)

However, it seems that I cannot save a maf object like this (as the file I got is unreadable). Is there any solution to this problem? Thanks a lot!

Session info:

sessionInfo()

R version 4.1.3 (2022-03-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.3

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] maftools_2.10.05

loaded via a namespace (and not attached):
[1] compiler_4.1.3     Matrix_1.4-0       tools_4.1.3        RColorBrewer_1.1-2 survival_3.3-1
[6] splines_4.1.3      grid_4.1.3         data.table_1.14.2  lattice_0.20-45
maftools r maf

0 answers

No answers yet.

Log in to answer this question.