/// <summary> /// Make a PDF depth of coverage plot for the given file and MT DNA name. /// Can be called after the reads are all processed. /// </summary> /// <param name="BAMFileName"></param> /// <param name="outputFileName"></param> /// <returns></returns> public void OutputCoverageGraphAndCSV(string outputFilePrefix) { //Now to make the plot var r = new RInterface(); List <RInterface.OptionalArgument> args = new List <RInterface.OptionalArgument>() { new RInterface.OptionalArgument("type", "l") }; r.PlotPDF(Enumerable.Range(0, StaticResources.CRS_LENGTH).Select(x => (double)(x + 1)), depthCounts, outputFilePrefix + "Coverage.pdf", "Depth of Coverage", "mtDNA Position", "Depth", null, args); StreamWriter sw = new StreamWriter(outputFilePrefix + "Coverage.csv"); sw.WriteLine("Pos,Depth"); for (int i = 0; i < depthCounts.Length; i++) { sw.WriteLine((i + 1).ToString() + "," + depthCounts[i].ToString()); } sw.Close(); }
public MitoPaintedAssembler() : base() { #if !NO_R rInt = new RInterface(); #endif }