How to convert bia file to tsv file
2
0
Entering edit mode
@engryahya602-7735
Last seen 9.5 years ago
Pakistan

i indexed bam file with command

samtools index o_sorted.bam

and it has extension of .bia ..now i want to convert it in to tsv format how to do this.i searched it on INTERNET but cant find any helpful answer

samtools bioinformatics • 2.8k views
ADD COMMENT
0
Entering edit mode

What information, specifically, are you trying to get into tsv format?  The .bai file contains no useful information in a tsv format.

ADD REPLY
1
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

The index file contains information that is not easily or usefully represented in tab separated value format; see section 5.2 of the SAM specification for details on the bai format. You could get a text representation of a bam file with Rsamtools::asSam() or at the command line using samtools view. Maybe you want to read in specific sequences; use GenomicAlignments::readGAlignments() with the 'param' argument specifying range, or use samtools view at the command line.

ADD COMMENT
0
Entering edit mode

Thanks .it would be nice if you write the complete command..like if i wanted to get text representation of 0.bam what will be the full command.

ADD REPLY
1
Entering edit mode

I guess you are interested in the R / Bioconductor command, since this is a Bioconductor help forum. I guess also that you have installed the Rsamtools package

source("http://bioconductor.org/biocLite.R")
biocLite("Rsamtools")

Load the Rsamtools library

library(Rsamtools)

and look at the help page for asSam()

?asSam

It says that you can make a BAM file into a SAM file by specifying the BAM file name, and the destination name. On _my_ computer I might write

asSam("/home/mtmorgan/tmp/0.bam", "/home/mtmorgan/tmp/0.sam")

On windows I would probably have file paths like "c:/Users/mtmorgan/Documents/0.bam".

Since BAM files are very large, it is not helpful to do this.

ADD REPLY
0
Entering edit mode

i want to convert bam file to tsv format not to sam..Rsamtools is already installed..i want that data in tsv formate so that i can export to excel later.

ADD REPLY
1
Entering edit mode

SAM format is tab-separated.  

ADD REPLY
0
Entering edit mode
@engryahya602-7735
Last seen 9.5 years ago
Pakistan

how to convert the .bai file format to the .tsv (Tap Seperated file) format

ADD COMMENT

Login before adding your answer.

Traffic: 614 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6