brentp / goleft

goleft is a collection of bioinformatics tools distributed under MIT license in a single static binary
MIT License
216 stars 25 forks source link

indexcov: "panic: sam: malformed header line" #44

Closed lindenb closed 6 years ago

lindenb commented 6 years ago

Hi, an issue similar to https://github.com/brentp/goleft/issues/33 ?

I got the following message for indexcov :

panic: sam: malformed header line: line 89: "@PG\tID:bwa\tPN:bwa\tVN:0.7.12-r1039\tCL:/commun/data/packages/bwa/bwa-0.7.12/bwa mem -t 10 -M -H @CO\t20180608.isidor.: Mapping de bams pour BI/ CHU-Nantes. Les Bams viennent de xxxx@xxx-xxxxx.org  -R @RG\\tID:18D0609\\tLB:18D0609\\tSM:18D0609\\tPL:illumina\\tCN:Nantes /commun/data/pubdb/broadinstitute.org/bundle/1.5/b37/index-bwa-0.7.12/human_g1k_v37.fasta /mnt/beegfs/lindenb/WORK/2018/20180607.XXX.YY/FASTQS/18D0609_S1_R1_001.fastq.gz /mnt/beegfs/lindenb/WORK/2018/20180607.XX.YY/FASTQS/18D0609_S1_R2_001.fastq.gz"

goroutine 24 [running]:
github.com/brentp/goleft/indexcov.readIndex(0x7fffffffda38, 0x76, 0x39, 0xc4204d81e0, 0xc421e88590, 0x5, 0x35)
    /home/brentp/go/src/github.com/brentp/goleft/indexcov/indexcov.go:460 +0x6ba
github.com/brentp/goleft/indexcov.Main.func1(0xc4201627e0, 0xc4200c1c00, 0x3a, 0x3a, 0xc42028a000, 0x3a, 0x3a, 0xc420229340)
    /home/brentp/go/src/github.com/brentp/goleft/indexcov/indexcov.go:365 +0x8a
created by github.com/brentp/goleft/indexcov.Main
    /home/brentp/go/src/github.com/brentp/goleft/indexcov/indexcov.go:363 +0x386

$ ./goleft -v
goleft Version: 0.1.19

samtools view -c 18D0609.bam works fine

brentp commented 6 years ago

can you share the full header?

lindenb commented 6 years ago

@brentp sure , thanks !

(later: removed because there is an e-mail in the header)

lindenb commented 6 years ago

I'm closing this as I can easily & quickly reformat the bam header ( ref : https://twitter.com/brent_p/status/1007759165874302976 )

thanks

brentp commented 6 years ago

probably it's apparent, but i forgot the -b in the samtools view call in the tweet. You'll need that to make sure it's bam.