Python Programming for Biology: Bioinformatics and Beyond


D gel peak-picking example



Download 7,75 Mb.
Pdf ko'rish
bet298/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   294   295   296   297   298   299   300   301   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

2D gel peak-picking example


We  provide  a  simple  application  of  using  the  peak  picker  to  find  extrema  in  an  image,

which in this case represent spots on a polyacrylamide protein gel. Naturally, this data was

not  recorded  as  a  signal  that  required  transformation  into  the  frequency  domain,  but

nonetheless  it  is  a  biologically  relevant  test  case  and  is  analogous  to  signals  we  might

observe  in  a  frequency  spectrum.  The  example  will  use  some  of  the  functionality

discussed  in

Chapter  18

 to  convert  between  the  Image  objects  made  by  the  Python

Imaging Library (PIL) and numeric arrays.

from PIL import Image

from Images import imageToPixmapRGB, pixmapToImage

img = Image.open('examples/Gel2D.png')

pixmap = imageToPixmapRGB(img)

The RGB (three-component-deep) image is averaged along the last axis, to generate a

simple array of values of the same size representing the pixel intensity. This is normalised

to  be  between  0  and  1  by  taking  away  the  baseline  minimum  and  dividing  by  the

maximum. Because in the image the spots we want to pick are darker than the background

we flip the data array (1.0 – data)  so  that  the  spots  to  pick,  and  not  the  background,  are

points of maximum intensity.

data = pixmap.mean(axis=2)

data -= data.min()

data /= data.max()

data = 1.0 – data

The peak picking threshold is simply defined as a proportion of the maximum intensity

(which  here  is  1.0)  and  then  the  findPeaks()  function  defined  above  is  used  to  find  the

peak locations in the data using a size which is appropriate to the scale of the peaks in the

image.

threshold = 0.3 * data.max()



peaks = findPeaks(data, threshold, size=7, mode='wrap')



Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   294   295   296   297   298   299   300   301   ...   514




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish