Skip to content

3 Adding ESPRESSO experiments together

Joses W. Ho edited this page Aug 20, 2018 · 1 revision

Load different ESPRESSO experiment from different folders

In [1]: expt1 = esp.espresso(folder=path_to_expt1)
In [2]: expt2 = esp.espresso(folder=path_to_expt2)

Examine the experiments

In [3]: expt1
1 feedlog with a total of 30 flies.
3 genotypes ['w1118;Trh-Gal4' 'w1118;UAS-Gz-TrpA1;Trh-Zal' 'Trh-Gal4>UAS-GZ-TrpA1_Trh-ZAL'].
1 temperature [22].
1 foodtype ['5% sucrose + 5% yeast extract'].
In [4]: expt2
1 feedlog with a total of 30 flies.
3 genotypes ['w1118;Trh-Gal4' 'w1118;UAS-Gz-TrpA1;Trh-Zal' 'Trh-Gal4>UAS-GZ-TrpA1_Trh-ZAL'].
1 temperature [29].
1 foodtype ['5% sucrose + 5% yeast extract'].

It is clear that both experiments differ in the temperature used.

Adding the two experiments

Adding ESPRESSO experiments is very easy.

In [5]: combi_expt = expt1+expt2
In [6]: combi_expt
2 feedlogs with a total of 60 flies.
3 genotypes ['w1118;Trh-Gal4' 'w1118;UAS-Gz-TrpA1;Trh-Zal' 'Trh-Gal4>UAS-GZ-TrpA1_Trh-ZAL'].
2 temperatures [22 29].
1 foodtype ['5% sucrose + 5% yeast extract'].

What attributes have changed after addition?

Addition of ESPRESSO objects is redundant

If you add ESPRESSO experiments that contain similar FeedLog-MetaData pairs, this is taken into account. The resulting ESPRESSO object will only have unique feeds and flies/animals; common feeds and flies/animals will only be included once.

In [7]: redundant=expt1+expt1
In [8]: redundant
1 feedlog with a total of 30 flies.
3 genotypes ['w1118;Trh-Gal4' 'w1118;UAS-Gz-TrpA1;Trh-Zal' 'Trh-Gal4>UAS-GZ-TrpA1_Trh-ZAL'].
1 temperature [29].
1 foodtype ['5% sucrose + 5% yeast extract'].