This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Write maf file (opposite of read.maf)

Good morning,

I was wondering if someone could advise me on the following:

I have read a maf file via

read.maf(path.maf)

then I did some modifications. Now I would like to simply write this maf file again in the same format as a read it. I was looking for a function

write.maf 

but I came only along the funciton write.mafSummary which I feel will modify the file. Any suggestions how I could save it so that afterwards I can simply read it again via read.maf?

Thanks so much!

maf maftools r

1 answer

A MAF file is just a table with specified columns. Could you not do this via reading it in as a tab-separated text file, performing the manipulation, then writing it out using write.table("updated_file.maf",...)?

I have moved this from a comment to an answer.

To reiterate MAF is not a format in the classical sense of a novel and complex information structure.

MAF means a tab delimited text format where certain columns have to be present,

hence, the simplest way to modify it is to just read in a tab-delimited, column-based file, modify the column and save it right back with write.table

Great thank you

Log in to answer this question.