I have ChIP-seq bam files from two contrasting conditions. I have a bed file with a pre-defined list of chromosome positions. I wish to have the boxplots for the intensities for the predefined positions. How can I go about it ?
BAM files contain no quantitative information since every entry corresponds to an individual read, its sequence and its location in the genome. In order to compare the number of reads between different regions, you will need to count the number of reads per region in the BED file. It also won't hurt to normalize for differences in sequencing depths between the conditions.
There are various tools available to achieve your goal, it depends a bit on how good you are with command line tools and/or R.
A completely R-based solution for counting reads over defined regions can be found within the DiffBind package, which can be found at bioconductor (check out their vignette!).
the bedtools suite, particularly the coverage tool will also allow you to supply a BAM and BED files to obtain (non-normalized) read counts.
the deepTools collection of tools would enable you to either summarize the reads across the BED file directly from a BAM file (multiBamSummary), or, if you want to normalize, I would recommend to first run bamCoverage followed by multiBigWigSummary. You could also supply a scaling factor to account for seq. depth differences directly to multiBamSummary, though.