|
|
@@ -25,7 +25,7 @@ const async_exec = (prog, args, onData, onErr) => {
|
|
|
child.on('exit', code => resolve(code));
|
|
|
});
|
|
|
};
|
|
|
-const clusterSam = (input_sam, threshold, minReads) => {
|
|
|
+const clusterSam = (input_sam, threshold, minReads, blackList) => {
|
|
|
return new Promise((resolve, _reject) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
let inputSam = Array.isArray(input_sam) ? input_sam.join(' ') : input_sam;
|
|
|
let lineAcc = '';
|
|
|
@@ -59,11 +59,17 @@ const clusterSam = (input_sam, threshold, minReads) => {
|
|
|
break;
|
|
|
}
|
|
|
});
|
|
|
- if (Array.isArray(byContigs[tmpName])) {
|
|
|
- byContigs[tmpName].push(tmpPos);
|
|
|
+ let add = true;
|
|
|
+ if (blackList) {
|
|
|
+ add = blackList.includes(tmpName) ? false : true;
|
|
|
}
|
|
|
- else {
|
|
|
- byContigs[tmpName] = [tmpPos];
|
|
|
+ if (add) {
|
|
|
+ if (Array.isArray(byContigs[tmpName])) {
|
|
|
+ byContigs[tmpName].push(tmpPos);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ byContigs[tmpName] = [tmpPos];
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}, console.log);
|
|
|
@@ -111,6 +117,7 @@ const clusterSam = (input_sam, threshold, minReads) => {
|
|
|
exports.clusterSam = clusterSam;
|
|
|
/*
|
|
|
(async () => {
|
|
|
- console.log(await clusterSam('/home/thomas/Documents/Programmes/ttest/bwa_mem_splitters_on_HG38_Viral.sam', 333, 55));
|
|
|
+ console.log(await clusterSam('/home/thomas/Documents/Programmes/ttest/bwa_mem_splitters_on_HG38_Viral.sam', 333, 55,
|
|
|
+ ['NR_145819.1', 'NR_145822.1']));
|
|
|
})()
|
|
|
*/
|