本文整理汇总了C#中Workspace.CreateSamplingData方法的典型用法代码示例。如果您正苦于以下问题:C# Workspace.CreateSamplingData方法的具体用法?C# Workspace.CreateSamplingData怎么用?C# Workspace.CreateSamplingData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Workspace
的用法示例。
在下文中一共展示了Workspace.CreateSamplingData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sample
private static void Sample(string cleavageSiteName, uniprot db, IEnumerable<Tuple<TagInfo, TagInfo>> cleavageSites, string windowString, Workspace workspace)
{
var array = windowString.Split('-');
Debug.Assert(array.Length == 2, "Window string dont have 2 numbers");
var windowLeft = int.Parse(array[0]);
var windowRight = int.Parse(array[1]);
var acc = workspace.CreateSamplingData(windowLeft + windowRight);
acc.Class = cleavageSiteName + "|" + windowString;
foreach (var cleavageSite in cleavageSites)
{
Debug.Assert(cleavageSite.Item1.Accession == cleavageSite.Item2.Accession);
var entry = db.entry.First(x => x.accession.Contains(cleavageSite.Item1.Accession));
var text = CleanText(entry.sequence.Value);
Console.Error.WriteLine("Sampling window {0}-{1} applied to {2}:{3}", windowLeft, windowRight, cleavageSite.Item1.Accession, cleavageSiteName);
SamplePositivesNegatives(acc, text, windowLeft, windowRight, cleavageSite);
}
var num = acc.Positives.Count + acc.Negatives.Count;
Console.Error.WriteLine("Collected {0} samples (p:{1} / n:{2})", num, acc.Positives.Count, acc.Negatives.Count);
}