Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not fetching all reads #43

Closed
cmdcolin opened this issue Oct 1, 2019 · 1 comment
Closed

Not fetching all reads #43

cmdcolin opened this issue Oct 1, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@cmdcolin
Copy link
Collaborator

cmdcolin commented Oct 1, 2019

A small region of a pacbio bam file by samtools contains 34 reads

% node index.jscdiesh-Precision-7540% samtools view https://s3.amazonaws.com/jbrowse.org/genomes/hg19/pacbio/m64011_181218_235052.8M.HG002.hs37d5.11kb.bam 1:10000-10600|wc
34 771 777929

By a small script we get less

const fetch = require( 'cross-fetch');

const {RemoteFile} = require('generic-filehandle')
const {BamFile} = require('@gmod/bam')

const b = new BamFile({
>       bamFilehandle: new RemoteFile('https://s3.amazonaws.com/jbrowse.org/genomes/hg19/pacbio/m64011_181218_235052.8M.HG002.hs37d5.11kb.bam', {fetch}),
>       baiFilehandle: new RemoteFile('https://s3.amazonaws.com/jbrowse.org/genomes/hg19/pacbio/m64011_181218_235052.8M.HG002.hs37d5.11kb.bam.bai', {fetch} )
});

(async () => {
>       await b.getHeader()
>       const ret = await b.getRecordsForRange('1',9999,10600)
>       console.log(ret.length)
})()

//outputs 12

git bisect narrows down squarely to #36

Removing the final vestige of the chunk merging code makes this problem go away for the most part, but actually returns 37 reads instead of 34

https://github.com/GMOD/bam-js/tree/remove_more_chunk_merging

Will need to make it match up to par with what samtools returns

@cmdcolin cmdcolin added this to To do in JBrowse team board via automation Oct 1, 2019
@cmdcolin cmdcolin added the bug Something isn't working label Oct 1, 2019
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Oct 1, 2019

Fixed by #44

@cmdcolin cmdcolin closed this as completed Oct 1, 2019
JBrowse team board automation moved this from To do to Done Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant