I'd encourage you to write your own script for this. In TCGA MAF files, column 9 determines silent or non-silent status of mutations. Silent mutations are explicitly annotated as
Silent. Non-silent mutations are annotated as
Nonstop_Mutation. This website provides a good overview of the different types of mutations.
Be aware that dn/ds is used in the context of germline SNPs... to distinguish negative/positive selection pressure across generations. When doing the math on somatic SNPs, you have to be very careful how you interpret it. Tumor samples are heterogenous and not all the cells will have all the reported mutations. As you go through the literature, you will find many other reasons why cancer genetics is very different from germline genetics.
You can write your own script but it will be a bit more complicated than what has been described previously.
Indeed the real formula to compute the dn/ds is
[ (Number of synonymous mutation / Number of Synonymous sites) / (Number of Non-synonymous mutation / Number of Non-Synonymous sites) ]
In other therm you have to take in account the codon composition of your sequences to determine the number of Synonymous and Non-synonymous sites.
For your information Dn/Ds is also called Ka/Ks. There is many discussion about it (e.g Best Practices/Softwares To Calculate Ka/Ks Ratio ).