This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Whole genome to whole exome data

I have a whole genome dataset in a bam file and want to convert a whole exome dataset. Which steps I should take?

whole-exome-sequencing whole-genome-sequencing

Do you mean that you have a bam file generated from WGS data and that you want to extract the exonic alignments? If so take a look into intersectBed.

While possible the solution from Pierre Lindenbaum will be much faster as (if the bam is sorted and indexed) samtools will use random access to pull the entries directly whereas intersect first needs to find them manually.

samtools view -M -L exome.bed -O BAM -o out.bam in.bam

This would be a theoretically equivalent dataset not a real exome dataset (since that generally uses capture techology).

0 answers

No answers yet.

Log in to answer this question.