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}
}
]

Data

edgeRTab=Import["/Users/grobertson/GENEREG/ChIP/CHIP_SEQ/SOLEXA/TCGA/batch_effects/HiSeq/differential_abundance/topN.expn_matrix.767-miRs.nonzero-sums.20110516.txt","TSV"];
edgeRTab[[1;;5]]//TableForm
edgeRData=Drop[edgeRTab,1];
Dimensions[edgeRData]

logConc=edgeRData[[All,2]];
logFC=edgeRData[[All,3]];

ListPlot[Transpose[{logConc,logFC}],listPlotOptions,PlotRange->{{-30,0},{-3,3}}]

recs1=Select[edgeRData,(#[[5]]<=0.05)&];
Length[recs1]
logConc1=recs1[[All,2]];
logFC1=recs1[[All,3]];
Prepend[recs1,edgeRTab[[1]]]//TableForm

sh=Show[

ListPlot[Transpose[{logConc,logFC}],PlotStyle->Directive[Lighter[Blue],Opacity[0.6],PointSize[0.012]],listPlotOptions,PlotRange->{{-30,0},{-3,3}},FrameLabel->{"(Subscript[log, 2])(Concentration)","(Subscript[log, 2])(Fold change)"}],

ListPlot[Transpose[{logConc1,logFC1}],PlotStyle->Directive[Red,PointSize[0.014]]],

ImageSize->400,ImageMargins->5
]

Export["/Users/grobertson/GENEREG/ChIP/CHIP_SEQ/SOLEXA/TCGA/batch_effects/HiSeq/differential_abundance/topN.smearPlot.expn_matrix.767-miRs.nonzero-sums.20110516.pdf",sh];

Table[Flatten[{
recs1[[i]],
2^recs1[[i,2]]
}],{i,Length[recs1]}]//TableForm

daMiRNAs=recs1[[All,1]]

GC for 939 UCSC hg19 miRBase v15 mature/star strands?

v15GC=ReadList["/Users/grobertson/GENEREG/Data/miRNA/mirBase/v15/miRNA.seqs.gc.txt","String"];
Length[v15GC]
v15GCs=Table[StringSplit[v15GC[[i]]," "],{i,Length[v15GC]}];
Dimensions[v15GCs]
v15GCs[[1;;5]]//TableForm
v15GcData=Drop[v15GCs,1];
v15GcDataN=Map[ToExpression,v15GcData];
{v15GcDataN[[1,1]],NumberQ[v15GcDataN[[1,1]]]}

lenPri=v15GcDataN[[All,1]];
Histogram[lenPri]

gcPri=v15GcDataN[[All,6]];
Histogram[gcPri]

GC content of miRBase miRNAs

mature=Import["/Users/grobertson/GENEREG/Data/miRNA/mirBase/v16/mature.hsa.one-line.fa","CSV"];
Dimensions[mature]
mature[[1;;5]]//TableForm

m=mature[[1,3]]
StringLength[m]
gOrC=StringCases[m,{"G","g","C","c"}]
Length[gOrC]
N[Length[gOrC]/StringLength[m]]

gcContentFn[rec_]:=(
name=rec[[1]];
seq=rec[[3]];
gOrC=StringCases[seq,{"G","g","C","c"}];
gcFrac=N[Length[gOrC]/StringLength[seq]];
Append[rec,gcFrac]
)
gcContentFn[matureFa[[1]]]

result=Map[gcContentFn,mature];
result=Sort[result,(#1[[4]]>#2[[4]])&];
result[[1;;5]]//TableForm

gc=result[[All,4]];
{Min[gc],Max[gc]}

sh=Show[
ListPlot[edfFn[gc],PlotStyle->Directive[Lighter[Blue],Opacity[0.8],PointSize[0.012]],listPlotOptions,PlotRange->{{0,1},All},FrameLabel->{"Fraction G|C","Frac of mature|star strands"}],

ListPlot[edfFn[gcPri],PlotStyle->Directive[Lighter[Green],Opacity[0.2],PointSize[0.01]]],

Graphics[{Text["miRBase 17 hsa",{0.03,0.95},{-1,0},Background->White]}],
ImageSize->400,ImageMargins->5,BaseStyle->Directive[14,(FontFamily->"Arial")]
]

Export["/Users/grobertson/GENEREG/Data/miRNA/mirBase/v16/mature.hsa.fraction-GC.txt",result,"TSV"]
Export["/Users/grobertson/GENEREG/Data/miRNA/mirBase/v16/mature.hsa.fraction-GC.txt",result,"TSV"]

daMiRNAs

daGcRecs=Select[result,(MemberQ[daMiRNAs,ToLowerCase[#[[1]]]]==True)&];
daGcRecs//TableForm

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]}]
)

edf=edfWithNames[result[[All,{1,4}]]];
selEdf=Select[edf,(MemberQ[daMiRNAs,ToLowerCase[#[[1]]]]==True)&];
selEdf//TableForm
ListPlot[edfAdd[[All,2;;3]]]

labels=Table[Graphics[Text[selEdf[[i,1]],{selEdf[[i,2]],selEdf[[i,3]]},{-1.2,0}]],{i,Length[selEdf]}];

sh=Show[
ListPlot[edfFn[gc],PlotStyle->Directive[Lighter[Blue],Opacity[0.8],PointSize[0.01]],listPlotOptions,PlotRange->{{0,1},All},FrameLabel->{"Fraction G|C","Frac of mature|star strands"}],

ListPlot[edfFn[gcPri],PlotStyle->Directive[Lighter[Green],Opacity[0.7],PointSize[0.009]]],
ListPlot[selEdf[[All,2;;3]],PlotStyle->Directive[Black,PointSize[0.015]],PlotMarkers->{□,18}],
(*labels,*)

(*Graphics[{Blue,Opacity[0.07],Rectangle[{0.7,0.0},{1,1}]}],
Graphics[{Blue,Opacity[0.07],Rectangle[{0.8,0.0},{1,1}]}],*)

Graphics[{Text["miRBase hsa",{0.03,0.95},{-1,0},Background->White]}],


ImageSize->400,ImageMargins->5,BaseStyle->Directive[14,(FontFamily->"Arial")]
]