|
@@ -93,10 +93,13 @@ const clusterSam = (
|
|
|
.sort((a, b) => a.position - b.position)
|
|
.sort((a, b) => a.position - b.position)
|
|
|
.map((e, i, a) => {
|
|
.map((e, i, a) => {
|
|
|
if(i === 0) {
|
|
if(i === 0) {
|
|
|
|
|
+ if(typeof posAll[name] === 'undefined') posAll[name] = {}
|
|
|
firstPos = e.position
|
|
firstPos = e.position
|
|
|
}
|
|
}
|
|
|
|
|
+ if (a.length === 1) {
|
|
|
|
|
+ posAll[name][String(cluster)] = String(firstPos)
|
|
|
|
|
+ }
|
|
|
if (Math.abs(e.position - a[i-1]?.position) > threshold) {
|
|
if (Math.abs(e.position - a[i-1]?.position) > threshold) {
|
|
|
- if(typeof posAll[name] === 'undefined') posAll[name] = {}
|
|
|
|
|
posAll[name][String(cluster)] = firstPos + '-' + a[i-1]?.position
|
|
posAll[name][String(cluster)] = firstPos + '-' + a[i-1]?.position
|
|
|
cluster = cluster + 1
|
|
cluster = cluster + 1
|
|
|
firstPos = e.position
|
|
firstPos = e.position
|
|
@@ -110,7 +113,8 @@ const clusterSam = (
|
|
|
interface byClusters {
|
|
interface byClusters {
|
|
|
[key: string]: string[]
|
|
[key: string]: string[]
|
|
|
}
|
|
}
|
|
|
- let byClusters: byClusters = {}
|
|
|
|
|
|
|
+ let byClusters: byClusters = {}
|
|
|
|
|
+
|
|
|
Object.keys(byReads).map(rname => {
|
|
Object.keys(byReads).map(rname => {
|
|
|
const tmpClusterName = byReads[rname].sort().map(e => {
|
|
const tmpClusterName = byReads[rname].sort().map(e => {
|
|
|
const splited = e.split(/@/)
|
|
const splited = e.split(/@/)
|