Skip to content

Commit

Permalink
improvements on the test doc
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Aug 25, 2016
1 parent ebb744e commit 625db23
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ManhattanPlot/Canvas.vb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Public Module Canvas
{"21", 48129895},
{"22", 51304566},
{"X", 156040895}, {"23", 156040895},
{"Y", 57227415}, {"24", 156040895}
{"Y", 57227415}, {"24", 57227415}
}

Public ReadOnly Property ChromosomeColors As New Dictionary(Of String, SolidBrush) From {
Expand Down
11 changes: 6 additions & 5 deletions ManhattanPlot/Program.vb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Module Program
Return GetType(Program).RunCLI(App.CommandLine)
End Function

<ExportAPI("/Draw", Usage:="/Draw /in <data.csv> [/out <out.png> /sampleColors <sample_colors.csv> /width 3000 /height 1440 /pt.size 25 /debug.label /equidistant /relative /ylog <ln/log/raw, default:=ln> /colorPattern <chr/sampleName/interval, default:=chr>]",
<ExportAPI("/Draw", Usage:="/Draw /in <data.csv> [/out <out.png> /sampleColors <sample_colors.csv> /width 3000 /height 1440 /pt.size 10 /debug.label /equidistant /relative /ylog <ln/log/raw, default:=ln> /colorPattern <chr/sampleName/interval, default:=chr>]",
Info:="Invoke the Manhattan plots for the SNP sites.",
Example:="/Draw /in ./manhattan_plot_test.csv /out ./manhattan_plot_test.png")>
<ParameterInfo("/in", False, AcceptTypes:={GetType(SNP())})>
Expand All @@ -81,7 +81,7 @@ Module Program
Dim sampleColors As String = args("/sampleColors")
Dim w As Integer = args.GetValue("/width", 3000)
Dim h As Integer = args.GetValue("/height", 1440)
Dim ptSize As Integer = args.GetValue("/pt.size", 25)
Dim ptSize As Integer = args.GetValue("/pt.size", 10)
Dim debug As Boolean = args.GetBoolean("/debug.label")
Dim eqdist As Boolean = args.GetBoolean("/equidistant")
Dim rel As Boolean = args.GetBoolean("/relative")
Expand All @@ -91,9 +91,10 @@ Module Program
Dim data As IEnumerable(Of SNP) = [in].LoadCsv(Of SNP)
Dim samples As Dictionary(Of String, String) = Nothing
If sampleColors.FileExists Then
samples = sampleColors.LoadCsv(Of SampleColor) _
.ToDictionary(Function(x) x.SampleName,
Function(x) x.Color)
Dim colors = sampleColors.LoadCsv(Of SampleColor)
samples = colors.ToDictionary(
Function(x) x.SampleName,
Function(x) x.Color)
End If
Dim image As Bitmap = data.Plot(w, h, samples,, ptSize, debug, eqdist, rel, ylog, cptn)
Return image.SaveAs(out, ImageFormats.Png).CLICode
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Canvas.Plot(System.Collections.Generic.IEnumerable(Of ManhattanPlot.SNP), Intege
Dim image As Bitmap = data.Plot(colorPattern:="chr")
Call image.SaveAs("./manhattan_plot_test.png", ImageFormats.Png)
```
![](./example/manhattan_plot_test.png)
![](./example/manhattan_plot_test_chr.png)


```vbnet
Expand Down
9 changes: 7 additions & 2 deletions example/SampleColors.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
SampleName,Color
,
SampleName,Color
sample1,"rgb(198,34,43)"
sample2,"rgb(34,66,153)"
sample3,"rgb(39,180,76)"
sample4,"rgb(199,192,50)"
sample5,"rgb(164,55,148)"
sample6,"rgb(64,64,64)"
Binary file removed example/manhattan_plot_test.png
Binary file not shown.
Binary file added example/manhattan_plot_test_chr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/manhattan_plot_test_sampleName.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 625db23

Please sign in to comment.