-
Notifications
You must be signed in to change notification settings - Fork 10
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
Qual not right after query() method #5
Comments
Hi, can you explain the problem in more detail? I am not following. |
I see. It seems that we must change here: https://github.com/brentp/irelate/blob/master/parsers/bam.go#L96 to:
it's been a while since I've done much go, but something like that should work. |
thanks. |
Looks like it needs to go here as well: https://github.com/brentp/irelate/blob/master/parsers/bam.go#L215 |
both changed in bam.go, also no work. |
If I understand correctly, this is a consequence of this change in biogo/hts Perhaps it would be useful to have a |
I'm surprised this doesn't show up in tests. @suyanan can you make a BAM available that has those two reads in it (preferably only those two reads and the necessary SQ headers)? I'd rather not depend on a user making a clone, that is just asking for problems, but I can do use some more care when sharing a buffer. |
Is there a test that keeps a read in memory and then reads the next from the bam? If not, I can write one in the next couple days. |
Yeah, I imagine not. The plan for the fix is to keep track of whether a new buffer was allocated, and only copy the Qual if it wasn't. This should fix the issue, but I'd like a test case. |
OK. I have a presumptive fix, but I need a test. |
@suyanan Would you please test your code with a
|
package main
import (
"github.com/biogo/hts/bam"
"fmt"
"log"
"os"
)
func main() {
f, err := os.Open("x.bam")
if err != nil {
log.Fatalf("couldn't open file: %q", err)
}
defer f.Close()
b, err := bam.NewReader(f, 1)
if err != nil {
log.Fatalf("couldn't read bam: %q", err)
}
defer b.Close()
recA, err := b.Read()
if err != nil {
log.Fatalf("couldn't read first record: %q", err)
}
fmt.Fprintf(os.Stderr, "%q\n", recA.Qual)
_, err = b.Read()
if err != nil {
log.Fatalf("couldn't read second record: %q", err)
}
fmt.Fprintf(os.Stderr, "%q\n", recA.Qual)
} with bam (converted to sam of):
|
Thank you very much. I just read this, its no nessesary replying bam. |
irelate/parsers/bam.go
Line 166 in 1bf7c8f
while this method running, first record from it.Next() then Read() method will write to interfaces.Relatable channel[0]index. Then second record also will write to interfaces.Relatable channel[1] index and update its Record.Qual, but which will unexpectedly update the Record.Qual value in nterfaces.Relatable channel[0]index.
Finally, the bam record's name and pos not coresponding to Qual.
The text was updated successfully, but these errors were encountered: