本文整理汇总了C#中IMatrixData.ExtractExpressionRows方法的典型用法代码示例。如果您正苦于以下问题:C# IMatrixData.ExtractExpressionRows方法的具体用法?C# IMatrixData.ExtractExpressionRows怎么用?C# IMatrixData.ExtractExpressionRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMatrixData
的用法示例。
在下文中一共展示了IMatrixData.ExtractExpressionRows方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FilterRows
public static void FilterRows(IMatrixData mdata, Parameters parameters, int[] rows)
{
bool reduceMatrix = GetReduceMatrix(parameters);
if (reduceMatrix){
mdata.ExtractExpressionRows(rows);
} else{
Array.Sort(rows);
string[][] col = new string[mdata.RowCount][];
for (int i = 0; i < col.Length; i++){
bool contains = Array.BinarySearch(rows, i) >= 0;
col[i] = contains ? new[]{"Keep"} : new[]{"Discard"};
}
mdata.AddCategoryColumn("Filter", "", col);
}
}
示例2: ProcessData
public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables,
ref IDocumentData[] documents, ProcessInfo processInfo)
{
int ind = param.GetSingleChoiceParam("Column").Value;
bool descending = param.GetBoolParam("Descending").Value;
if (ind < mdata.ExpressionColumnCount){
float[] v = mdata.GetExpressionColumn(ind);
int[] o = ArrayUtils.Order(v);
if (descending){
ArrayUtils.Revert(o);
}
mdata.ExtractExpressionRows(o);
} else{
double[] v = mdata.NumericColumns[ind - mdata.ExpressionColumnCount];
int[] o = ArrayUtils.Order(v);
if (descending){
ArrayUtils.Revert(o);
}
mdata.ExtractExpressionRows(o);
}
}
示例3: ProcessData
public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables, ProcessInfo processInfo)
{
int colInd = param.GetSingleChoiceParam("Column").Value;
string value = param.GetStringParam("Find").Value;
bool remove = param.GetSingleChoiceParam("Mode").Value == 0;
string[][] cats = mdata.CategoryColumns[colInd];
List<int> valids = new List<int>();
for (int i = 0; i < cats.Length; i++){
bool valid = true;
foreach (string w in cats[i]){
if (w.Equals(value)){
valid = false;
break;
}
}
if ((valid && remove) || (!valid && !remove)){
valids.Add(i);
}
}
mdata.ExtractExpressionRows(valids.ToArray());
}
示例4: ProcessData
public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables,
ref IDocumentData[] documents, ProcessInfo processInfo)
{
int colIndex = param.GetSingleChoiceParam("Column with second last AA").Value;
string aas = param.GetStringParam("Amino acids").Value;
string[][] col = mdata.GetCategoryColumnAt(colIndex);
List<int> validRows = new List<int>();
for (int i = 0; i < mdata.RowCount; i++){
string[] x = col[i];
for (int j = 0; j < x.Length; j++){
if (x[j].Length != 1){
processInfo.ErrString = "Some of the entries in column " + mdata.CategoryColumnNames[colIndex] +
" do not contain amino acids";
return;
}
}
bool keep = JudgeIfKept(aas, x);
if (keep){
validRows.Add(i);
}
}
mdata.ExtractExpressionRows(validRows.ToArray());
}