Advances in RNA sequencing (RNA-seq) technologies that measure the transcriptome of biological samples have revolutionised our ability to understand transcriptional regulatory programs that underpin diseases such as cancer. We recently published singscore - a single sample, rank-based gene set scoring method which quantifies how concordant the transcriptional profile of individual samples are relative to specific gene sets of interest. Here we demonstrate the application of singscore to investigate transcriptional profiles associated with specific mutations or genetic lesions in acute myeloid leukemia. Using matched genomic and transcriptomic data available through the TCGA we show that scoring of appropriate signatures can distinguish samples with corresponding mutations, reflecting the ability of these mutations to drive aberrant transcriptional programs involved in leukemogenesis. We believe the singscore method is particularly useful for studying heterogeneity within a specific subsets of cancers, and as demonstrated, we show the ability of singscore to identify where alternative mutations appear to drive similar transcriptional programs. Transcriptomic analyses have traditionally focused on ‘differential expression’ of genes between sets of samples, however with the rapid growth of publicly available RNA data there has been increasing usage of ‘relative approaches’, which quantify the relative concordance of a sample or samples with a specific gene signature1. While sequencing of genomic mutations has been important for classifying different tumour subsets based upon the presence of mutations or fusion genes, and identifying genetic lesions which may act as drivers of cancer progression, transcriptomic profiling can provide further information on the state or phenotype of cells carrying these mutations. Cancers are a heterogeneous set of diseases with a number of clinical and pathological subtypes. In diseases such as breast cancer the primary clinical classifications relate to the expression of hormone receptors  or the overexpression of Erb-B2 receptor tyrosine kinase (HER2), as these features can be directly targeted with therapeutic agents. A common example of transcriptomic or gene expression data informing clinical practice is the use of prediction analysis of microarray 50 (PAM50) signatures for distinguishing the intrinsic breast cancer subtypes [1]. For many other cancers, subtype classification has largely relied upon identifying sets of recurrent mutations across large patient cohorts, with whole genome or whole exome sequencing studies helping to resolve the clinically significant subtypes [et al.4].The development of microarrays and more recently the rapid uptake of RNA-sequencing technologies have provided a platform to examine the transcriptional profile (or transcriptome) of biological samples5, often used through theGenePattern web-tool. Another common approach isgene set variation analysis (GSVA)6 which is available as an R/Bioconductor package that also includes functionality for ssGSEA, an alternative approach known as PLAGE7, and a z-score based approach8. Both ssGSEA and GSVA use a Kolmogorov-Smirnov like random-walk statistic to convert normalised gene ranks to the resulting score, however this normalisation procedure means that the scores are not truly ‘single-sample’, and variations in the overall sample composition for a study (e.g. variations in the presence or relative frequency of different cancer subtypes) can lead to unexpected changes in sample scores. Furthermore, the resultant scores from these methods can vary in their range and absolute value, making them difficult to interpret without further processing. To overcome this, we have developed a single-sample gene set scoring methodsingscore9 which simply uses the ranks of genes within a given set, normalised relative to the maximum and minimum theoretical scores for a gene set of a given size.Perhaps the most well-known ‘relative approach’ is single-sample gene set enrichment analysis (ssGSEA)9 can be used to classify TCGA AML samples using transcriptional ‘gene signatures’ for the NPM1c mutation,KMT2A (MLL) gene fusions, andPML-RARA gene fusions that were derived from independent studies. Without any need for parameter fitting or estimation, we show that gene set scoring with singscore can distinguish samples carrying these mutations. The case studies we present demonstrate the application of gene set scoring to examine not only the differences, but also the relative similarities between established subtypes of AML that impact clinical outcome. This workflow is available as a bioconductor workflow package fromhttps://bioconductor.org/packages/release/workflows/html/SingscoreAMLMutations.html.Through large scale efforts such as The Cancer Genome Atlas (TCGA), transcriptomic data are available for thousands of clinical samples, often together with corresponding genomic or epigenomic (often DNA methylation) data. These transcriptomic data can help to characterise the functional effects of corresponding mutations, and provide a window to study the heterogeneity which arises within different subtypes of cancer due to epigenetic and transcriptional regulatory programs which can also influence cell behaviour. Here, we demonstrate that the single-sample gene set scoring method singscore3. A more recent study which focused primarily on genomic data has further refined the clinically significant AML subtypes4, highlighting a number of co-occurring as well as mutually exclusive mutations. As the identification of putative driver fusions/mutations continues, work has also been directed towards how these lesions interact with each other and other features  to drive transcriptional changes as discussed in a recent review10.As with most cancers, acute myeloid leukemia (AML) is a heterogeneous disease with a number of classified subtypes. Analysis of TCGA AML genomic data identified a number of subtypes based upon the presence or absence of specific ‘driver mutations’; recapitulating and expanding upon previously identified clinical subsetsNPM1) gene4. This mutation leads to aberrant localisation of nucleophosmin with cytoplasmic accumulation rather than localising to the nucleolus, and accordingly this mutation is often referred to as the NPM1c mutation11. As noted by Verhaaket al.12, the NPM1c mutation is associated with dysregulated activity of the homeobox domain (Hox) family of transcription factors which are essential for developmental patterning. The effects of this mutation in disease progression have been further demonstrated in recent work which showed that loss of NPM1c leads to differentiation of AML cells11.Of note for this work, one of the most common mutations in clinical AML samples is a frameshift mutation within exon 12 of the nucleophosmin  fusion genes, partial tandem duplications withinKMT2A (KMT2A-PTD), and fusion genes between promyelocytic leukemia and retinoic acid receptor alpha (PML-RARA). Given the role of NPM1c in dysregulating the Hox gene family, it is interesting to note that AML samples with MLL fusion genes also show dysregulated expression of Hox family genes [14]; however, samples withMLL-PTD appear to show a relatively distinct phenotype from MLL-fusion samples14. While there is good evidence demonstrating the role of NPM1c mutations and other genetic lesions in blocking AML cell differentiation, thePML-RARA fusion subset is diagnostic for a specific subset of AML known as acute promyelocytic leukemia (APL). This clinically distinct subtype of AML is associated with a specific morphology under the French-American-British (FAB) classification of AML, FAB-M3, with cells showing a distinct morphology due to a differentiation block at the promyelocyte stage15.Further recurrent genetic lesions in AML relevant for this work include lysine methyl transferase 2A 17, we demonstrate that a bi-directional scoring approach can classify TCGA AML samples with corresponding mutations with a good precision and recall. A particularly useful feature of gene set scoring is the ability to project samples onto 2D or higher-order landscapes defined by corresponding phenotypic signatures. Accordingly, by comparing scores for both the NPM1c andKMT2A-/MLL-fusion signatures, we show that this classification likely arises through the shared downstream biological effects of Hox family dysregulation. We also compare the NPM1c mutation signature to thePML-RARA signature and show a clear separation of these subtypes reflecting their divergent phenotypes and the mutually exclusive nature of these mutations.In this workflow we demonstrate the ability of the singscore method for single sample gene set scoringWhile we demonstrate that singscore is capable of inferring mutation status from the transcriptional profile of AML samples, we note that it is best used to supplement alternative data which can provide a more definitive resolution of these lesions. Processing of raw RNA seq data will directly identify the presence of gene fusion products or mutations within protein-coding regions, although for many large data sets the quantified transcript abundance data are much easier to obtain without access agreements. The method can also be applied to legacy microarray data sets where genome and RNA sequencing data are unavailable. As such singscore provides a useful approach to supplement established methods for the study of genetic lesions in cancer. By exploring associations between different genomic and phenotypically relevant signatures, it may also help to better characterise true driver mutations which exert consistent effects on the transcriptome of AML samples and other cancers.cBioPortal andFireBrowse. The GDC data used STAR to perform a two-pass alignment followed by quantification using HTSeq. Data from the GDC can be downloaded using theGDC data transfer tool which allows users to select the specific files of interest using the GDC portal. These files then have to be read, merged, annotated and processed into a data structure that simplifies downstream analysis. Alternatively, all the above mentioned steps, including the download, can be performed using the R packageTCGAbiolinks18. The package supports data download using the GDC API and the GDC client. We will use the TCGAbiolinks package to download, annotate and process the data into a SummarizedExperiment R object.Data from TCGA project is made available through the Genomic Data Commons (GDC). Open access data from the project can be accessed in multiple pre-processed formats. Transcriptomic data can be downloaded either at the count level or as FPKM transformed abundance, before or after upper quantile normalisation. Other pre-processed version can be found from sources such as the1. Create a query to select the files to download2. Execute the query and download the data3. Read the data into R4. Filter out genes with low expression5. 9Normalise the data for compositional bias and transform to account for gene-length biases as outlined in the singscore manuscriptThe following steps need to be performed to prepare the data:getGDCInfo function returns the release date of all data on the GDC along with a version.The first step in any analysis should be to determine and report the data version and the service used to download the data. Thelibrary(SingscoreAMLMutations)library(TCGAbiolinks)         #get GDC version information  gdc_info = getGDCInfo       gdc_info                      ## $commit## [1] "b18b2385b1e916597856067dc6437f3c20b46bca"#### $data_release## [1] "Data Release 19.0 - September 17, 2019"#### $status## [1] "OK"#### $tag## [1] "1.22.0"#### $version## [1] 1MANIFEST file using the GDC portal. The first parameter of the query specifies the project - available projects can be accessed usinggetGDCprojects or fromhttps://portal.gdc.cancer.gov/projects. The TCGA acute myeloid leukemia data is part of the TCGA-LAML project. Following this, the data category, data type and workflow type need to be specified. The query formed below selects files containing the count level transcriptomic measurements. Values for different parameters of the query can be identified from “searching arguments” section of the “query” vignette:vignette. The result of this query will be a dataframe containing filenames and additional annotations related to the files.A query then needs to be run, using the GDC to identify the specific files for download. This step is similar to generating aRead count level data are selected instead of the processed FPKM data as one of the downstream pre-processing analysis results in filtering out of genes. A general recommendation is to compute FPKM values after filtering genes out so as to ensure counts are normalised by the corresponding library sizes. In cases where count-level data is not available, filtering can be performed directly on FPKM values, provided that the library size is large enough.#form a query for the RNAseq data               query_rna = GDCquerydata.category = ’Transcriptome Profiling’,    data.type = ’Gene Expression Quantification’, workflow.type = ’HTSeq - Counts’              )                                               #extract results of the query                   rnaseq_res = getResults(query_rna)              dim(rnaseq_res)                                 ## [1] 151 28colnames(rnaseq_res)                            ## [1] "data_release"               "data_type"## [3] "updated_datetime"           "file_name"## [5] "submitter_id"               "file_id"## [7] "file_size"                  "cases"## [9] "id"                         "created_datetime"## [11] "md5sum"                    "data_format"## [13] "access"                    "state"## [15] "version"                   "data_category"## [17] "type"                      "experimental_strategy"## [19] "project"                   "analysis_id"## [21] "analysis_updated_datetime" "analysis_created_datetime"## [23] "analysis_submitter_id"     "analysis_state"## [25] "analysis_workflow_link"    "analysis_workflow_type"## [27] "analysis_workflow_version" "tissue.definition"GDCdownload function then executes the query on the GDC database and begins downloading the data using the GDC API. The download method should be changed to “client”, if the size of the data is expected to be large, e.g for RNA-seq read data or methylation data. It is good practice to specify the directory for data storage - we store all the data in the “GDCdata” directory in the temporary directory. Users should store their data in a permanent storage to retain the data. The function downloads the data and organises it into the folder based on parameters specified in the query. This allows multiple different levels and types of data to be stored in the same directory structure. Files with counts are stored atTEMPDIR/GDCdata/TCGA-LAML/harmonized/Transcriptome_Profiling/Gene_Expression_Quantification/.Thedatapath = file.path                GDCdownload #(size: 39MB)GDCprepare function reads and processes the downloaded data into aRangedSummarizedExperiment object from theSummarizedExperiment package which allows patient annotations, gene annotations and count data to be stored in one object. Patient annotations are downloaded upon calling this function and subsequently mapped and attached to the resulting object. A RangedSummarizedExperiment object is similar to an ExpressionSet object but provides added functionality such as indexing with genomic coordinates and storing multiple data matrices with the same structure. Feature annotations used to annotate the data are stored in an RDA/RDATA file.Theaml_se = GDCprepare   rowData(se) andcolData(se), respectively, and the counts data can be accessed usingassay(se). TCGA data usually contains some formalin-fixed paraffin-embedded (FFPE) samples which should be discarded from the analysis as the protocol introduces biological artefacts. This procedure is only performed on solid tumours and not leukemias, therefore, no filtering is required for this data set.The object contains data for 56,925 features and 151 samples. The original data files contain 60,483 features, some of which  could not be mapped to ENSEMBL GRCh38.p12. Feature and sample annotations can be accessed usingaml_se                                                 ## class: RangedSummarizedExperiment## dim: 56512 151## metadata(1): data_release## assays(1): HTSeq - Counts## rownames(56512): ENSG00000000003 ENSG00000000005 ...##   ENSG00000281912 ENSG00000281920## rowData names(3): ensembl_gene_id external_gene_name##   original_ensembl_gene_id## colnames(151): TCGA-AB-3001-03A-01T-0736-13##   TCGA-AB-2853-03A-01T-0734-13 ... TCGA-AB-2977-03B-01T-0760-13##   TCGA-AB-2995-03A-01T-0735-13## colData names(61): sample patient ... name is_ffpeedgeR package contains methods that assist in the data normalisation and transformation required for filtering and subsequent steps. The methods require a DGEList object therefore we begin by creating a DGEList for the AML data from the SummarizedExperiment.Thelibrary(SummarizedExperiment)                                     library(edgeR)                                                    aml_dge = DGEList(counts = assay(aml_se), genes = rowData(aml_se))et al.19 and Lawet al.20 filter genes based on the experimental design whereby the proportion of samples with enough read counts are evaluated per experimental group. As the AML data have many samples, filtering is performed across all samples rather than within sub-groups. Group specific filtering would be recommended for the study of rare groups. The distribution of logCPMs is much closer to the expected log-normal distribution after filtering out genes with low counts as seen inGenes with low counts across most samples are discarded from the analysis. This is a standard step in differential expression analysis as inclusion of such genes in the analysis could skew estimates of dispersion. It is also motivated in rank-based analysis, such as with singscore, to avoid rank duplication. Rank duplication reduces the discriminant power of scores as the number of unique ranks is reduced. A commonly used filter is to select only those genes that have CPMs above a certain threshold across a proportion of samples. Filtering is performed on the CPMs rather than raw counts as the former accounts for variation in library sizes, therefore, is unbiased. For instance, a CPM of 1 would equate to read counts between 19 and 50 for samples in the AML data where library sizes vary between 18.6 and 49.7 million reads. Here, we retain genes that have a CPM > 1 across more than 50% of the samples. Other methods to filter out genes with low counts exist and may be preferable in specific applications. Chenprop_expressed = rowMeans(cpm(aml_dge) > 1)                                keep = prop_expressed > 0.5                                                op = par(no.readonly = TRUE)                                               par)                                                       hist, main = ’Unfiltered’, xlab = ’logCPM’)       abline(v = log(1), lty = 2, col = 2)                                       hist, main = ’Filtered’, xlab = ’logCPM’) abline(v = log(1), lty = 2, col = 2)                                       par(op)                             #subset the data                                  aml_dge = aml_dge aml_se = aml_se                           21. Transformations such as transcripts per million (TPM) and reads/fragments per kilobase per million (RPKM/FPKM), that normalise by gene length, may be used. Both- TPM and RPKM/FPKM values should produce similar results when applying singscore provided that the library size is large enough, which they are here. RPKM values are generally computed after correcting for compositional biases. ThecalcNormFactors function in edgeR provides three methods to do so, TMM normalisation being the default. Chenet al.19 and Lawet al.20 discuss the implications of normalisation prior to down-stream processing such as differential expression analysis. Normlisation is generally performed for cross-sample analysis where samples need to be comparable. Singscores are invariant to data normalisation as the analysis is contained within the sample of interest. The idea extends to any transformation that preserves the relative ranks of genes within a sample such as a log transformation. Here, we use TMM normalisation solely for visualisation purposes.Singscore requires gene expression measurements to be comparable between genes within a sample, therefore, correction for gene length bias needs to be performedhttps://docs.gdc.cancer.gov/Data/Bioinformatics_Pipelines/Expression_mRNA_Pipeline/). HTSeq quantifies reads mapping to the exons of each gene, therefore, effective gene lengths can be calculated as the sum of all exons spanning the gene. The GENCODE v22 annotation file was used for quantification therefore the same file needs to be used to compute gene lengths.Data transformation to TPM or RPKM/FPKM requires the lengths for all genes to be calculated. Gene lengths need to be computed based on the alignment and quantification parameters. The TCGA transcriptomic data has been aligned using STAR and quantified using HTSeq                                                                          download.file #(size: 39MB) rtracklayer R package provides functions to help parse GTF files.Thelibrary(rtracklayer)                                                                        library(plyr)                                                                               gtf = import.gff #split records by gene to group exons of the same gene                                      grl = reduce$gene_id))                                      gene_lengths = ldply {                                                       #sum up the length of individual exons                                                        return(c(’gene_length’ = sum(width(x))))                                                }, .id = ’ensembl_gene_id’)                                                                 Genes are also annotated with their biotype for further analysis. The annotation file uses Ensembl IDs with versions as keys to records, which then need to be converted to Ensembl IDs. This is simply achieved by truncating the trailing version number.#extract information on gene biotype                                               genetype = unique(elementMetadata(gtf))               colnames(genetype)[1] = ’ensembl_gene_id’                                          gene_lengths = merge                                       #remove ENSEMBL ID version numbers                                                 gene_lengths$ensembl_gene_id = gsub saveRDS                  gene_lengths                                                                       ## DataFrame with 60483 rows and 3 columns##       ensembl_gene_id      gene_type gene_length##           <character>    <character>   <integer>## 1     ENSG00000000003 protein_coding        4535## 2     ENSG00000000005 protein_coding        1610## 3     ENSG00000000419 protein_coding        1207## 4     ENSG00000000457 protein_coding        6883## 5     ENSG00000000460 protein_coding        5967## ...               ...            ...         ...## 60479 ENSGR0000275287       misc_RNA         290## 60480 ENSGR0000276543          miRNA          68## 60481 ENSGR0000277120          miRNA          64## 60482 ENSGR0000280767        lincRNA         515## 60483 ENSGR0000281849      antisense         484The SummarizedExperiment object allows feature annotations to be stored, therefore, information on gene length and biotypes should be added to the existing annotations. Similarly, annotations need to be added to the DGEList object. The column containing lengths should include “length” in its name.#allocate rownames for ease of indexing                                     rownames(gene_lengths) = gene_lengths$ensembl_gene_id                       rowData(aml_se)$gene_length = gene_lengths rowData(aml_se)$gene_biotype = gene_lengths  #annotate gene lengths for the DGE object                                   aml_dge$genes$length = gene_lengths       RPKM/FPKM values can now be calculated with the computed gene lengths after computing the normalisation factors. The SummarizedExperiment object can store multiple levels of the data simultaneously, provided that the number of features and samples remains the same across measurements. As such, FPKM values are appended to the existing object.aml_dge_tmm = calcNormFactors       #compute FPKM values and append to assays                    assay = rpkm aml_se                                                       ## class: RangedSummarizedExperiment## dim: 17412 151## metadata(1): data_release## assays(2): HTSeq - Counts logFPKM_TMM## rownames(17412): ENSG00000000419 ENSG00000000457 ...##   ENSG00000281772 ENSG00000281896## rowData names(5): ensembl_gene_id external_gene_name##   original_ensembl_gene_id gene_length gene_biotype## colnames(151): TCGA-AB-3001-03A-01T-0736-13##   TCGA-AB-2853-03A-01T-0734-13 ... TCGA-AB-2977-03B-01T-0760-13##   TCGA-AB-2995-03A-01T-0735-13## colData names(61): sample patient ... name is_ffpe3  rather than variant calls from the standard TCGA pipeline  and readers should note that there are some discrepancies between these. For genetic lesions of interest , patients were identified by the following criteria:Patient ID: The ‘TCGA Patient ID’ column was extracted directlyNPM1c: TRUE if the ‘NPM1’ column contains the strings ‘p.W287fs’ or ‘p.W288fs’KMT2A-fusion: TRUE if the ‘MLL-partner’ column contains the string ‘MLL-’ or ‘-MLL’ KMT2A-PTD: TRUE if the ‘MLL-PTD’ column contains the string ‘exons’PML-RARA: TRUE if the ‘PML-RARA’ column contains the string ‘PML-RARA’For this analysis we have used the curated mutation list from the original TCGA AML publicationdata(AMLPatientMutationsTCGA)                                            patient_mutations = AMLPatientMutationsTCGA                              patient_mutations = patient_mutations # order samplesaml_mutations = colnames(patient_mutations) # get mutation labels        colData(aml_se) = cbind(colData(aml_se), patient_mutations)              colData(aml_se)                                         ## DataFrame with 151 rows and 4 columns##                              NPM1c.Mut KMT2A.Fusion KMT2A.PTD  PML.RARA##                              <logical>    <logical> <logical> <logical>## TCGA-AB-3001-03A-01T-0736-13     FALSE        FALSE     FALSE      TRUE## TCGA-AB-2853-03A-01T-0734-13      TRUE        FALSE     FALSE     FALSE## TCGA-AB-2929-03A-01T-0735-13     FALSE        FALSE     FALSE     FALSE## TCGA-AB-2939-03A-01T-0740-13     FALSE        FALSE     FALSE     FALSE## TCGA-AB-2982-03B-01T-0748-13     FALSE        FALSE     FALSE      TRUE## ...                                ...          ...       ...       ...## TCGA-AB-2815-03A-01T-0734-13     FALSE        FALSE     FALSE     FALSE## TCGA-AB-3000-03A-01T-0736-13     FALSE        FALSE     FALSE     FALSE## TCGA-AB-2919-03A-01T-0740-13      TRUE        FALSE     FALSE     FALSE## TCGA-AB-2977-03B-01T-0760-13     FALSE        FALSE      TRUE     FALSE## TCGA-AB-2995-03A-01T-0735-13     FALSE        FALSE     FALSE     FALSE22. However, RefSeq annotations (Entrez IDs) may be better suited to RNA-seq analyses which require a stable reference annotation for comparison23. As such, we choose to map Ensembl IDs to Entrez IDs and discard any unmapped features.Ensembl annotations (Ensembl IDs) have higher coverage of the genome which may be useful in applications such as variant calling and similar exploratory analysisorg.Hs.eg.db annotation R package which provides a stable set of annotations, thereby enhancing reproducibility. Mapping is performed with themapIds function in theAnnotationDbi R package.Mapping can be performed using the Ensembl Biomart service, which can be queried using the biomaRt bioconductor package. This would provide the most up to date annotations. Alternatively, mapping could be performed with the bi-annually updatedlibrary(org.Hs.eg.db)               rowData(aml_se)$entrezgene = mapIds,            keytype = ’ENSEMBL’,                column = ’ENTREZID’,                multiVals = ’asNA’                  )                                 gene_annot = rowData(aml_se)        NAs, then discarded to enforce unique mapping. Similarly, Entrez IDs that map to multiple Ensembl IDs are identified from the mapping, and discarded. Only features with unique Ensembl ID to Entrez ID mappings remain.Multimapped Ensembl IDs are replaced by#select genes with mapped Entrez IDs                                           keep = !is.na(gene_annot$entrezgene)                                           #select genes with unique Entrez IDs                                           dup_entrez = gene_annot$entrezgene[duplicated(gene_annot$entrezgene)]          keep = keep & !gene_annot$entrezgene %in% dup_entrez                           #Biotype of discarded genes (due to non-unique mapping)                        head, decreasing = TRUE), n = 10)####         processed_pseudogene                          antisense##                         1017                                903##                      lincRNA                                TEC##                          451                                263##               sense_intronic                     protein_coding##                          249                                138##       unprocessed_pseudogene transcribed_unprocessed_pseudogene##                          128                                 93##         processed_transcript   transcribed_processed_pseudogene##                           72                                 72#subset the data                                                               aml_se = aml_se                                                        et al.12 is now used to predict the mutation status of the NPM1c mutation. This is done by quantifying the concordance of genes in the signature with their expression in each sample. As such, high expression of up-regulated genes and low expression of down-regulated genes would result in higher scores. This single value can then be used to predict the mutation status of individual samples if these data were unavailable.The signature by VerhaakGeneSet objects from theGSEABase R package. We then use thesingscore R/Bioconductor package to quantify each sample for the Verhaak signature. Some of the visualisation and diagnostic tools within thesingscore package are used to interpret the signatures and scores. Finally, we use a simple logistic regression model on the scores to predict the mutation status.The signatures of interest are first downloaded from the MSigDB and read intoet al.12 signature is composed of an up-regulated and a down-regulated gene set. Many signatures are developed in such a manner to improve discrimination of samples. MSigDB stores such signatures using names with suffixes "_UP" and "_DN" representing the independent components of the signature. Here, we form the download links for the signature with the base name “VERHAAK_AML_WITH_NPM1_MUTATED”.The Verhaak#create signature names                                                          verhaak_names = paste, sep = ’_’) verhaak_names                                                                    ## [1] "VERHAAK_AML_WITH_NPM1_MUTATED_UP" "VERHAAK_AML_WITH_NPM1_MUTATED_DN"mapply function is used to run the download function on all pairs of link-output arguments.The signatures are then downloaded using the links, resulting in an XML file for each component of the signature. The#generate URLs                                                                         verhaak_links = paste0                                                                                #download files                                                                      verhaak_files = paste0                                        mapply              GSEABase package help with reading, parsing and processing the signatures. Signatures from an MSigDB XML file can be read using thegetBroadSets function which results in aGeneSet object. Gene symbols, Entrez IDs and affymetrix chip IDs from the original experiment (HG-U133A in this case) are stored in the XML file. Entrez IDs are read from the file as these can be mapped directly to our data. Conversions to other identifiers can be achieved using themapIdentifiers function fromGSEABase and an annotation package that contains the mappings. The advantage of using this function instead of themapIds function from theAnnotationDbi package is that the former retains theGeneSet object after conversion of IDs.Functions in thelibraryverhaak_sigs = (GSEABase)                                                                                getBroadSetsverhaak_sigs                                                          ## GeneSetCollection##   names: VERHAAK_AML_WITH_NPM1_MUTATED_UP, VERHAAK_AML_WITH_NPM1_MUTATED_DN ##   unique identifiers: 10051, 10135, ..., 9828 ##   types in collection:##     geneIdType: SymbolIdentifier ##     collectionType: BroadCollection SummarisedExperiment object are changed to Entrez IDs which are already part of the row annotations.To make data indexing easier during signature scoring, row names of therownames(aml_se) = rowData(aml_se)$entrezgenerankGenes function will compute ranks from expression data in the form of either a numeric matrix, numeric data frame, ExpressionSet object, DGEList object or a SummarizedExperiment object. Users also have to specify what method should be used to break ties. The default is ‘min’ and we recommend this be used for RNA-seq data which may have many genes with zero counts. This will reduce the effect of zeros in the scores, however, appropriate pre-filtering of genes with low counts will still be required.Singscore is a rank based metric of gene set enrichment in single samples. Scores for multiple signatures make use of the same ranked expression per sample. As such, it makes sense to compute the ranks only once and re-use them for scoring different signatures. The implementation separates these two phases of the analysis to reduce the computational cost of scoring. Thelibrary(singscore)                                                          #apply the rankGenes method to each version of the dataset, excluding countsaml_ranked = rankGenes)                        et al.12 signature come in such pairs. This mode can be invoked by passing the up- and down-regulated gene sets to the argumentsupSet anddownSet respectively. In some cases, only one set of genes forms the signature. If all genes in the gene set are up-regulated or all down-regulated, the second mode of operation applies and is invoked by passing the gene set to theupSet argument. For sets of down-regulated genes, the score would simply be inverted . Finally, if the user is unsure of the composition of genes in the gene-set, such that, the gene set may contain both up- and down- regulated genes, the final mode of singscore applies. The gene set is passed to theupSet argument similar to the previous mode with the additional argumentknownDirection set toFALSE.Singscores can be computed using three modes, depending on the properties of the gene signature. The first mode of operation is applied when two directed gene sets (expected up- and down-regulated gene sets) form the transcriptomic signature. Many signatures in the MSigDB, including the VerhaakBy default, singscores are centered such that the range of scores is  and  for the first two modes respectively. Negative scores indicate an inverse enrichment of signatures, that is, expected up-regulated genes are in fact down-regulated and vice-versa. Scores from the last mode can not be centered and have the range . In this mode, high scores are obtained when ranks of genes are distant from the median and low scores obtained when ranks converge to the median rank. If scores are centered in this scenario, it would lead to the conclusion that a negative score shows inverted enrichment, which is not the case. Score centering only serves the purpose of easing interpretation for users, a simple linear transformation is applied to achieve it.Scores for the NPM1c mutation signature are computed using the default settings, with the first mode of operation being used due to the presence of an up- and down- regulated gene set. The function returns a data frame reporting the score and dispersion of ranks for the up-regulated gene set, down-regulated gene set and the combination of both. Dispersion of the combined gene set in this mode is simply the mean of the independent dispersion estimates. If any gene names/IDs are present in the signature but missing in the expression data, a warning will be reported.#apply the scoring function                              verhaak_scores = simpleScore## Warning in checkGenes): 24 genes missing: 10265,## 108, 10924, 11025, 11026, 1672, 200315, 2212, 2215, 3215, 3216, 3569, 3627,## 3759, 50486, 6346, 6364, 6967, 8337, 861, 8843, 9518, 9627, 9997## Warning in checkGenes): 29 genes missing:## 10232, 10267, 11217, 2122, 221981, 2258, 23532, 24141, 25907, 2697, 28526,## 28638, 3047, 3386, 3848, 3934, 4070, 445, 4680, 4681, 5457, 5790, 6091,## 653067, 653145, 7441, 8277, 862, 8788IQR function as an argument to thedispersionFun argument.It should be noted that singscores are composed of two components, an enrichment score and a dispersion estimate of ranks. The quantity of interest in gene set enrichment is the distribution of the expression or ranks of genes in the signature. In an ideal scenario, all expected up-regulated genes would have high expression therefore higher values of ranks. As such, ranks would be distributed on the higher end of the entire rank spectrum. Singscore aims to quantify this distribution of ranks, therefore, computes and reports the average and dispersion of ranks of genes in the signature relative to all other genes. The first quantity is similar to scores computed from all other single sample scoring methods. We determined a two component score to be a more appropriate and accurate representation of the distribution of ranks of signature genes. The default and recommended measure of dispersion is the median absolute deviation (MAD) due to its non-parametric property. Other appropriate measure of dispersion could be the inter-quartile range (IQR) and can be used by passing thehead(verhaak_scores)##                               TotalScore   TotalDispersion        UpScore## TCGA-AB-3001-03A-01T-0736-13 -0.09161242          5256.929  -0.0768291807## TCGA-AB-2853-03A-01T-0734-13  0.19605308          4882.943   0.0353047490## TCGA-AB-2929-03A-01T-0735-13 -0.07106828          5443.737   0.0006426157## TCGA-AB-2939-03A-01T-0740-13 -0.09795161          5697.632  -0.0599342558## TCGA-AB-2982-03B-01T-0748-13 -0.11011396          5464.122  -0.0986913016## TCGA-AB-2813-03A-01T-0736-13  0.15487900          4694.653   0.1385452964##                              UpDispersion     DownScore  DownDispersion## TCGA-AB-3001-03A-01T-0736-13      4513.034  -0.01478324        6000.823## TCGA-AB-2853-03A-01T-0734-13      5868.872   0.16074833        3897.014## TCGA-AB-2929-03A-01T-0735-13      5152.035  -0.07171089        5735.438## TCGA-AB-2939-03A-01T-0740-13      4977.829  -0.03801735        6417.434## TCGA-AB-2982-03B-01T-0748-13      5024.531  -0.01142266        5903.713## TCGA-AB-2813-03A-01T-0736-13      4332.157   0.01633370        5057.149singscore package provides a set of visualisation tools that enable diagnostics of the gene signature. For instance, these tools may be used to determine the importance of each component for a bidirectional signature (up- and down-regulated gene sets) to the total score, determine the importance of each gene of a signature in discriminating between the classes of interest, and to investigate the relationship between the final score and the dispersion of signature gene ranks. Sample annotations of interest  can be colour coded on each plot. Singscore supports both continuous and categorical annotations, which can either be input as a vector, or as a string specifying a column within the score data frame. We begin by investigating the relationship between the score and dispersion of ranks for the up-regulated gene signature, down-regulated gene signature and the full signature. TheplotDispersion functions generates a diagnostic plot with annotations overlaid. Annotations can be discrete or continuous, and can be passed as independent variables, or as a column name when the data is appended to the score data frame. It should be noted that all plotting functions insingscore can be made interactive by setting theisInteractive argument toTRUE.The#relative size of text in the figure                                         relSize = 0.7                                                                #create annotation                                                           mutated_gene = rep)                                    mutated_gene[aml_se$NPM1c.Mut] = ’NPM1c Mut’                                 mutated_gene[aml_se$KMT2A.Fusion | aml_se$KMT2A.PTD] = ’MLL Fusion/PTD’      p1 = plotDispersionp1MLL (KMT2A) fusions and PTDs from the other samples. NPM1c mutations produce higher scores for the down-regulated gene set whileMLL fusions and PTDs produce moderate scores. Similar trends are observed with the set of upregulated genes; however, despite the range of scores increasing, the discriminant power drops moderately. In fact, the signature of up-regulated genes is able to discriminate samples without the genomic changes of interest (‘Other’) better by producing negative scores for most of these samples. Negative scores for the expected up-regulated gene set indicate that these genes are expressed below median expression, therefore, likely down-regulated within corresponding samples. Another observation from these plots is based on the trend of the dispersion (MAD). The dispersion is generally expected to be higher for scores close to zero. Zero scores are achieved in three possible scenarios: when genes are expressed at median expression level; when genes are evenly distributed at both ends of the expression spectrum; or, the more likely scenario whereby the rank of expression of all genes are uniformly distributed. The last two scenarios would result in a high dispersion. To explain these ideas, we select 3 samples and plot the ranks of genes in both signatures. The sample with the highest total score, lowest total score and highest dispersion are chosen.library(gridExtra)                                                       #select samples with the properties required                             select_samples = c,                ’Min Total Score’ = which.min,                ’Max Dispersion’ = which.max             )                                                                      #plotRankDensity applied to each sample                                  rank_plots = lapply(names(select_samples), function(x) {                   #get the sample index                                                    aml_sample = select_samples[x]                                           #drop = FALSE is required to ensure the data.frame is intact             p1 = plotRankDensity                                #overwrite title of the plot with the description of the sample          #this is possible because singscore uses ggplot2                         p1 = p1 + ggtitle) +        guides(colour = guide_legend(ncol = 1))                                 return(p1)                                                             })                                                                       #create a multipanel plot                                                grid.arrange                               MLL fusion/PTD samples), and wild-type samples. These diagnostic plots help in determining the importance of genes in signatures with respect to the samples of interest and should be used prior to application of signatures. In some cases, signatures may have been developed in specific contexts due to inherent biases in datasets and yet, described or applied in a generalised setting. These diagnostic plots may help in validating their application in specific contexts and possibly assist in characterising the contexts of all existing signatures.Combined, these plots show that both the up- and down-regulated genes play an important role in discriminating between NPM1c mutated .Mutation status can be predicted from singscores using a logistic regression model with a “logit” link function. The benefits of this model over one where each gene in the signature is used as a term in the model is the simplicity of the model. The VerhaakIn any case, our aim here is not to discuss the various models that can be used to predict mutation status, but to exhibit the discriminant power of singscore and transcriptomic signatures. consequently, the data used to train the model are used to evaluate the basic performance properties. We begin by combining the scores with mutation annotations.#create a dataframe with the data required: scores and mutations scoredf = as.data.frame(colData(aml_se))        scoredf$Score = verhaak_scores$TotalScore                        scoredf$Dispersion = verhaak_scores$TotalDispersion              et al.12 signature separates the mutants from wild-type samples for some genes of interest.MLL (KMT2A) fusions andPML-RARA fusions.Before training a model, we can visualise how well scores resulting from the Verhaak#restructure the data for ploting                             plotdf = melt,                            variable.name = ’Mutation’,                                   value.name = ’Status’                                         )                                                           #convert TRUE-FALSE values to Mut-WT                          plotdf$Status = factor)p1 = ggplot) +      geom_boxplot +               scale_fill_brewer +                         current_theme +                                               theme)  p1                                                            p-values of each model are listed below.To quantify the above observations, we fit logistic regression models with each genomic lesion as the response variable and the score as the predictor. Coefficient estimates, standard errors, z-statistics, and#fit GLMs to each mutation                                           glms = lapply {                             #generate a formula for the fit                                      form = as.formula)                             glm1 = glm)  return(glm1)                                                       })                                                                   names(glms) = aml_mutations                                          #extract coefficients                                                coefs = lapply coef(summary(x)))                   ldply x, .id = ’Mutation’)                   ##       Mutation  Estimate Std. Error    z value     Pr(>|z|)## 1    NPM1c.Mut 13.276945   2.209811  6.0081806 1.876167e-09## 2 KMT2A.Fusion  4.442768   2.151409  2.0650505 3.891822e-02## 3    KMT2A.PTD  1.646183   2.089950  0.7876661 4.308921e-01## 4     PML.RARA -6.780992   2.414752 -2.8081526 4.982661e-03MLL gene fusion are also associated with the score reflecting their shared effects on Hox gene dysregulation, although with a lower significance. Interestingly thePML-RARA fusion carries a negative coefficient, likely reflecting the distinct cellular morphology/phenotype of acute promyelocytic leukemia relative to other subsets of AML, as noted above.NPM1c mutations are significantly associated with the score. Samples carrying adcanr package provides functions to compute these metrics along with other measures of performance.The above statistics give insight on the models trained but not on their performance. Precision and recall provide insight on a models predictive performance. Thelibrary(dcanr)                                                                 #assess sensitivity and specificity                                            prec_rec = ldply {                                          #predict mutations for the data used in training and convert to binary format  prediction = as.numeric(predict(glm1) > 0)                                     observed = glm1$y                                                              prec = performanceMeasure                   recall = performanceMeasure                    f1 = performanceMeasure                                  return)                  }, .id = ’Mutation’)                                                           prec_rec                                                                       ##       Mutation Precision    Recall        F1## 1    NPM1c.Mut       0.7 0.5675676 0.6268657## 2 KMT2A.Fusion       NaN 0.0000000 0.0000000## 3    KMT2A.PTD       NaN 0.0000000 0.0000000## 4     PML.RARA       NaN 0.0000000 0.0000000Precision for predictions of all genomic changes other than NPM1c is undefined because all samples are predicted to be wild-types. Consequently, their recall is zero. Precision, recall and the F1 score of the NPM1c mutation model are high as expected. As singscores are two-components scores, performance may be further improved by including the dispersion of ranks. This is observed inAs observed from the model below, using both components of singscores significantly improves the predictive performance.#include dispersion in the model                                      glm_npm1c = glm)                     #evaluate performance of the new model                                prediction = as.numeric(predict(glm_npm1c) > 0)                       observed = glm_npm1c$y                                                c,  ’Recall’ = performanceMeasure,        ’F1’ = performanceMeasure                       )                                                                   ## Precision    Recall        F1## 0.7631579 0.7837838 0.7733333There may be some cases where sample annotation is not available. In such scenarios, we are unable to build regression models to interpret scores. A higher singscore would provide stronger evidence for the signature but the magnitude is difficult to interpret without a reference. One approach to deal with this situation is to compare scores to those from other datasets where the mutations status is known. An alternative approach would be to compare scores within the dataset using unsupervised learning methods.24 use the adjusted Rand index (ARI) to compare classifications. As expected, supervised (GLM) classification results in the best prediction. This is followed by clustering based on the score using Gaussian mixture decomposition. Any other classification algorithm along with prior knowledge could be used to decompose scores into groups. The important characteristic of singscores is that they maintain the discriminant power of gene signatures therefore can be coupled with supervised, semi-supervised or unsupervised algorithms to perform stratification.Here we demonstrate the use of three clustering methods  to stratify samples, and as we have done previouslylibrary(mclust)                                                   #Gaussian mixture model                                           m1 = Mclust                #k-means clustering                                               m2 = kmeans            #hierarchical clustering                                          m3 = hclust)                                 mutation_inference = cbind                                    )                                                                 apply##       GLM    mclust   k-means    hclust## 0.5712724 0.4451106 0.3298026 0.3725541et al.25 first introduced the idea of molecular signature landscapes to investigate the relationship between signatures related to the epithelial-mesenchymal transition (EMT) and TGFβ-induced EMT. Subsequently, Cursonset al.26 computed epithelial and mesenchymal phenotype signature singscores and demonstrated an epithelial phenotype shift following miR-200c transfection into a mesenchymal cell line using a signature landscape. Foroutanet al.9 used signature landscapes to stratify breast cancer subtypes along the epithelial-mesenchymal axis and included it as part of thesingscore package. Here, we show how such landscapes can be used beyond the current application of the epithelial-mesenchymal axis. We demonstrate how transcriptomic signatures of different mutations can be used to stratify AML samples.Often, we are interested in the relationship between two dependent or independent phenotypes, for instance, the epithelial and mesenchymal phenotypes. The role of most signatures is to estimate an unobservable molecular phenotype so they may be considered as proxies of phenotypes. As such, we could investigate the relationship between two phenotypes using corresponding signatures. Foroutanet al.14 MLL-fusion signatures to score the TCGA AML samples. Unlike the NPM1c signature, this signature is composed of genes that discriminate samples with MLL-fusion genes. We download and parse the signature as demonstrated with the NPM1c signature.We now use the Ross#create signature names                                                              rossmll_name = ’ROSS_AML_WITH_MLL_FUSIONS’                                           #generate URLs                                                                       rossmll_link = paste0                                                                                #download files                                                                      rossmll_file = paste0                                          download.file                        rossmll_sig = getBroadSets                 rossmll_sig                                                                          ## GeneSetCollection##   names: ROSS_AML_WITH_MLL_FUSIONS ##   unique identifiers: 10113, 10479, ..., 9961 ##   types in collection:##     geneIdType: SymbolIdentifier ##     collectionType: BroadCollection knownDirection parameter of thesimpleScore function is set toFALSE to induce this mode. Ranks computed previously can be reused to compute scores with the new signature.The gene set is a composition of both up- and down-regulated genes as genes were selected based on their ability to discriminate mutants from wild-types. We use the third mode of singscore, which does not require the direction of genes in the gene set to be known. Therossmll_scores = simpleScoreplotScoreLandscape function plots a hexbin plot to visualise the two-dimensional distribution of scores. Scores computed using the Verhaaket al.12 signature and the Rosset al.14MLL-fusions signature are passed as arguments. Both scores should have been computed on the same samples with the order of samples retained. Names of the scores should be passed as arguments to thescorenames argument. ThetextSize argument can be used to specify the size of all text relative to the plot size. This may prove useful when plots are being generated for scientific posters, publications and presentations, all of which require different image sizes.Thep_mll_npm1c = plotScoreLandscape,  textSize = relSize                                                             )                                                                            p_mll_npm1c                                                                    ρ = 0.628) despite only 16 genes being shared across the two signatures (signature sizes are 78 and 429 genes). In such an analysis, we may be interested in projecting new data points onto the landscape as done by Cursonset al.26. Alternatively, we may want to overlay some existing data points to investigate sample stratification using scores. Here, we overlayMLL fusions,MLL PTDs,PML-RARA fusions and NPM1c mutations onto the landscape. First, we build the annotation vector.#new annotation - modify previously used annotationsmutated_gene[aml_se$KMT2A.Fusion] = ’MLL Fusion’    mutated_gene[aml_se$KMT2A.PTD] = ’MLL PTD’          mutated_gene[aml_se$PML.RARA] = ’PML-RARA’          projectScoreLandscape function. This functions uses thep_mll_npm1c plot generated using theplotScoreLandscape and overlays new data points onto it. Scores for the new data must be computed with the same signatures that were used to compute the landscape. As we are using existing data, scores computed in earlier sections are re-used. ThesubSamples can be used to select a subset of samples to project. Here, we select samples with the mutations we are interested in annotating.Points are projected onto an existing landscape using theselect_aml = !mutated_gene %in% ’Other’                                         #label samples with an mclust NPM1c classification uncertainty of > 0.3         label_samples = substr(rownames(verhaak_scores), 6, 12) #sample ID from barcodeslabel_samples[m1$uncertainty < 0.3] = NA                                        #project mutations onto the landscape                                     p1 = projectScoreLandscape                                                                               p1 + theme                                             MLL fusions andMLL PTDs exhibit variation across different axes.MLL PTDs have a lower score than MLL fusions for theMLL fusion signature as expected. These sets of samples do not cluster along the two axes, consistent with observations by Rosset al.14. Overlaying samples annotations onto the plot assists in interpreting different regions of the landscape.PML-RARA samples differ from all other samples examined here. We repeat the analysis with thePML-RARA signature from Rosset al.14 to verify this distinction. The signature is available on the MSigDB and is named “ROSS_AML_WITH_PML_RARA_FUSION”. We download and parse the signature, score all samples against it, plot a landscape with scores from the Verhaaket al.12 signature, and finally, project samples onto the plot. The signature was constructed in a similar manner to theMLL fusions signature, therefore, samples are scored using the same settings.It is evident from the previous analysis thatMLL fusion signature. ThePML-RARA signature forms a clear separation between thePML-RARA and NPM1c samples such thatPML-RARA samples are the only ones with a high score for this signature. Moreover, no association is observed between the two signatures. As discussed above  thePML-RARA fusion is diagnostic of a specific subtype of AML known as acute promyelocytic leukemia, with a highly distinct cell phenotype reflecting a block on differentiation at the promyelocyte stage15. The distinct features of this subtype are correspondingly reflected in the L-shaped landscape for these two signatures and the different mechanisms by which these lesions drive leukemogenesis.The singscore package provides an easy interface to apply gene set scoring methods within the R/Bioconductor environment. The TCGAbiolinks package allows relatively easy access to large clinically relevant data sets such as TCGA, together with appropriate annotation functions for interpreting biological data. Diagnostic and plotting functions included with singscore allow the user to investigate gene sets of interest to determine their power for distinguishing differences between samples. Different gene signatures can then be combined to explore how different cellular phenotypes are associated across a large cohort of cancer samples. As demonstrated, when appropriate gene set signatures are used, metrics calculated by singscore can be used for sample classification and this may be useful for further interrogation of large transcriptomic data sets where no genomic data are availableThis workflow depends on various packages from version 3.9 of the Bioconductor project, running on R version 3.6.1 (2019-07-05) or higher. The complete list of the packages used for this workflow are shown below:sessionInfo                                                              ## R version 3.6.1 (2019-07-05)## Platform: x86_64-pc-linux-gnu (64-bit)## Running under: CentOS Linux 7 (Core)#### Matrix products: default## BLAS:   /stornext/System/data/apps/R/R-3.6.1/lib64/R/lib/libRblas.so## LAPACK: /stornext/System/data/apps/R/R-3.6.1/lib64/R/lib/libRlapack.so#### locale:##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C##  [9] LC_ADDRESS=C               LC_TELEPHONE=C## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C#### attached base packages:## [1] parallel  stats4    stats     graphics  grDevices utils     datasets## [8] methods   base#### other attached packages:##  [1] mclust_5.4.5               dcanr_1.1.4##  [3] gridExtra_2.3              reshape2_1.4.3##  [5] singscore_1.4.0            GSEABase_1.46.0##  [7] graph_1.62.0               annotate_1.62.0##  [9] XML_3.98-1.20              org.Hs.eg.db_3.8.2## [11] AnnotationDbi_1.46.0       plyr_1.8.4## [13] rtracklayer_1.44.0         edgeR_3.26.5## [15] limma_3.40.2               SummarizedExperiment_1.14.1## [17] DelayedArray_0.10.0        BiocParallel_1.18.1## [19] matrixStats_0.55.0         Biobase_2.44.0## [21] GenomicRanges_1.36.1       GenomeInfoDb_1.20.0## [23] IRanges_2.18.2             S4Vectors_0.22.1## [25] BiocGenerics_0.30.0        TCGAbiolinks_2.12.3## [27] ggplot2_3.2.0              SingscoreAMLMutations_1.0.1            #### loaded via a namespace (and not attached):##   [1] backports_1.1.4            circlize_0.4.6##   [3] aroma.light_3.14.0         igraph_1.2.4.1##   [5] selectr_0.4-1              ConsensusClusterPlus_1.48.0##   [7] lazyeval_0.2.2             splines_3.6.1##   [9] usethis_1.5.1              sva_3.32.1##  [11] digest_0.6.20              foreach_1.4.4##  [13] htmltools_0.3.6            magrittr_1.5##  [15] memoise_1.1.0              BSgenome_1.52.0##  [17] cluster_2.1.0              doParallel_1.0.14##  [19] ComplexHeatmap_2.0.0       Biostrings_2.52.0##  [21] readr_1.3.1                R.utils_2.9.0##  [23] prettyunits_1.0.2          colorspace_1.4-1##  [25] blob_1.1.1                 rvest_0.3.4##  [27] ggrepel_0.8.1              BiocWorkflowTools_1.10.0##  [29] xfun_0.8                   dplyr_0.8.3##  [31] hexbin_1.27.3              crayon_1.3.4##  [33] RCurl_1.95-4.12            jsonlite_1.6     ##  [35] genefilter_1.66.0          survival_2.44-1.1##  [37] zoo_1.8-6                  iterators_1.0.10##  [39] glue_1.3.1                 survminer_0.4.4##  [41] registry_0.5-1             gtable_0.3.0##  [43] zlibbioc_1.30.0            XVector_0.24.0##  [45] GetoptLong_0.1.7           shape_1.4.4##  [47] scales_1.0.0               DESeq_1.36.0##  [49] rngtools_1.4               DBI_1.0.0##  [51] bibtex_0.4.2               ggthemes_4.2.0##  [53] Rcpp_1.0.2                 xtable_1.8-4##  [55] progress_1.2.2             cmprsk_2.2-8##  [57] clue_0.3-57                bit_1.1-14##  [59] matlab_1.0.2               km.ci_0.5-2##  [61] httr_1.4.0                 RColorBrewer_1.1-2##  [63] pkgconfig_2.0.2            R.methodsS3_1.7.1##  [65] locfit_1.5-9.1             labeling_0.3##  [67] tidyselect_0.2.5           rlang_0.4.0##  [69] munsell_0.5.0              tools_3.6.1##  [71] downloader_0.4             generics_0.0.2##  [73] RSQLite_2.1.1              broom_0.5.2##  [75] evaluate_0.14              stringr_1.4.0##  [77] yaml_2.2.0                 knitr_1.23##  [79] bit64_0.9-7                fs_1.3.1##  [81] survMisc_0.5.5             purrr_0.3.2##  [83] doRNG_1.7.1                EDASeq_2.18.0##  [85] nlme_3.1-140               R.oo_1.22.0##  [87] xml2_1.2.0                 biomaRt_2.40.1##  [89] compiler_3.6.1             rstudioapi_0.10##  [91] curl_3.3                   png_0.1-7##  [93] ggsignif_0.5.0             tibble_2.1.3##  [95] geneplotter_1.62.0         stringi_1.4.3##  [97] GenomicFeatures_1.36.3     lattice_0.20-38##  [99] Matrix_1.2-17              KMsurv_0.1-5## [101] pillar_1.4.2               BiocManager_1.30.4 ## [103] GlobalOptions_0.1.0        data.table_1.12.2## [105] bitops_1.0-6               R6_2.4.0## [107] latticeExtra_0.6-28        hwriter_1.3.2## [109] bookdown_0.11              ShortRead_1.42.0## [111] codetools_0.2-16           assertthat_0.2.1## [113] pkgmaker_0.27              rjson_0.2.20## [115] withr_2.1.2                GenomicAlignments_1.20.1## [117] Rsamtools_2.0.0            GenomeInfoDbData_1.2.1## [119] mgcv_1.8-28                hms_0.4.2## [121] grid_3.6.1                 tidyr_0.8.3## [123] rmarkdown_1.13             git2r_0.26.1## [125] ggpubr_0.2.1SingscoreAMLMutations (v1.0.0).All data analyzed in the workflow is read automatically from public websites as part of the code. Mutation data for the samples in this study are available as part of the R/Bioconductor packageSoftware available from:https://bioconductor.org/packages/release/workflows/html/SingscoreAMLMutations.htmlSource code available from:https://github.com/DavisLaboratory/SingscoreAMLMutations/Archived source code at time of publication:https://doi.org/10.5281/zenodo.3470443License: Artistic-2.0SingscoreAMLMutations. MF, JC, DDB and MJD conceived the idea for the workflow. YX translated the vignette for the package vignette into chinese. YX and RL reviewed the chinese translation. All authors have tested and reviewed the workflow. This work was supervised by JC and MJD.DDB, JC and MJD wrote the article. DDB wrote the code for the workflow and the associated R/Bioconductor workflow package All my comments were addressed by the authors. Some of the suggested improvements were introduced, other not but the authors explained they did not overlap with the objectives of the article."Normlisation” instead of "Normalisation” occurs once in the chapter “Transformation to FPKM values and normalisation”;"those those” – repeated word in the sentence started from “Figure 2 shows that the set of down-regulated genes has more discriminant power…”NPM1 gene. The term “wild-type NPM1 samples” is more appropriate.there is no dot at the end of the last sentence of the Summary chapter. Moreover, I suggest not to use a term “wild-type NPM1c samples” formed as an equivalent of “NPM1c mutated samples”, e.g. in the description of the Figure 3 and 4, as “NPM1c” means “cytoplasmic NPM1” which is typical for samples with the mutated I only suggest to correct a few editorial errors:I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard. I don't have many more comments. Figures could be improved, as noted in the first version of this peer review.I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard. Introduction The article presents a new package, which was developed from a previous one (‘singscore’) elaborated by the same authors. The package ‘singscore’ is a single-sample gene set scoring method which is valuable for analysis of transcriptomes of samples collected through the long time and not sequenced in the same run, experiment, platform or laboratory. Here, the authors apply the method for classification of TCGA acute myeloid (AML) samples using transcriptional ‘gene signatures’ identified by other authors (Verhaak and Ross) as typical for the NPM1c mutation, KMT2A (MLL) gene fusions, and PML-RARA gene fusions.1). Sometimes, the gene expression profiles can overlap between samples with different genetic lesions. The examples are HOX-gene-based discriminative signatures determined by Verhaak and Ross, not limited to AML with mutated NPM1, but specific also for AML cases with 11q23 abnormalities and KMT2A (MLL) gene rearrangements. The authors are aware of this fact and underline it in the article, too. On the other side, samples with the same mutation can present varying expression profiles because of additional features which also affect the transcriptome. Therefore, interpretation of the results must be done with caution. For me, the authors interpret the results a little bit too optimistically. The presented method is not sufficient to determine the mutation of interest, but can be used as a supplementary approach, a screening tool or (in future) a personalized medicine tool which could classify patients based on transcriptomic profiles, associated with specific treatment response. AML is a heterogeneous and multi-clonal disease. The transcriptome picture of AML is very complex and can result from different mutations, genomic rearrangements, and aberrant regulation of gene expression at different levels (see my last review paperTesting package2). My dataset contains 28 AML samples, including 8 with NPM1 mutation (verified with three independent approaches). The data load was more tricky as I started from the csv table with counts and I had to convert the DESeqDataSet object into the RangedSummarizedExperiment object. The best discrimination was achieved with the Verhaak signature, but only with the down-regulated genes. All samples with NPM1 mutation were clearly separated from others, however, 2 additional samples, without NPM1 mutation, were grouped together with NPM1c. It is possible they have KMT2A (MLL) rearrangements, but I cannot verify it now. Analyzing the plots, up-regulated genes and all genes form the signature are not as efficient, separating only 2 or 3 NPM1c samples from the rest. In the article, the authors also admit that the set of down-regulated genes has more discriminant power, but they claim up-regulated genes also contribute to the discrimination. I have used the package in R with TCGA data and confirm the code works, it is fast and generates the same results and plots as presented in the article. Moreover, I have tested the whole procedure on my own RNA-seq dataset  gene was unknown in my patients, so I could not compare the efficiency of signatures other than NPM1c. APL with PML-RARA is the most distinctive AML subtype which is easily separated from other AML samples based on transcriptome profile, so I would expect good results. This example shows the package works well for samples with very specific gene expression profile.Interpretation of the results Considering the result interpretation, I have some doubts. The singscores are composed of two components, an enrichment score and a dispersion estimate of ranks. I am informed that “high expression of up-regulated genes and low expression of down-regulated genes would result in higher scores”. This is logical. I also know the maximal ranges . However, which value is really high? For example, is 0.2 enough  or maybe I should expect much more, e.g. 0.7? Similarly, which value of dispersion should I expect? I suppose, the lowest, but which is low enough or which range is optimal? What is difficult to understand is that “despite the range of scores increasing, the discriminant power drops moderately” . I see the same paradox in my data – the scores are higher for up-reg. genes, which are much less efficient in discrimination between NPM1c+ and NPM1c- samples. It looks like scores only do not reflect the trends observed from score vs dispersion plots.Possible improvementsInstruction how to prepare and load the data other than those deposited in the GDC database.Annotation of samples on the plots with unique sample IDs  – it is written in the article that the ‘singscore’ package supports different types of annotations (“Annotations of interest can be overlayed on each plot”) but I found only color code annotation whereas I would like to have color code for mutation type and additional text labels with sample IDs on the same plot.A command which lists the samples typed as strong candidates for having particular mutation, ordered according to the calculated metrics.Generating a threshold line between samples with and without mutation. In future, it would be also good to include other signatures, e.g. the signature of 369 genes identified by Alcalayet al. in 20053, discriminating AML patients with NPMc+ from patients with NPMc-, even in cases with rare chromosomal abnormalities. Although the package is generally useful and well described, the following improvements will make it more friendly for less advanced R users, e.g.4). For genes with high and middle expression level, the coverage can be even higher than that obtained from genome- or exome-level data. And in the case when DNA data are unavailable, it would be really fantastic. Because it demands completely different data processing, it may be considered for future versions of the package. What I would expect the most from a package designed to identify mutations in transcriptomes, is a direct identification of mutations in RNAseq data. The results of mutation typing based on gene expression profile will be strongly supported when a particular mutation will be covered by RNAseq reads. From my own experience, I know it is possible  elaborated by the same authors. The package ‘singscore’ is a single-sample gene set scoring method which is valuable for analysis of transcriptomes of samples collected through the long time and not sequenced in the same run, experiment, platform or laboratory. Here, the authors apply the method for classification of TCGA acute myeloid (AML) samples using transcriptional ‘gene signatures’ identified by other authors (Verhaak and Ross) as typical for the NPM1c mutation, KMT2A (MLL) gene fusions, and PML-RARA gene fusions.DDB: We note that the purpose of the initial manuscript may have been unclear, in part because it is listed under the F1000 Software Tool Article section. The purpose of this article is to present a workflow demonstrating the use of singscore, and it is a R/Bioconductor workflow illustrating the use of singscore, and so is not intended as a new package or tool.https://www.bioconductor.org/packages/release/workflows/https://www.bioconductor.org/packages/release/workflows/html/SingscoreAMLMutations.htmlSome of the review comments below assume that this manuscript presents a specific software package for detecting NPM1 mutations, so we have clarified the manuscript as outlined below in order to make the purpose and intention more clear (note that the title of the manuscript has changed from ‘predicting mutations’ to ‘predicting mutation status’ based upon feedback from reviewer 1). This work arose from an observation in another project that the Verhaak signature scored with singscore appeared to correlate strongly with mutation status, and we thought this would be an interesting example that might also help researchers to investigate the links between genetic lesions and corresponding transcriptional changes, an area in which the reviewer clearly has expertise.LH: AML is a heterogeneous and multi-clonal disease. The transcriptome picture of AML is very complex and can result from different mutations, genomic rearrangements, and aberrant regulation of gene expression at different levels (see my last review paper1). Sometimes, the gene expression profiles can overlap between samples with different genetic lesions. The examples are HOX-gene-based discriminative signatures determined by Verhaak and Ross, not limited to AML with mutated NPM1, but specific also for AML cases with 11q23 abnormalities and KMT2A (MLL) gene rearrangements. The authors are aware of this fact and underline it in the article, too. On the other side, samples with the same mutation can present varying expression profiles because of additional features which also affect the transcriptome.LH: Therefore, interpretation of the results must be done with caution. For me, the authors interpret the results a little bit too optimistically. The presented method is not sufficient to determine the mutation of interest, but can be used as a supplementary approach, a screening tool or (in future) a personalized medicine tool which could classify patients based on transcriptomic profiles, associated with specific treatment response.DDB: We agree with the reviewer that gene set scoring of transcriptomic data should not be the only method used to identify patient samples carrying genetic lesions. The Bioconductor workflow we present is intended to provide an example of applying singscore to study mutation/fusion based gene sets as we believe that singscore provides a relatively flexible and intuitive approach for investigating different gene sets across large data sets. We feel that a particularly useful feature is the ability to combine different signatures/gene sets (including phenotype/cell-cycle signatures etc) to explore how these transcriptional changes are associated over different samples, demonstrated in Figures 5-7.underlined):We have modified the “Description of biological relevance” section to address the reviewer’s comments around the complexity of AML genomic lesions and corresponding transcriptomic changes. The review highlighted is particularly relevant for this work and accordingly we mention the complexity of AML and direct the reader towards this resource by extending the first paragraph , NEJM], highlighting a number of co-occurring as well as mutually exclusive mutations.As the identification of putative driver fusions/mutations continues, work has also been directed towards how these lesions interact with each other and other features  to drive transcriptional changes as discussed in a recent review .We have also added a paragraph at the end of this section which discusses some of the limitations for our approach and provides more context in which it could be applied:While we demonstrate that singscore is capable of inferring mutation status from the transcriptional profile of AML samples, we note that it is best used to supplement alternative data which can provide a more definitive resolution of these lesions. Processing of raw RNA‑seq data will directly identify the presence of gene‑fusion products or mutations within protein-coding regions, although for many large data sets the quantified transcript abundance data are much easier to obtain without access agreements. The method can also be applied to legacy microarray data sets where genome and RNA sequencing data are unavailable. As such singscore provides a useful approach to supplement established methods for the study of genetic lesions in cancer. By exploring associations between different genomic and phenotypically relevant signatures, it may also help to better characterise true driver mutations which exert consistent effects on the transcriptome of AML samples and other cancers.Testing packageLH: I have used the package in R with TCGA data and confirm the code works, it is fast and generates the same results and plots as presented in the article. Moreover, I have tested the whole procedure on my own RNA-seq dataset . My dataset contains 28 AML samples, including 8 with NPM1 mutation (verified with three independent approaches). The data load was more tricky as I started from the csv table with counts and I had to convert the DESeqDataSet object into the RangedSummarizedExperiment object. The best discrimination was achieved with the Verhaak signature, but only with the down-regulated genes. All samples with NPM1 mutation were clearly separated from others, however, 2 additional samples, without NPM1 mutation, were grouped together with NPM1c. It is possible they have KMT2A (MLL) rearrangements, but I cannot verify it now. Analyzing the plots, up-regulated genes and all genes form the signature are not as efficient, separating only 2 or 3 NPM1c samples from the rest. In the article, the authors also admit that the set of down-regulated genes has more discriminant power, but they claim up-regulated genes also contribute to the discrimination.LH: I have no samples with PML-RARA fusion in my dataset and the status of KMT2A (MLL) gene was unknown in my patients, so I could not compare the efficiency of signatures other than NPM1c. APL with PML-RARA is the most distinctive AML subtype which is easily separated from other AML samples based on transcriptome profile, so I would expect good results. This example shows the package works well for samples with very specific gene expression profile.DDB: We thank the reviewer for the exceptional effort and time invested to test our workflow on independent data - we hope results from this analysis have been informative for identifying other features within their data. Our workflow includes guidance for users who wish to import data from other sources such as those used by the reviewer.Interpretation of the resultsLH: Considering the result interpretation, I have some doubts. The singscores are composed of two components, an enrichment score and a dispersion estimate of ranks. I am informed that “high expression of up-regulated genes and low expression of down-regulated genes would result in higher scores”. This is logical. I also know the maximal ranges . However, which value is really high? For example, is 0.2 enough  or maybe I should expect much more, e.g. 0.7? Similarly, which value of dispersion should I expect? I suppose, the lowest, but which is low enough or which range is optimal? What is difficult to understand is that “despite the range of scores increasing, the discriminant power drops moderately” . I see the same paradox in my data – the scores are higher for up-reg. genes, which are much less efficient in discrimination between NPM1c+ and NPM1c- samples. It looks like scores only do not reflect the trends observed from score vs dispersion plots.DDB: Interpretation of singscores is intentionally left to be problem specific as it generally requires some domain-specific knowledge of the biological system and corresponding signature genes – ideally the computational biologist or bioinformaticians working on each project can provide some guidance.The basic interpretation of the score is the normalised mean rank of genes within the signature relative to all other genes in the sample. At the extrema this interpretation is relatively simple - near 1, a higher value would indicate that genes in the signature are expressed at higher levels relative to other genes. For scores towards zero, however, the interpretation can be much more difficult – a score of zero  could indicate the signature genes are tightly clustered around the sample-wide mean abundance, or it could indicate a highly-dispersed almost uniform distribution across the entire abundance range . By exploring the singscores together with dispersion estimates this information is summarised, assisting in estimation of effect size variability. Interpretation of scores depends on the context of the experiment and the typical behaviour of the gene set. A “high” score is best determined relative to other samples. This is achieved either by comparing scores from other samples in large datasets such as TCGA, or better, across a set of samples from a given experiment with known conditions. Other methods normalise the data before computing scores, and we note that a recent paper has applied z-score normalisation to results from singscore for comparison to ssGSEA . All singscores for samples remain the same and do not have to be recomputed upon addition of new samples, and interpretation will improve as more samples are added to the study. For example, Gaussian mixture modelling could be used to separate the NPM1c scores based on our expectation that there are two groups. This could be switched with other unsupervised classification algorithms such as hierarchical clustering or k-means clustering. We have added an example analysis to the manuscript to demonstrate how scores can be interpreted in an unsupervised setting, under the section “Transcriptional signatures to predict mutation status/Unsupervised classification of mutations”.There may be some cases where sample annotation is not available. In such scenarios, we are unable to build regression models to interpret scores. A higher singscore would provide stronger evidence for the signature but the magnitude is difficult to interpret without a reference. One approach to deal with this situation is to compare scores to those from other datasets where the mutations status is known. An alternative approach would be to compare scores within the dataset using unsupervised learning methods. Here we demonstrate the use of three clustering methods  to stratify samples, and as we have done previously [wang et al (2012) Journal of clinical bioinformatics] use the adjusted Rand index (ARI) to compare classifications. As expected, supervised (GLM) classification results in the best prediction. This is followed by clustering based on the score using Gaussian mixture decomposition. Any other classification algorithm along with prior knowledge could be used to decompose scores into groups. The important characteristic of singscores is that they maintain the discriminant power of gene signatures therefore can be coupled with supervised, semi-supervised or unsupervised algorithms to perform stratification.```library(mclust)#Gaussian mixture modelm1 = Mclust#k-means clusteringm2 = kmeans#hierarchical clusteringm3 = hclust)mutation_inference = cbind)apply```Possible improvementsLH: Although the package is generally useful and well described, the following improvements will make it more friendly for less advanced R users, e.g.LH: Instruction how to prepare and load the data other than those deposited in the GDC database.DDB: We have noted in text that the rank matrix can be computed using either a SummarizedExperiment object, DGEList object, ExpressionSet object, numeric matrix or a numeric data frame. As such, a numeric matrix with sample names as column names and genes as row names would suffice. Scoring should be performed on length bias corrected measurements such as RPKM/FPKM or TPM and not CPM or raw counts.Transcriptional signatures to predict mutation status/Score TCGA AML samples using the Verhaak signature - extract from text: “The `rankGenes` function will compute ranks from expression data in the form of either a numeric matrix, numeric data frame, ExpressionSet object, DGEList object or a SummarizedExperiment object”LH: Annotation of samples on the plots with unique sample IDs  – it is written in the article that the ‘singscore’ package supports different types of annotations (“Annotations of interest can be overlayed on each plot”) but I found only color code annotation whereas I would like to have color code for mutation type and additional text labels with sample IDs on the same plot.DDB: Sample labels can be added to landscape plots but were not supported in other visualisations. We have added functionality to the latest version of the singscore package (v1.5.1) to allow labelling of samples in the score vs. dispersion plots. We have modified the text to clarify, and modified Figure 6 to label samples where classification uncertainty (NMP1c vs WT) is high to demonstrate this feature. The changes below have been made to the section: “Transcriptional signatures to predict mutation status/Diagnostics of the Verhaak signature”.Sample annotations of interest  can be colour coded on each plot. ……Figure 6:```select_aml = !mutated_gene %in% 'Other'#label samples with an mclust NPM1c classification uncertainty of > 0.3label_samples = substr(rownames(verhaak_scores), 6, 12) #sample ID from barcodeslabel_samples[m1$uncertainty < 0.3] = NA#project mutations onto the landscapep1 = projectScoreLandscapep1 + theme```LH: A command which lists the samples typed as strong candidates for having particular mutation, ordered according to the calculated metrics.DDB: As discussed in an earlier comment, we recommend such analyses to be problem specific. Generally, a higher score would indicate a stronger effect of genes in the signature relative to WT samples therefore samples with higher scores would be stronger candidates for mutations. Alternatively, the partitioning created using Gaussian mixture modelling could be used as a guide for separation and samples with a score much higher than the threshold would be the strongest candidates for the mutation.LH: Generating a threshold line between samples with and without mutation.DDB: See above discussion/recommendation.LH: In future, it would be also good to include other signatures, e.g. the signature of 369 genes identified by Alcalayet al. in 20053, discriminating AML patients with NPMc+ from patients with NPMc-, even in cases with rare chromosomal abnormalities.LH: What I would expect the most from a package designed to identify mutations in transcriptomes, is a direct identification of mutations in RNAseq data. The results of mutation typing based on gene expression profile will be strongly supported when a particular mutation will be covered by RNAseq reads. From my own experience, I know it is possible . For genes with high and middle expression level, the coverage can be even higher than that obtained from genome- or exome-level data. And in the case when DNA data are unavailable, it would be really fantastic. Because it demands completely different data processing, it may be considered for future versions of the package.DDB: As we have outlined at the start of this review there may have been some misunderstanding around the purpose of this Workflow package/paper. We agree with the reviewer that direct detection of mutations/fusions from RNA-seq data is the best approach, and we now note this in the ‘Description of biological relevance section’ as stated above. The other gene signatures mentioned above could be incorporated in a workflow as singscore supports analysis and comparison of multiple gene sets.  The authors Bhuva et al. presented the application of a previously published gene set scoring tool, singscore, to discriminate AML subsets based on gene expression signatures, using signatures derived from known specific gene mutations or fusions. The authors show that singscore can effectively separate AML samples based on such gene signatures. Given the ability of the software to discriminate samples within heterogenous diseases, such as leukemias, its application to other cancers and diseases with similar levels of heterogeneity can be beneficial to improve patients' clinical outcomes. The rationale behind the application of the software and its step-wise descriptions are well explained. So is the interpretation of results. I appreciate the authors' efforts to explain all the steps and suggest alternatives, giving the software description the feel of a tutorial.Title. As far as I have understood, singscore doesn't actually predict mutations. Rather, it uses gene signatures associated to certain mutations in order to identify sub-groups within a population. As it is, the title is misleading.Similar rationale about the title of section "Predicting mutations using the Verhaak signature", page 16.In the section "Filter out genes with low counts", page 7, the authors describe explicitly how to handle duplicated entries caused by the GDCprepare function. Here I would reorganise and shorten the paragraph by first mentioning the issue introduced by the function, then saying edgeR is applied to the data filtered of duplicate entries.Figure 3. The legend below each graph is identical. I suggest to only use one legend for all three plots.The authors comment on several instances about the similarities between scores for signatures of two subgroups of AML samples, NPM1c and KMT2A-/MLL-fusion, and that's due to the presence of Hox genes. I suggest to have the lists of the two gene signatures directly in the article for immediate lookup. This is not essential, as the authors already refer to the articles they take the data from, but I think it will help readers. Minor comments: Typo in the caption of figure 1 (approcimately instead of approximately).Typo in figure 2 caption. I suppose "scores are plot against..." should read "scores are plotted against...". I have some small comments on some points I'd like to see addressed:I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard. We would like to thank Dr Marina Lizio for her very useful review, and we have addressed her comments as outlined below.ML: I have some small comments on some points I'd like to see addressed: 1. Title. As far as I have understood, singscore doesn't actually predict mutations. Rather, it uses gene signatures associated to certain mutations in order to identify sub-groups within a population. As it is, the title is misleading.status in AML from transcriptomic signatures” in order to clarify that we are simply predicting the mutation status of samples, not actual mutations.DDB: This is an excellent point. We have now changed the title to “Using singscore to predict mutation 2. Similar rationale about the title of section "Predicting mutations using the Verhaak signature", page 16.NPM1c mutation status using the Verhaak signature”. DDB: A similar change is made here, the title of this section is now: “Predicting 3. In the section "Filter out genes with low counts", page 7, the authors describe explicitly how to handle duplicated entries caused by the GDCprepare function. Here I would reorganise and shorten the paragraph by first mentioning the issue introduced by the function, then saying edgeR is applied to the data filtered of duplicate entries.DDB: The issue of duplicated features with the TCGAbiolinks package has been fixed in a recent update (TCGAbiolinks v2.12.2). Consequently, we will be removing the text describing the identification and removal of duplicated features. The text removed is:------------------------------Creation of a DGEList object is initially unsuccessful due to duplicated row names in the data matrix (107 features). The raw count files for individual samples do not have any duplicated features indicating this is introduced by the `GDCprepare` function. This is further supported by the fact that the counts for a single feature are the same for duplicated entries. An example of such a feature is shown below and we have verified duplicated entries of all other features to be the same.```{r}dup_features = rownames(aml_se)[duplicated(aml_se)]``````{r dup_entries}library(SummarizedExperiment)#example check on one feature IDdup_feature = 'ENSG00000011454'dup_data = assay(aml_se)identical```As such, it is safe to discard duplicated entries.------------------------------We also remove the code that discards duplicate features------------------------------aml_se = aml_se------------------------------ 4. Figure 3. The legend below each graph is identical. I suggest to only use one legend for all three plots.DDB: We appreciate this point, however each plot in this figure is generated by a function in the package which includes the legend. For a normal use case, users would be generating a single plot to diagnose a single sample, which is why we include a legend for the plot. In this workflow, we simply combine the three plots into a single figure. Removing legends from the default plots would overcomplicate the code of this diagnostic procedure in the workflow which is why we decided to leave the legends as they are. If users were interested in manipulating figures in their application, they could add extra options to the ggplot2 object (as we show with adding a new title and modifying the legend to be a single column). 5. The authors comment on several instances about the similarities between scores for signatures of two subgroups of AML samples, NPM1c and KMT2A-/MLL-fusion, and that's due to the presence of Hox genes. I suggest to have the lists of the two gene signatures directly in the article for immediate lookup. This is not essential, as the authors already refer to the articles they take the data from, but I think it will help readers.DDB: The signatures we downloaded from MSigDB have Entrez IDs for genes. The NPM1c and MLL signatures contain 491 unique genes. The reason we did not have the lists in the article was that we would be presenting 491 numbers that would have been difficult to interpret without mapping. Additionally, our intention is for readers to execute the workflow while reading this article. In this scenario, the geneIds function could be used to list the gene identifiers forming the signatures once they have been downloaded and parsed into R. Identifiers could be mapped to symbols using the mapIds function in the AnnotationDbi package and an annotation such those provided by the org.Hs.eg.db R/Bioconductor package. We hope that the ease with which these data can be accessed in the application will make the lists accessible for readers.ML: Minor comments: 1. Typo in the caption of figure 1 (approcimately instead of approximately).DDB: Thanks for helping us identify this, we have fixed it now. 2. Typo in figure 2 caption. I suppose "scores are plot against..." should read "scores are plotted against...".DDB: This has also been changed. Many thanks for the useful and constructive review. Best wishes, Mr Dharmesh Bhuva Bioinformatics Division The Walter and Eliza Hall Institute Dr Melissa Davis Bioinformatics Division The Walter and Eliza Hall Institute