Biostar Beta. Not for public use.
checking for cram to bam conversion syntax using samtools
Entering edit mode
18 months ago
ricfoz • 30
National School of Antropology and Hist…

Hello everyone,

I am trying to retreive some genic regions from a .cram file, i know the workflow starting with .bam files, so i want to convert some whole low coverage genomes from cram to bam

I have been reading the manual and some how-to blogs, but i haven't come with a correct syntax to make the tool run and make the bams i need.

I know the syntax must have the reference genome in order to make the cram file readable, so i tried the next syntax:

samtools view -b <file.cram> <refgenome.fa> -o <file.bam>

it outputs the next error flag:

[main_samview] region "refgenome.fa" specifies an unknown reference name. Continue anyway.

and it does not build a usable .bam file, the flag is really straightforward, but i am sure that the reference genome i am using is correct, i think it is something about the syntax, i am using the -b flag at the beginning given the fact that i want an output file in bam format.

Any suggestions?, any help would be much appreciated!

Entering edit mode
15 months ago
France/Nantes/Institut du Thorax - INSE…
samtools view -b  -T <refgenome.fa> -o <file.bam> <file.cram>
Entering edit mode

alright, the flag -T is used in order to build an index for the fasta file right?, just, in order to get the grip on the syntax, you write first the .bam file, and the .cram file next, since i am trying to convert cram to bam, wouldn't it have to be the other way around?

Entering edit mode

CRAM doesn't store all the base in the file, you need a reference fasta file to retrieve the bases.


Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.3