UMCUGenetics / MutationalPatterns

R package for extracting and visualizing mutational patterns in base substitution catalogues
MIT License
104 stars 45 forks source link

How to perform the mutational pattern analyses based on maf file or tab delimited MAF file #59

Open lincj1994 opened 3 years ago

lincj1994 commented 3 years ago

Hi, I want to perform the mutational pattern analyses but the original VCF files were lost. I have tried to convert the maf file to S4 object of class VRanges using VRanges function and found the similarity between the vrange object and required format of grange list. I wonder if there's any suggestion or way to perform the mutational pattern analyses using maf file, tab delimited MAF file, or S4 object of class VRanges. Any help is really appreciated.

FreekManders commented 3 years ago

Hi, VRanges are an extension of GRanges, but they currently don't work with the package. (I'll see if I can update the package to work with VRanges in the next release.) For now I think you might be able to use the makeGRangesFromDataFrame function. If you can read in the maf file as a regular data.frame, then you could use this function to convert the data.frame into a GRanges object. Alternatively you could also transform the VRanges object into a GRanges one with: granges(your_VRanges, use.mcols = TRUE). However, I have never worked with VRanges so I don't know if these transformations will make any unexpected modifications to your data. You will have to make sure that the VRanges step in the middle doesn't alter your data in some weird way. Please let me know if this helps.