File: preprocess_util.js

package info (click to toggle)
python-schema-salad 8.9.20250723145140-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,076 kB
  • sloc: python: 19,177; cpp: 2,631; cs: 1,869; java: 1,341; makefile: 187; xml: 184; sh: 103; javascript: 46
file content (44 lines) | stat: -rw-r--r-- 912 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

function filterForIndels(inArr)
{
	var arr = [];
	for (var i = 0; i < inArr.length ; i++)
	{
		if (inArr[i].basename.indexOf("indel") >= 0)
		{
			arr.push(inArr[i]);
		}
	}
	return arr;
}

/**
 * workflowName - the name of the workflow to filter for.
 * vcfType - the type of VCF (snv, indel, etc...)
 * inArr - an array of files (File[]) to search through.
 */
function filterFor(workflowName, vcfType, inArr)
{
	var arr = [];
	for (var i = 0; i < inArr.length; i++)
	{
		if (typeof(inArr[i]) == "string") //("class" in inArr[i] && inArr[i].class == "File")
		{
			if (inArr[i].indexOf(workflowName) >= 0 && inArr[i].indexOf(vcfType) >= 0)
			{
				arr.push(inArr[i])
			}
		}
		else
		{
			if ("class" in inArr[i] && inArr[i].class == "File")
			{
				if (inArr[i].basename.indexOf(workflowName) >= 0 && inArr[i].basename.indexOf(vcfType) >= 0)
				{
					arr.push(inArr[i])
				}
			}
		}
	}
	return arr;
}