I have BAM files in the external hard drive. Want to convert them into BED. Am using
cd /media/amit/LaCie/mdc_work/chigozie/pool1/bam
for x in *.bam ; do
echo "print current:$x";
bedtools bamToBed -i "$x" > "${x%.bam}.bed";
done
echo "done"
it writes the BED files in the directory, but they are all empty. My BEDtools is installed in
/home/amit/miniconda3/bin/bedtools
Can someone tell me where I am going wrong? regards.
Empty
bedfiles could be caused bybamfiles with no reads. Thebamfiles could still have non-zero file size due to headers. Find the number of reads in thebamfile usingsamtools:or
sambamba:This should output into STDIN the number of reads in the
bamfile. Both of these could be installed usingconda, for example like so: