Skip to content

Commit

Permalink
Manual formatting adjustments
Browse files Browse the repository at this point in the history
Auto-formatting was leaving some new array expressions oddly indented.
  • Loading branch information
JosephTremoulet committed Sep 15, 2017
1 parent be6743d commit 0dcaa77
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,30 +267,30 @@ public Frequency(char c, double p)
}

static Frequency[] IUB = {
new Frequency ('a', 0.27)
,new Frequency ('c', 0.12)
,new Frequency ('g', 0.12)
,new Frequency ('t', 0.27)

,new Frequency ('B', 0.02)
,new Frequency ('D', 0.02)
,new Frequency ('H', 0.02)
,new Frequency ('K', 0.02)
,new Frequency ('M', 0.02)
,new Frequency ('N', 0.02)
,new Frequency ('R', 0.02)
,new Frequency ('S', 0.02)
,new Frequency ('V', 0.02)
,new Frequency ('W', 0.02)
,new Frequency ('Y', 0.02)
};
new Frequency ('a', 0.27),
new Frequency ('c', 0.12),
new Frequency ('g', 0.12),
new Frequency ('t', 0.27),

new Frequency ('B', 0.02),
new Frequency ('D', 0.02),
new Frequency ('H', 0.02),
new Frequency ('K', 0.02),
new Frequency ('M', 0.02),
new Frequency ('N', 0.02),
new Frequency ('R', 0.02),
new Frequency ('S', 0.02),
new Frequency ('V', 0.02),
new Frequency ('W', 0.02),
new Frequency ('Y', 0.02)
};

static Frequency[] HomoSapiens = {
new Frequency ('a', 0.3029549426680)
,new Frequency ('c', 0.1979883004921)
,new Frequency ('g', 0.1975473066391)
,new Frequency ('t', 0.3015094502008)
};
new Frequency ('a', 0.3029549426680),
new Frequency ('c', 0.1979883004921),
new Frequency ('g', 0.1975473066391),
new Frequency ('t', 0.3015094502008)
};


private static void FillRandom(int[] result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,30 +88,30 @@ public Frequency(char c, double p)
}

static Frequency[] IUB = {
new Frequency ('a', 0.27)
,new Frequency ('c', 0.12)
,new Frequency ('g', 0.12)
,new Frequency ('t', 0.27)

,new Frequency ('B', 0.02)
,new Frequency ('D', 0.02)
,new Frequency ('H', 0.02)
,new Frequency ('K', 0.02)
,new Frequency ('M', 0.02)
,new Frequency ('N', 0.02)
,new Frequency ('R', 0.02)
,new Frequency ('S', 0.02)
,new Frequency ('V', 0.02)
,new Frequency ('W', 0.02)
,new Frequency ('Y', 0.02)
};
new Frequency ('a', 0.27),
new Frequency ('c', 0.12),
new Frequency ('g', 0.12),
new Frequency ('t', 0.27),

new Frequency ('B', 0.02),
new Frequency ('D', 0.02),
new Frequency ('H', 0.02),
new Frequency ('K', 0.02),
new Frequency ('M', 0.02),
new Frequency ('N', 0.02),
new Frequency ('R', 0.02),
new Frequency ('S', 0.02),
new Frequency ('V', 0.02),
new Frequency ('W', 0.02),
new Frequency ('Y', 0.02)
};

static Frequency[] HomoSapiens = {
new Frequency ('a', 0.3029549426680)
,new Frequency ('c', 0.1979883004921)
,new Frequency ('g', 0.1975473066391)
,new Frequency ('t', 0.3015094502008)
};
new Frequency ('a', 0.3029549426680),
new Frequency ('c', 0.1979883004921),
new Frequency ('g', 0.1975473066391),
new Frequency ('t', 0.3015094502008)
};

static void MakeCumulative(Frequency[] a)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ static int Bench(TextReader inputReader, bool verbose)

// regex match
string[] variants = {
"agggtaaa|tttaccct"
,"[cgt]gggtaaa|tttaccc[acg]"
,"a[act]ggtaaa|tttacc[agt]t"
,"ag[act]gtaaa|tttac[agt]ct"
,"agg[act]taaa|ttta[agt]cct"
,"aggg[acg]aaa|ttt[cgt]ccct"
,"agggt[cgt]aa|tt[acg]accct"
,"agggta[cgt]a|t[acg]taccct"
,"agggtaa[cgt]|[acg]ttaccct"
};
"agggtaaa|tttaccct",
"[cgt]gggtaaa|tttaccc[acg]",
"a[act]ggtaaa|tttacc[agt]t",
"ag[act]gtaaa|tttac[agt]ct",
"agg[act]taaa|ttta[agt]cct",
"aggg[acg]aaa|ttt[cgt]ccct",
"agggt[cgt]aa|tt[acg]accct",
"agggta[cgt]a|t[acg]taccct",
"agggtaa[cgt]|[acg]ttaccct"
};

int count;
foreach (string v in variants)
Expand All @@ -97,12 +97,12 @@ static int Bench(TextReader inputReader, bool verbose)

// regex substitution
IUB[] codes = {
new IUB("tHa[Nt]", "<4>")
,new IUB("aND|caN|Ha[DS]|WaS", "<3>")
,new IUB("a[NSt]|BY", "<2>")
,new IUB("<[^>]*>", "|")
,new IUB("\\|[^|][^|]*\\|" , "-")
};
new IUB("tHa[Nt]", "<4>"),
new IUB("aND|caN|Ha[DS]|WaS", "<3>"),
new IUB("a[NSt]|BY", "<2>"),
new IUB("<[^>]*>", "|"),
new IUB("\\|[^|][^|]*\\|" , "-")
};

foreach (IUB iub in codes)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ Modified to reduce memory use by Anthony Lloyd

namespace BenchmarksGame
{
class RevCompSequence { public List<byte[]> Pages; public int StartHeader, EndExclusive; public Thread ReverseThread; }
class RevCompSequence
{
public List<byte[]> Pages;
public int StartHeader, EndExclusive;
public Thread ReverseThread;
}

public static class ReverseComplement_6
{
Expand Down Expand Up @@ -110,8 +115,7 @@ static void Grouper()
{
var sequence = new RevCompSequence
{
Pages = data
,
Pages = data,
StartHeader = startHeader,
EndExclusive = i
};
Expand All @@ -127,8 +131,7 @@ static void Grouper()
i = Array.IndexOf<byte>(data[data.Count - 1], 0, 0);
var lastSequence = new RevCompSequence
{
Pages = data
,
Pages = data,
StartHeader = startHeader,
EndExclusive = i == -1 ? data[data.Count - 1].Length : i
};
Expand Down

0 comments on commit 0dcaa77

Please sign in to comment.