svtyper icon indicating copy to clipboard operation
svtyper copied to clipboard

bamfile without index

Open btoe opened this issue 5 years ago • 3 comments

Hi I'm trying to run SVTyper on the vcf file I got after running Lumpyexpress. Here is the code that I am using:

svtyper
-i sv.vcf
-B sample.bam
-l sample.bam.json
> sv.gt.vcf I keep getting this error code: ValueError: fetch called on bamfile without index.

Am I suppose to index the bam file that came out of BWA-MEM? I am using svtyper 0.6.0. and pysam 0.15.0. I was also wondering if its required to run svtyper on the Lumpyexpress vcf file or if its an optional step.

Thank you for your help!

btoe avatar Aug 10 '18 02:08 btoe

Yes, an index for your BAM file is required.

I believe if you ran Lumpyexpress with -g then SVTyper is run for you and you shouldn't need to run it a second time. Otherwise, we would recommend running SVTyper on the VCF from Lumpy.

ernfrid avatar Aug 10 '18 15:08 ernfrid

Thank you so much for the response! So I ran svtyper using the indexed bam file and now I get a new error code:

Error: failed to build insert size histogram for paired-end reads. Please ensure BAM file (sample.bam) has inward facing, paired-end reads

I used this code from Lumpy github to align my data:

Align the data

bwa mem -R "@RG\tID:id\tSM:sample\tLB:lib" human_g1k_v37.fasta sample.1.fq sample.2.fq
| samblaster --excludeDups --addMateTags --maxSplitCount 2 --minNonOverlap 20
| samtools view -S -b -
> sample.bam

Thank you!!!!

btoe avatar Aug 11 '18 06:08 btoe

The error seems to indicate that svtyper is having trouble finding enough paired-end reads to build an insert size distribution. Since you're obviously aligning paired reads, I'd check that the order of the two files is the same, they contain the same number of reads and, in the event that you were creating these from an aligned BAM/CRAM, that they've been reverse complemented appropriately when converted back to unaligned data.

ernfrid avatar Aug 26 '18 14:08 ernfrid