Question: checking for cram to bam conversion syntax using samtools
0
gravatar for ricfoz
2.1 years ago by
ricfoz30
National School of Antropology and History, Mexico city, Mexico
ricfoz30 wrote:

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!

ADD COMMENTlink modified 2.1 years ago by Pierre Lindenbaum131k • written 2.1 years ago by ricfoz30
2
gravatar for Pierre Lindenbaum
2.1 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum131k wrote:
samtools view -b  -T <refgenome.fa> -o <file.bam> <file.cram>
ADD COMMENTlink modified 2.1 years ago • written 2.1 years ago by Pierre Lindenbaum131k

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?

ADD REPLYlink written 2.1 years ago by ricfoz30
1

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

ADD REPLYlink written 2.1 years ago by Pierre Lindenbaum131k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1270 users visited in the last hour