本文整理汇总了C#中Sample.GetIndexPairsForRunFolder方法的典型用法代码示例。如果您正苦于以下问题:C# Sample.GetIndexPairsForRunFolder方法的具体用法?C# Sample.GetIndexPairsForRunFolder怎么用?C# Sample.GetIndexPairsForRunFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sample
的用法示例。
在下文中一共展示了Sample.GetIndexPairsForRunFolder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSampleLines
private IEnumerable<string> GetSampleLines(Sample s, List<string> keyList)
{
var lines = new List<string>();
foreach (string runFolder in s.RunFolders)
{
List<string> indexPairs = s.GetIndexPairsForRunFolder(runFolder);
foreach (string indexPair in indexPairs)
{
List<int> lanes = s.GetLanesForRunFolderAndIndex(runFolder, indexPair);
lanes.Sort();
string lanesString = "";
HashSet<int> allLanes = new HashSet<int>(GetAllLanes());
if (!allLanes.SetEquals(lanes))
lanesString = string.Join("+", lanes);
List<string> line = new List<string>();
foreach (string key in keyList)
{
switch (key.ToLowerInvariant())
{
case "runfolder":
line.Add(runFolder);
break;
case "sampleid":
case "sample_id":
line.Add(s.SampleID);
break;
case "index":
string[] splat = indexPair.Split('|');
line.Add(splat[0]);
break;
case "index2":
string[] splat2 = indexPair.Split('|');
line.Add(splat2[1]);
break;
case "genomefolder":
case "genome":
line.Add(s.GenomePath);
break;
case "samplename":
case "sample_name":
line.Add(s.Name);
break;
case "manifest":
string manifestKey = ManifestLookup.FirstOrDefault(kvp => kvp.Value == s.ManifestFileName).Key;
if (manifestKey == null && s.ManifestFileName.StartsWith(Sample.UnknownManifest))
manifestKey = s.ManifestFileName.Replace(Sample.UnknownManifest, "");
line.Add(manifestKey ?? string.Empty);
break;
case "lane":
case "lanes":
line.Add(lanesString);
break;
case "sample_project":
case "sampleproject":
case "project":
line.Add(s.SampleProject);
break;
case "genesfolder":
line.Add(s.GenesFolder);
break;
case "fastqfolder":
line.Add(s.FastqFolder);
break;
default:
line.Add(GetCustomDataColumn(key.ToLowerInvariant(), s));
break;
}
}
lines.Add(CSVWriter.GetLine(line.ToArray()));
}
}
return lines;
}