-
Notifications
You must be signed in to change notification settings - Fork 2
/
testHPV18Index.ts
31 lines (31 loc) · 1.23 KB
/
testHPV18Index.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
import * as atomic from "./../operations/atomicOperations";
import {IndexFastaForBowTie2Alignment} from "../operations/indexFastaForBowTie2Alignment";
import * as hpv18Ref from "./hpv18Ref";
export async function testHPV18Index() : Promise<void>
{
return new Promise<void>((resolve,reject) => {
atomic.updates.removeAllListeners().on("indexFastaForBowTie2Alignment",function(op : IndexFastaForBowTie2Alignment){
if(op.flags.failure)
{
console.log(`Failed to index ${op.fasta.alias}`);
return reject();
}
else if(op.flags.success)
{
if(hpv18Ref.get().indexed)
console.log(`${op.fasta.alias} was indexed`);
else
return reject();
if(hpv18Ref.get().contigs.length == 1)
console.log(`${op.fasta.alias} has correct number of contigs`);
else
return reject();
if(hpv18Ref.get().contigs[0].bp == 7857)
console.log(`${op.fasta.alias} has correct base pairs`);
else
return reject();
return resolve();
}
});
});
}