Reduce Bam File With Specific Loci In Bedfile
I want to reduce my bam file, obtaining a new bam file that contain
only loci in the bed file in input like
chr1 30498890 34983248
chr2 30398890 31483248
chr3 10492890 14983248
chr4 30492890 34283248
I try with:
samtools view -L test.bed test.bam | awk '$2 != 4 {print}'
and
intersectBed -abam file.bam -b test.bed
but the source bam file isn't reduce dimension.
How can I do ?
• 2,763 views
•
link
2 answers
Log in to answer this question.