Question: Write python code A. Read file1.txt and file2.txt into two pandas data frames B. Merge both data frames by gene name C. Calculate the mean
Write python code
A. Read file1.txt
and file2.txt
into two pandas data frames
B. Merge both data frames by gene name
C. Calculate the mean for each gene (row) and each sample (column)
D. Generate a figure with two box plots (showing distribution of each sample)
content of file 1
Gene_name Sample1 ENSG00000223972 0.05445 ENSG00000241860 0.1574 ENSG00000222623 0.4466 ENSG00000241599 0.1016 ENSG00000228463 0.3749 ENSG00000237094 0.13 ENSG00000250575 0.5379 ENSG00000233653 0.09478 ENSG00000224813 0 ENSG00000229376 0.0947 ENSG00000230092 1.285 ENSG00000269831 0 ENSG00000240453 0 ENSG00000177757 0.7239
content of file 2
Gene_name Sample2 ENSG00000223972 0.02398 ENSG00000227232 10.68 ENSG00000243485 0.1066 ENSG00000237613 0.06713 ENSG00000268020 0.1296 ENSG00000240361 0.08706 ENSG00000186092 0.1337 ENSG00000238009 0.2984 ENSG00000233750 0.2827 ENSG00000237683 17.15 ENSG00000268903 2.2 ENSG00000239906 1.9 ENSG00000241860 0.4425 ENSG00000222623 0 ENSG00000241599 0.08953 ENSG00000228463 0.6369
Transcribed image text
Step by Step Solution
There are 3 Steps involved in it
To complete the task follow the steps outlined below python import pandas as pd import matplotlibpyplot as plt A Read file1txt and file2txt into two p... View full answer
Get step-by-step solutions from verified subject matter experts
