Python Programming for Biology: Bioinformatics and Beyond



Download 7,75 Mb.
Pdf ko'rish
bet249/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   245   246   247   248   249   250   251   252   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Array analysis

This final section continues the construction of the Microarray class (so note the relative

indentation  to  the  above  Python  code)  and  moves  from  simple  manipulations  to  a  few

practical analyses. In general we will look at how we can find differences and similarities

in the data. Only a few basic examples will be given, but analyses may be taken further

using ideas discussed in other chapters. Hence we could use microarray data for principal

component analysis (

Chapter 23

) or with machine learning methods (

Chapter 24

).

Differences and similarities

A very simple way of comparing two signal-intensity arrays is to take one away from the

other  and  display  the  resulting  positive  or  negative  values  as  red  and  green  colour

channels. Hence we calculate the array of differences diff:

imgFile = 'examples/RedGreenArray.png'

rgArray = loadArrayImage(imgFile, 'TwoChannel', 18, 17)

diff = rgArray.data[0]-rgArray.data[1]

Then the differences are stored in the first two colour channels, flipping the sign for the

green channel, and the values are clipped at 0.0 to remove any negative values.

rgArray.setChannel(diff, 0)

rgArray.setChannel(-diff, 1)

rgArray.clipBaseline(threshold=0.0, channels=(0,1))

rgArray.makeImage(20).show()

Alternatively we could use the Microarray.combineChannels() function to perform the

comparison.  For  example,  to  illustrate  where  values  on  two  channels  are  similar  we  can

multiply the values, so the result is largest where the values from both channels coincide.

from operator import mul # Multiply

rgArray = loadArrayImage(imgFile, 'TwoChannel', 18, 17)

rgArray.combineChannels(0, 1, combFunc=mul, replace=2)

rgArray.makeImage(20, channels=(2,2,None)).show()





Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   245   246   247   248   249   250   251   252   ...   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