Thomas 3 år sedan
förälder
incheckning
968beae173
3 ändrade filer med 6 tillägg och 0 borttagningar
  1. 1 0
      .gitignore
  2. 2 0
      index.js
  3. 3 0
      index.ts

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+node_modules

+ 2 - 0
index.js

@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
     });
 };
 Object.defineProperty(exports, "__esModule", { value: true });
+exports.clusterSam = void 0;
 const child_process_1 = require("child_process");
 /* (c) Thomas Steimlé 2022
  * cat bwa_mem_splitters_on_HG38_Viral.sam | awk '$0~/^@/{next}{lxa=split($0,xa,"XA:Z:"); print $1"\t"$3"\t"$4; if(lxa>1){split(xa[2],xap,","); print $1"\t"xap[1]"\t"substr(xap[2],2)"\tXA"}}' | more
@@ -89,6 +90,7 @@ const clusterSam = (input_sam, threshold, minReads) => {
         resolve((Object.keys(byClusters).map(clusterName => ({ clusterName, rname: byClusters[clusterName] })).sort((a, b) => b.rname.length - a.rname.length)));
     }));
 };
+exports.clusterSam = clusterSam;
 /*
 (async () => {
     console.log(await clusterSam('/home/thomas/Documents/Programmes/ttest/bwa_mem_splitters_on_HG38_Viral.sam', 333, 55));

+ 3 - 0
index.ts

@@ -104,6 +104,9 @@ const clusterSam = (
             resolve((Object.keys(byClusters).map(clusterName => ({clusterName, rname: byClusters[clusterName]})).sort((a:any,b:any) => b.rname.length - a.rname.length)) )
     })
 }
+
+export { clusterSam }
+
 /*
 (async () => {
     console.log(await clusterSam('/home/thomas/Documents/Programmes/ttest/bwa_mem_splitters_on_HG38_Viral.sam', 333, 55));