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 --sex '' #41

Closed colindaven closed 6 years ago

colindaven commented 6 years ago

Is it somehow possible to disable the sex chromosome plotting or reporting ? Having worked well on mammals I'd like to apply it to bacteria (for global missing regions detection).

Is that in scope ?

Thanks Colin

brentp commented 6 years ago

yes, just use --sex '' and it will understand. it defaults to --sex X,Y so you have to explicitly give it the empty string.

colindaven commented 6 years ago

Ok, cheers. I tried that before but thought that led to the error.

 goleft_linux64 indexcov -d indexcov --sex '' *.bam 
2018/04/19 17:16:49 indexcov: running on 50 indexes
2018/04/19 17:16:49 sex chromosomes not found.
2018/04/19 17:16:49 got: 0 principal components
2018/04/19 17:16:49 indexcov: 0 principal components, not plotting
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x8fe719]

goroutine 1 [running]:
github.com/brentp/goleft/indexcov.plotBins(0xc42020e1a0, 0x32, 0x32, 0xc420246e00, 0x32, 0x32, 0x0, 0x0, 0x0, 0x0, ...)
        /home/brentp/go/src/github.com/brentp/goleft/indexcov/plot.go:194 +0x5c9
github.com/brentp/goleft/indexcov.writeIndex(0xc4202f4120, 0xc42020e1a0, 0x32, 0x32, 0x0, 0x0, 0x0, 0xc420246e00, 0x32, 0x32, ...)
        /home/brentp/go/src/github.com/brentp/goleft/indexcov/indexcov.go:697 +0x2b1
github.com/brentp/goleft/indexcov.Main()
        /home/brentp/go/src/github.com/brentp/goleft/indexcov/indexcov.go:396 +0x82f
main.main()
        /home/brentp/go/src/github.com/brentp/goleft/cmd/goleft/goleft.go:68 +0x17f
colindaven commented 6 years ago

These are alignments vs only one chromosome, which may be the problem:

@SQ SN:NC_008463.1 LN:6537648

brentp commented 6 years ago

any chance you could share the bam and reference privately?

brentp commented 6 years ago

actually just the bai and anonymized bam and reference. see: https://github.com/brentp/goleft/releases/tag/v0.1.10 to get a program to make a minimal bam.

brentp commented 6 years ago

also, from the lines of your error, it looks like you might have an older version of goleft. can you try the latest version?

colindaven commented 6 years ago

Pretty sure it's the latest release from march 15

 Mar 15 16:17 goleft_linux64*

 ./goleft_linux64 
goleft Version: 0.1.18

covstats   : coverage stats across bams by sampling
depth      : parallelize calls to samtools in user-defined windows
depthwed   : matricize output from depth to n-sites * n-samples
indexcov   : quick coverage estimate using only the bam index
indexsplit : create regions of even coverage across bams/crams
samplename : report samplename(s) from a bam's SM tag
brentp commented 6 years ago

can you share a test-case for this?

brentp commented 6 years ago

thanks for the test-case. you can get past this by using --excludepatt "" since the default is to exclude chromosomes starting with "NC". I have also improved the warning of excluded chromosomes and fixed an associated bug. This will be out in the next release.

colindaven commented 6 years ago

Ok, cheers for letting me know