-
Notifications
You must be signed in to change notification settings - Fork 2
/
InputBamFile.ts
68 lines (67 loc) · 2.13 KB
/
InputBamFile.ts
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
57
58
59
60
61
62
63
64
65
66
67
68
import * as cp from "child_process";
import * as atomic from "./atomicOperations";
import {AtomicOperationForkEvent} from "./../atomicOperationsIPC";
import {getReadable} from "./../getAppPath";
import {AlignData} from "./../alignData";
export class InputBamFile extends atomic.AtomicOperation
{
public bamPath : string;
public alignData : AlignData;
public inputBamFileProcess : cp.ChildProcess;
constructor()
{
super();
}
public setData(bamPath : string)
{
this.bamPath = bamPath;
}
public run() : void
{
this.closeLogOnFailure = false;
this.closeLogOnSuccess = false;
let self = this;
this.inputBamFileProcess = cp.fork(getReadable("InputBamFile.js"));
self.inputBamFileProcess.on(
"message",function(ev : AtomicOperationForkEvent){
if(ev.finishedSettingData == true)
{
self.inputBamFileProcess.send(
<AtomicOperationForkEvent>{
run : true
}
);
}
if(ev.update == true)
{
self.flags = ev.flags;
if(ev.flags.success == true)
{
self.alignData = ev.data.alignData;
}
if(ev.flags.done)
{
self.logRecord = ev.logRecord;
atomic.recordLogRecord(ev.logRecord);
}
self.progressMessage = ev.progressMessage;
self.update();
}
}
);
setTimeout(
function(){
self.inputBamFileProcess.send(
<AtomicOperationForkEvent>{
setData : true,
data : {
bamPath : self.bamPath
},
name : self.name,
description : "Input Bam File"
}
);
}
);
}
}