[Biopython] histogram plot of insert size

Mic mictadlo at gmail.com
Fri Feb 17 05:13:31 EST 2012


Hi Cittaro,
Thank you for your solution. I run fixmate from samtools on a BAM file:
HWI-ST226_0154:4:1206:12773:170407#CTTGTA 73 A_01a 1046 30 100M * 0 0
AGTATAAAACTAAGCAAACTGTTAGAACTTTGATTACGTTTTGTTTATCAGTGATACGCAAAAGTTTAAGATCCTTGAGTACCTCTTTCGATGGCGGATT
fdfffdfffbddaec_dSc^ddd^dQc^`Udddad_`c^^ac`R_NV\\]T^c`T_Mc]aV[V\R`Xa^^EKIIVcccc`YNY]UV[U`BBBBBBBBBBB
NM:i:1 MD:Z:73T26

I just wonder which column I have to take to fill isize_array?

Thank you in advance.


On Fri, Feb 17, 2012 at 7:07 PM, Cittaro Davide <cittaro.davide at hsr.it>wrote:

>
> On Feb 17, 2012, at 7:39 AM, Mic wrote:
>
> > Hi all,
> > How is it possible to create histogram plot of insert size with
> pysam/Biopython?
>
> As far as you have some plotting library yes.
> Take a look to matplotlib and try this:
>
> import matplotlib.pyplot as plt
>
> f = plt.figure()
> h = f.add_subplot(111)
> h.hist(isize_array, bins=50, normed=True)
> f.savefig('myhist.pdf', format='pdf')
>
> assuming isize_array is your array/list of insert sizes
>
> d
> /*
> Davide Cittaro, PhD
>
> Head of Bioinformatics Core
> Center for Translational Genomics and Bioinformatics
> San Raffaele Scientific Institute
> Via Olgettina 58
> 20132 Milano
> Italy
>
> Office: +39 02 26439140
> Mail: cittaro.davide at hsr.it
> Skype: daweonline
> */
>
>
>
>
>
>
>
>
>
>
>


More information about the Biopython mailing list