PoisonAlien / maftools

Summarize, Analyze and Visualize MAF files from TCGA or in-house studies.
http://bioconductor.org/packages/release/bioc/html/maftools.html
MIT License
447 stars 219 forks source link

Label trinucleotide context in plotSignatures graphic #85

Closed Adamtaranto closed 4 years ago

Adamtaranto commented 6 years ago

Does the poltSignatures function have a built in method for labelling individual bars in the resulting barplot with the corresponding trinucleotide context? As in Fig 5a from the Campbell et al. Cell paper Comprehensive Analysis of Hypermutation in Human Cancer.

If not, is it possible to get the trinucleotide labels + values from the extractSignatures object?

PoisonAlien commented 6 years ago

Hi, Unfortunately for now there is no option. But they are in the order similar to the one used by Sanger framework, like this.
You can also check this with results. rownames(sig$signatures)

aditibagchi commented 6 years ago

Hi , I am new to using maftools but eager to learn. using trinucleotideMatrix() is yielding the following error. trinucleotideMatrix(TRial_1, ref_genome = '~/desktop/hg38.fa') reading ~/desktop/hg38.fa (this might take few minutes).. Extracting 5' and 3' adjacent bases.. Error in .Call2("solve_user_SEW", refwidths, start, end, width, translate.negative.coord, : solving row 85: 'allow.nonnarrowing' is FALSE and the supplied start (145617289) is > refwidth + 1

Can you please please help me with this. Thank you Aditi

PoisonAlien commented 6 years ago

Hello,

Is your MAF file is generated with hg38 reference genome ? From error it appears that the chromosome length is smaller than the mutated base position. Make sure you are using the same reference build.

aditibagchi commented 6 years ago

Thank you so so much fro the reply. Yes it is hg38 built ; I tried using that first got a similar error

_trinucleotideMatrix(TRial_1, ref_genome = '~/desktop/hg38.fa') reading ~/desktop/hg38.fa (this might take few minutes).. Extracting 5' and 3' adjacent bases.. Error in .Call2("solve_userSEW", refwidths, start, end, width, translate.negative.coord, : solving row 85: 'allow.nonnarrowing' is FALSE and the supplied start (145617289) is > refwidth + 1

here is the top part of my maf file, my colleague generated it .

ID summary Mean Median 1: NCBI_Build NA NA NA 2: Center NA NA NA 3: Samples 34 NA NA 4: nGenes 3242 NA NA 5: Frame_Shift_Del 123 3.618 3.0 6: Frame_Shift_Ins 56 1.647 1.0 7: In_Frame_Del 18 0.529 0.0 8: In_Frame_Ins 20 0.588 0.0 9: Missense_Mutation 3333 98.029 32.0 10: Nonsense_Mutation 306 9.000 2.0 11: Nonstop_Mutation 5 0.147 0.0 12: Splice_Site 110 3.235 2.0 13: Translation_Start_Site 2 0.059 0.0 14: total 3973 116.853 42.5

I see that she did insert the NCBI build in the file, do you think inserting that will solve the problem.

Thanks again, :) aditi

PoisonAlien commented 6 years ago

I dont think thats the issue. There seem to be some issue with the locus 145617289 which appears to be larger than the chromosome length itself. Can you check which chromosome this position belongs to ? You can grep it from terminal or you can run this below command in R.

maftools::subsetMaf(maf = TRial_1, query = "Start_Position == 145617289", fields = "Chromosome")
aditibagchi commented 6 years ago

maftools::subsetMaf(maf = TRial_1, query = "Start_Position == 145617289", fields = "Chromosome") Empty data.table (0 rows) of 9 cols: Hugo_Symbol,Chromosome,Start_Position,End_Position,Reference_Allele,Tumor_Seq_Allele2...

Thats what came up with the command.

PoisonAlien commented 6 years ago

Okay, thats weird. Its hard for me to guess whats wrong with it. Is it possible to share your MAF file ? You can attach it here or mail me at anandmt3@gmail.com , you can remove any sensitive information if thats the concern.

aditibagchi commented 6 years ago

Yup I think I can do that, let me see. Thanks again. It is weird I know I have tried.

jrcodina commented 2 years ago

What happened in the end? I am having a similar error. I also can't find the locus that is giving error in my file.