Plot setup

<<StatisticalPlots`

edfOptions={Frame->True,FrameStyle->Directive[12,(FontFamily->"Helvetica"),Black,Thickness[0.0016]],
LabelStyle->(FontFamily->"Helvetica"),Axes->None,
GridLines->Automatic,GridLinesStyle->Directive[Lighter[Gray]]};

pieChartOptions=BaseStyle->Directive[13,(FontFamily->"Helvetica")]

histogramOptions={Frame->True,FrameStyle->Directive[14,(FontFamily->"Helvetica"),Black,Thickness[0.0016]],
LabelStyle->(FontFamily->"Helvetica"),
GridLines->Automatic,GridLinesStyle->Directive[Lighter[Gray]]};
histogram3DOptions={AxesStyle->Directive[14,(FontFamily->"Helvetica"),Black,Thickness[0.001]],
LabelStyle->(FontFamily->"Helvetica")};

listPlotOptions={Frame->True,FrameStyle->Directive[14,(FontFamily->"Helvetica"),Black,Thickness[0.001]],
LabelStyle->Directive[14,FontFamily->"Helvetica"],Axes->None,
GridLines->Automatic,GridLinesStyle->Directive[Gray,Opacity[0.8]]};
listPlotOptionsInset={Frame->True,FrameStyle->Directive[20,(FontFamily->"Helvetica"),Black,Thickness[0.001]],
LabelStyle->(FontFamily->"Helvetica"),Axes->None,
GridLines->Automatic,GridLinesStyle->Directive[Gray,Opacity[0.6]]};

barchartOptions={Frame->True,BaseStyle->Directive[14,(FontFamily->"Helvetica")],
LabelStyle->(FontFamily->"Helvetica"),Axes->None,FrameTicks->{{Automatic,None},{None,None}},
GridLines->{None,Automatic},GridLinesStyle->Directive[Gray,Opacity[0.4]]};

edfFn[lis_]:=(
y=Table[N[i/Length[lis]],{i,Length[lis]}];
x=Sort[lis];
xy=Table[{x[[i]],y[[i]]},{i,Length[lis]}]
)

(* lis = {{name,value},{name,value},...}*)
edfWithNames[lis_]:=(
sortedLis=Sort[lis,(#1[[2]]<#2[[2]])&];
lisLen=Length[lis];
xy=Table[{sortedLis[[i,1]],sortedLis[[i,2]],N[i/lisLen]},{i,Length[lis]}]
)

edfFn[{1,2,3,4,5}]
edfWithNames[{
{"a",1},
{"b",5},
{"c",3},
{"d",4},
{"e",2}
}
]

(* Days to death values can include 'null'. Decreasing curve will stop at a floor=f(null) *)
survivalWithNullsFn[daysToDeathAllVals_]:=(
daysNotNull=Select[daysToDeathAllVals,(StringMatchQ[ToString[#],"null"]==False)&];
daysNull=Select[daysToDeathAllVals,(StringMatchQ[ToString[#],"null"]==True)&];
y=Table[1-N[i/Length[daysToDeathAllVals]],{i,Length[daysNotNull]}];
x=Sort[daysNotNull];
xy=Table[{x[[i]],y[[i]]},{i,Length[daysNotNull]}]
)

Data

CIMP-H miRNAs

cimpHMiRnas=Import["/Users/grobertson/GENEREG/ChIP/CHIP_SEQ/SOLEXA/TCGA/COAD-READ/manuscript/Vesteinn_Thorsson/CIMPHMIRNs.tsv","TSV"];
Dimensions[cimpHMiRnas]
cimpHMiRnas[[1;;5]]//TableForm

cimpHMiRnaNames=cimpHMiRnas[[All,1]]
Tally[cimpHMiRnaNames]

CIMP-L miRNAs

cimpLMiRnas=Import["/Users/grobertson/GENEREG/ChIP/CHIP_SEQ/SOLEXA/TCGA/COAD-READ/manuscript/Vesteinn_Thorsson/CIMPLMIRNs.tsv","TSV"];
Dimensions[cimpLMiRnas]
cimpLMiRnas//TableForm
cimpLMiRnaNames=cimpLMiRnas[[All,1]]

Complement[cimpLMiRnaNames,cimpHMiRnaNames]

Precursor expression matrix

expnMatrix=Import["/Users/grobertson/GENEREG/ChIP/CHIP_SEQ/SOLEXA/TCGA/COAD-READ/manuscript/Vesteinn_Thorsson/CORE_expn_matrix_norm_passed_TCGA.txt","TSV"];
expnMatrixHdr=expnMatrix[[1]];
expnMatrix[[1;;5,1;;7]]//TableForm

expnMatrixCimpHMiRnas=Select[expnMatrix,(MemberQ[cimpHMiRnaNames,#[[1]]]==True)&];
Dimensions[expnMatrixCimpHMiRnas]
expnMatrixCimpHMiRnasWithHdr=Prepend[expnMatrixCimpHMiRnas,expnMatrixHdr];
expnMatrixCimpHMiRnasWithHdr[[1;;5,1;;7]]//TableForm

expnMatrixCimpLMiRnas=Select[expnMatrix,(MemberQ[cimpLMiRnaNames,#[[1]]]==True)&];
Dimensions[expnMatrixCimpLMiRnas]
expnMatrixCimpLMiRnasWithHdr=Prepend[expnMatrixCimpLMiRnas,expnMatrixHdr];
expnMatrixCimpLMiRnasWithHdr[[All,1;;7]]//TableForm

expnMatrixCimpHandLMiRnas=Join[expnMatrixCimpHMiRnasWithHdr,expnMatrixCimpLMiRnas];
Dimensions[expnMatrixCimpHandLMiRnas]
expnMatrixCimpHandLMiRnas[[1;;5,1;;7]]//TableForm

rowMeanFn[row_]:=Mean[row[[2;;All]]]
rowVarianceFn[row_]:=Variance[row[[2;;All]]]

allMeans=Map[rowMeanFn,expnMatrix[[2;;All]]];
cimpMeans=Map[rowMeanFn,expnMatrixCimpHandLMiRnas[[2;;All]]]
allVariances=Map[rowVarianceFn,expnMatrix[[2;;All]]];
cimpVariances=Map[rowVarianceFn,expnMatrixCimpHandLMiRnas[[2;;All]]]
{Length[allMeans],Length[cimpMeans],Length[allVariances],Length[cimpVariances]}

Show[

ListLogLinearPlot[edfFn[allVariances],PlotStyle->Directive[Gray,PointSize[0.012]],PlotRange->{All,{-0.02,1.02}},Frame->True,GridLines->Automatic,GridLinesStyle->Opacity[0.5],FrameLabel->{"miRNA RPM variance","Fraction of miRNAs","COAD-READ 221"}],

ListLogLinearPlot[edfFn[cimpVariances],PlotStyle->Directive[Darker[Blue],PointSize[0.015]]],

BaseStyle->Directive[14,(FontFamily->"Arial"),ImageSize->300]
]

Export["/Users/grobertson/GENEREG/ChIP/CHIP_SEQ/SOLEXA/TCGA/COAD-READ/manuscript/Vesteinn_Thorsson/expnMatrix.CIMPH-MIRNs.20110621.tsv",expnMatrixCimpHMiRnasWithHdr,"TSV"]

(*Export["/Users/grobertson/GENEREG/ChIP/CHIP_SEQ/SOLEXA/TCGA/COAD-READ/manuscript/Vesteinn_Thorsson/expnMatrix.CIMPH-and-L-MIRNs.20110621.tsv",expnMatrixCimpHandLMiRnas,"TSV"]*)