@gmod/bam
Version:
Parser for BAM and BAM index (bai) files
74 lines (73 loc) • 2.58 kB
TypeScript
interface Bytes {
start: number;
end: number;
byteArray: Uint8Array;
}
export default class BamRecord {
#private;
fileOffset: number;
private bytes;
constructor(args: {
bytes: Bytes;
fileOffset: number;
});
get byteArray(): Uint8Array<ArrayBufferLike>;
get flags(): number;
get ref_id(): number;
get start(): number;
get end(): number;
get id(): number;
get mq(): number | undefined;
get score(): number | undefined;
get qual(): Uint8Array<ArrayBufferLike> | undefined;
get strand(): 1 | -1;
get b0(): number;
get name(): string;
get tags(): Record<string, unknown>;
/**
* @returns {boolean} true if the read is paired, regardless of whether both
* segments are mapped
*/
isPaired(): boolean;
/** @returns {boolean} true if the read is paired, and both segments are mapped */
isProperlyPaired(): boolean;
/** @returns {boolean} true if the read itself is unmapped; conflictive with isProperlyPaired */
isSegmentUnmapped(): boolean;
/** @returns {boolean} true if the read itself is unmapped; conflictive with isProperlyPaired */
isMateUnmapped(): boolean;
/** @returns {boolean} true if the read is mapped to the reverse strand */
isReverseComplemented(): boolean;
/** @returns {boolean} true if the mate is mapped to the reverse strand */
isMateReverseComplemented(): boolean;
/** @returns {boolean} true if this is read number 1 in a pair */
isRead1(): boolean;
/** @returns {boolean} true if this is read number 2 in a pair */
isRead2(): boolean;
/** @returns {boolean} true if this is a secondary alignment */
isSecondary(): boolean;
/** @returns {boolean} true if this read has failed QC checks */
isFailedQc(): boolean;
/** @returns {boolean} true if the read is an optical or PCR duplicate */
isDuplicate(): boolean;
/** @returns {boolean} true if this is a supplementary alignment */
isSupplementary(): boolean;
get cigarAndLength(): {
length_on_ref: number;
CIGAR: string;
};
get length_on_ref(): number;
get CIGAR(): string;
get num_cigar_ops(): number;
get read_name_length(): number;
get num_seq_bytes(): number;
get seq(): string;
get pair_orientation(): string | undefined;
get bin_mq_nl(): number;
get flag_nc(): number;
get seq_length(): number;
get next_refid(): number;
get next_pos(): number;
get template_length(): number;
toJSON(): Record<string, any>;
}
export {};