Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 20, 2021
1 parent 0604422 commit 9ae8113
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class BamSlightlyLazyFeature implements Feature {
return md
}

qualRaw(): number[] {
qualRaw(): Buffer | undefined {
return this.record.qualRaw()
}

Expand Down
9 changes: 5 additions & 4 deletions plugins/alignments/src/BamAdapter/MismatchParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function parseCigar(cigar: string) {
export function cigarToMismatches(
ops: string[],
seq: string,
qual?: number[],
qual?: Buffer,
): Mismatch[] {
let currOffset = 0
let seqOffset = 0
Expand Down Expand Up @@ -97,7 +97,7 @@ export function mdToMismatches(
cigarOps: string[],
cigarMismatches: Mismatch[],
seq: string,
qual?: number[],
qual?: Buffer,
): Mismatch[] {
const mismatchRecords: Mismatch[] = []
let curr: Mismatch = { start: 0, base: '', length: 0, type: 'mismatch' }
Expand Down Expand Up @@ -176,7 +176,8 @@ export function mdToMismatches(
}
const s = cigarOps ? getTemplateCoordLocal(curr.start) : curr.start
curr.base = seq ? seq.substr(s, 1) : 'X'
curr.qual = qual ? qual.slice(s, s + 1)[0] : 'X'
const qualScore = qual?.slice(s, s + 1)[0]
if (qualScore) curr.qual = qualScore
curr.altbase = token
nextRecord()
}
Expand Down Expand Up @@ -207,7 +208,7 @@ export function getMismatches(
cigarString: string,
mdString: string,
seq: string,
qual?: number[],
qual?: Buffer,
): Mismatch[] {
let mismatches: Mismatch[] = []
let cigarOps: string[] = []
Expand Down
Loading

0 comments on commit 9ae8113

Please sign in to comment.