racon icon indicating copy to clipboard operation
racon copied to clipboard

bam for consensus

Open jdmontenegro opened this issue 6 years ago • 15 comments

Hi,

Does racon accepts bam files instead of sam files for the consensus calculation or do we need convert bam to sam in order to use it?

Cheers,

jdmontenegro avatar Jan 04 '18 00:01 jdmontenegro

Hello, sorry for the late response! Unfortunately, Racon only accepts SAM as alignment input. We will add BAM support in the new release.

Best regards, Robert

rvaser avatar Jan 13 '18 13:01 rvaser

Hi,

thank you for the nice software! I understand that one of the focal points currently appears to be in accelerating racon using the GPU 👍

Nevertheless, I was wondering whether there has been any progress made on the BAM support already? I could not find anything related in the Changelogs of the Releases, so I am keeping my hopes low ;)

Best,

Cedric

claczny avatar Aug 08 '19 05:08 claczny

Hi Cedric, unfortunately no BAM support was added yet.

Best regards, Robert

rvaser avatar Aug 08 '19 05:08 rvaser

I see and thanks for the quick reply!

Unfortunately, piping in the SAM file (as in https://github.com/isovic/racon/issues/9#issuecomment-275067339) appears to not be a solution either, as I get

[racon::createPolisher] error: file - has unsupported format extension (valid extensions: .mhap, .mhap.gz, .paf, .paf.gz, .sam, .sam.gz)!

I tried piping (samtools view -h alignment.bam draft.fna | racon reads.fastq - draft.fna) as well as process substitution (racon reads.fastq <(samtools view -h alignment.bam) draft.fna), both yielding the above error.

claczny avatar Aug 08 '19 06:08 claczny

Piping was removed since version 1.0.0.

rvaser avatar Aug 08 '19 06:08 rvaser

That is good to know, albeit a bit sad :) I'll then just create a temporary SAM file from the BAM file. Should be fine too ;)

Thanks a lot!

Best,

Cedric

claczny avatar Aug 08 '19 06:08 claczny

Either reading BAM or piping SAM from samtools view is useful to me.

sjackman avatar Jun 03 '20 16:06 sjackman

I'll try to add it in the next refactor.

rvaser avatar Jun 03 '20 17:06 rvaser

I also use GZIP compressed SAM a fair bit, but BAM would be sufficient.

sjackman avatar Jun 03 '20 17:06 sjackman

Gziped SAM files are supported, but without piping.

rvaser avatar Jun 03 '20 17:06 rvaser

Accidentally pushed the wrong button :D

rvaser avatar Jun 03 '20 17:06 rvaser

Gziped SAM files are supported, but without piping.

Good to know!

sjackman avatar Jun 03 '20 17:06 sjackman

All formats that Racon accepts can be gziped.

rvaser avatar Jun 03 '20 18:06 rvaser

Gzipped BAM file? 😈 (just kidding, please don't)

sjackman avatar Jun 03 '20 18:06 sjackman

Actually a little-known fact that I've actually found really useful is that a BAM file is a gzip file. You can gunzip -c a BAM file to get an uncompressed BAM file. gunzip -c alignments.bam | samtools view works as expected.

sjackman avatar Jun 03 '20 19:06 sjackman