Question: Regarding reads extract from bam file
gravatar for DL
4 months ago by
DL0 wrote:


Can anyone tell me that how can i get information of aligned reads using reads name from bam file. I want to extract some specific IDs (stored in a file) from bam file. I found that samtools is solution using samtools view file.bam | fgrep -w -f IDs.txt. This command takes lot of time. Can anyone tell me easy and fast method to extract IDs information from bam file.

Thanks in advance

ADD COMMENTlink modified 4 months ago by Jennifer Hillman Jackson25k • written 4 months ago by DL0
gravatar for Jennifer Hillman Jackson
4 months ago by
United States
Jennifer Hillman Jackson25k wrote:


Use a combination of Samtools. Picard, and Text Manipulations tools.

Filter the SAM/BAM for aligned reads, then convert BAM to SAM (if needed, the goal is to exclude the header. From there you can pull out the sequence identifiers and sort them uniquely or count up hits per read, etc. If you want the reads in fastq format, BAM/SAM to fastq can be used. Once you have a process worked out, there is an option to extract a workflow and run all the tools later in batch mode (will behave like a custom tool).

Please note that workflows are problematic today but this should be cleared up quickly and does not impact directly running tools. Details here:

Galaxy tutorials:

Thanks! Jen, Galaxy team

ADD COMMENTlink written 4 months ago by Jennifer Hillman Jackson25k
Please log in to add an answer.


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