This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Truncating BAM Files

Hello,

I am trying to create a smaller BAM file from the original BAM file. The smaller BAM file should have info on only about 10 loci.

Can I not just append the mpileup() output of the region of interest to the header (samtools view -H <bam>)?

Any pointers on how I can accomplish this would be appreciated!

Thanks

bam sam rna-seq samtools pysam

Sorry, but I don't have a .bed file. Just a BAM.

Pierre meant a bam file, not a bed one. Notice he uses samtools view

I executed the following but I get no output.

echo "Chr1:3631-5899" > test.bed
samtools view accepted_hits.bam -L test.bed

That's not a bed file. echo -e "Chr1\t3631\t5899" > test.bed would make a valid BED file.

0 answers

No answers yet.

Log in to answer this question.