Skip to content

Commit

Permalink
address #1061
Browse files Browse the repository at this point in the history
  • Loading branch information
PoisonAlien committed Oct 28, 2024
1 parent 6276e23 commit 79e5cd5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
7 changes: 6 additions & 1 deletion R/coOncoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ coOncoplot = function(m1, m2, genes = NULL, m1Name = NULL, m2Name = NULL,
colors = NULL, removeNonMutated = TRUE, anno_height = 2, legend_height = 4,
geneNamefont = 0.8, showSampleNames = FALSE, SampleNamefont = 0.5, barcode_mar = 1, outer_mar = 3, gene_mar = 1,
legendFontSize = 1.2, titleFontSize = 1.5, keepGeneOrder=FALSE,
bgCol = "#CCCCCC", borderCol = "white"){
bgCol = "#ecf0f1", borderCol = "white"){

if(is.null(genes)){
genes = unique(c(getGeneSummary(m1)[1:5, Hugo_Symbol], getGeneSummary(m2)[1:5, Hugo_Symbol]))
}else{
genes = unique(as.character(genes))
}

m1.genes = getGeneSummary(x = m1)[Hugo_Symbol %in% genes]
Expand All @@ -86,6 +88,9 @@ coOncoplot = function(m1, m2, genes = NULL, m1Name = NULL, m2Name = NULL,
mdt = mdt[order(MutatedSamples_m1, decreasing = TRUE)]
}else if(sortByM2){
mdt = mdt[order(MutatedSamples_m2, decreasing = TRUE)]
}else if(keepGeneOrder) {
mdt = split(mdt, mdt$Hugo_Symbol)[genes]
mdt = data.table::rbindlist(l = mdt, use.names = TRUE, fill = TRUE)
}else{
mdt = mdt[order(max, decreasing = TRUE)]
}
Expand Down
2 changes: 1 addition & 1 deletion R/print_mat.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
print_mat = function(maf, genes, removeNonMutated = TRUE, colors = NULL,
bgCol = 'gray70', borderCol = 'white', fontSize = 1,
bgCol = '#ecf0f1', borderCol = 'white', fontSize = 1,
plot2 = FALSE, test = FALSE, clinicalFeatures = NULL, sampleOrder = NULL,
additionalFeature = NULL, additionalFeaturePch = 20, additionalFeatureCol = "white", additionalFeatureCex = 0.9,
annotationDat = NULL, annotationOrder = NULL, annotationColor = NULL,
Expand Down
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Introduction

`maftools` provides a comprehensive set of functions for processing [MAF](https://docs.gdc.cancer.gov/Data/File_Formats/MAF_Format/) files and to perform most commonly used analyses in cancer genomics. See [here](http://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html) for a detailed usage and a case study.
maftools is a comprehensive toolkit for processing somatic variants from cohort-based cancer genomic studies. maftools offers over 80 functions to perform the most commonly required tasks in cancer genomics, using [MAF](https://docs.gdc.cancer.gov/Data/File_Formats/MAF_Format/) as the only input file type.

## Installation

Expand All @@ -27,11 +27,31 @@ A complete documentation of maftools using [TCGA LAML](https://www.nejm.org/doi/
<img src="https://user-images.githubusercontent.com/8164062/97981605-d8a59500-1dd2-11eb-9f5e-cc808f7b3f91.gif" height="320" height="400">
</p>

Besides the MAF files, maftools also facilitates processing of BAM files. Please refer to below vignettes and sections to learn more.
## Primary applications

maftools is extremely easy to use, starting with importing an [MAF](https://docs.gdc.cancer.gov/Data/File_Formats/MAF_Format/) file along with the associated clinical data. Once the data is successfully imported, the resulting MAF object can be passed to various functions. Key applications include:

- [Cohort summarization using oncoplots](https://bioconductor.org/packages/devel/bioc/vignettes/maftools/inst/doc/oncoplots.html#08_Combining_everything)
- [Identify co-occurring and mutually exclusive events](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#91_Somatic_Interactions)
- [Clinical enrichment analysis](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#96_Clinical_enrichment_analysis)
- [Detect cancer driver genes](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#92_Detecting_cancer_driver_genes_based_on_positional_clustering)
- [Infer tumor heterogeneity](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#99_Tumor_heterogeneity_and_MATH_scores)
- [Analyze known cancer signaling pathways](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#98_Oncogenic_Signaling_Pathways)
- [De-novo somatic signature analysis with NMF](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#9103_Signature_analysis)
- [Compare two cohorts to identify differentially mutated genes](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#95_Comparing_two_cohorts_(MAFs))
- [Perform survival analysis and predict genesets associated with survival](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#942_Predict_genesets_associated_with_survival)
- [Drug-gene interactions](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#97_Drug-Gene_Interactions)

Besides the MAF files, maftools can handle sequencing alignment BAM files, copy number output from GISTIC and mosdepth. Please refer to the package documentation sections below to learn more.

- [Copy number analysis](https://bioconductor.org/packages/devel/bioc/vignettes/maftools/inst/doc/cnv_analysis.html) with [ASCAT](https://github.com/VanLoo-lab/ascat) and [mosdepth](https://github.com/brentp/mosdepth)
- [Generate personalized cancer report](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/cancer_hotspots.html) for known somatic [hotspots](https://www.cancerhotspots.org/)
- [Sample mismatch and relatedness analysis](https://bioconductor.org/packages/devel/bioc/vignettes/maftools/inst/doc/maftools.html#12_Sample_swap_identification)
- [Copy number analysis](https://bioconductor.org/packages/devel/bioc/vignettes/maftools/inst/doc/cnv_analysis.html) with [ASCAT](https://github.com/VanLoo-lab/ascat) and [mosdepth](https://github.com/brentp/mosdepth)

Moreover, analyzing all 33 TCGA cohorts along with the harmonized clinical data is a breeze.

- A single command [tcgaLoad](https://bioconductor.org/packages/release/bioc/vignettes/maftools/inst/doc/maftools.html#13_TCGA_cohorts) will import the desired TCGA cohort thereby avoiding costly time spent on data mining from public databases.
- Please refer to an associated software package [TCGAmutations](https://github.com/PoisonAlien/TCGAmutations) that provides ready to use `MAF` objects for 33 TCGA cohorts and 2427 cell line profiles from CCLE - along with relevant clinical information for all sequenced samples.

## Citation

Expand Down
1 change: 1 addition & 0 deletions inst/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CHANGES IN VERSION 2.21.2

## BUG FIXES
- Bug fix in using `keepGeneOrder` in `coOncoplot()`. Issue: [1061](https://github.com/PoisonAlien/maftools/issues/1061)
- Bug fix in using `selectedPathways` in `oncoplot()`. Issue: [1041](https://github.com/PoisonAlien/maftools/issues/1041)
- Add an error message when bai files are missing `sampleSwaps()`. Issue: [1028](https://github.com/PoisonAlien/maftools/issues/1028)
- Bug fix in `tmb` while handling multiple MAFs. Issue: [1018](https://github.com/PoisonAlien/maftools/issues/1018)
Expand Down
2 changes: 1 addition & 1 deletion man/coOncoplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 79e5cd5

Please sign in to comment.