-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblast.swift
56 lines (48 loc) · 1.43 KB
/
blast.swift
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
45
46
47
48
49
50
51
52
53
54
55
56
type fastaseq;
type headerfile;
type indexfile;
type seqfile;
type database
{
headerfile phr;
indexfile pin;
seqfile psq;
}
type query;
type output;
string num_partitions=arg("n", "8");
string program_name=arg("p", "blastp");
fastaseq dbin <single_file_mapper;file=arg("d", "database")>;
query query_file <single_file_mapper;file=arg("i", "sequence.seq")>;
string expectation_value=arg("e", "0.1");
output blast_output_file <single_file_mapper;file=arg("o",
"output.html")>;
string filter_query_sequence=arg("F", "F");
fastaseq partition[] <ext;exec="splitmapper.sh",n=num_partitions>;
app (fastaseq out[]) split_database (fastaseq d, string n)
{
fastasplitn filename(d) n;
}
app (database out) formatdb (fastaseq i)
{
formatdb "-i" filename(i);
}
app (output o) blastapp(query i, fastaseq d, string p, string e, string f,
database db)
{
blastall "-p" p "-i" filename(i) "-d" filename(d) "-o" filename(o)
"-e" e "-T" "-F" f;
}
app (output o) blastmerge(output o_frags[])
{
blastmerge filename(o) filenames(o_frags);
}
partition=split_database(dbin, num_partitions);
database formatdbout[] <ext; exec="formatdbmapper.sh",n=num_partitions>;
output out[] <ext; exec="outputmapper.sh",n=num_partitions>;
foreach part,i in partition {
formatdbout[i] = formatdb(part);
out[i]=blastapp(query_file, part, program_name, expectation_value,
filter_query_sequence, formatdbout[i]);
}
blast_output_file=blastmerge(out);