Created
          May 8, 2018 16:53 
        
      - 
      
- 
        Save AmyOlex/af8db47c91c3a0ec1bae3adc0704b4ae to your computer and use it in GitHub Desktop. 
Revisions
- 
        AmyOlex created this gist May 8, 2018 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ ## From forum post https://bioinformatics.stackexchange.com/questions/2586/how-to-apply-upperquartile-normalization-on-rsem-expected-counts ## this uses all data in the quantile function, including those that are not expressed ## Assumes genes are rows and samples are columns data.quantileAll <- apply(unnormalized_mtx, 2, function(x){quantile(x, 0.75)}) ## this uses onlt the values that are greater than zero. ##data.quantileExpressed <- apply(unnormalized_mtx, 2, function(x){quantile(x[x>0], 0.75)}); data.norm <- t(t(unnormalized_mtx) / data.quantileAll) write.table(data.norm, file="UpperQuantileNorm_Log2TPM_CancerFocusGenes_TCGA817_and_Harrell_NOTHumanPercentCorrected_10MillionHumanReadFiltered.txt",sep="\t", quote=FALSE)