You can read several files at the same time using the merger module. But for now, we will read only a single file.
Reading a CSV file and get descriptive information about the mass spec data using the module msdas.readers.MassSpecReader
In [1]:
from msdas import *
from msdas import yeast
%pylab inline
Here are some files to play with. These are 6 files that should be merger. However, we can read them one by one for demonstration.
In [2]:
y = MassSpecReader(yeast.get_yeast_small_data())
Calling the print function allows to get some basic information about the number of rows/protein/peptides
In [3]:
print(y)
The data is contained in the data frame called df. Aliasese (read-only) to the measurements only, or to the metadata only are available in the dataframs called measurements and metadata respectively.
In [4]:
y.df.ix[[0,1,2]]
Out[4]:
In [5]:
y.measurements.ix[[0,1,2]]
Out[5]:
In [6]:
y.metadata.ix[[0,1,2]]
Out[6]:
In [7]:
y.plot_phospho_stats()
In [8]:
y.hist_peptide_sequence_length()
In [9]:
y.boxplot() # variation in each experiment
In [10]:
y.plot_timeseries('DIG1_S272')
Out[10]:
In [11]:
y.plot_experiments("DIG1_S272")
Out[11]:
In [12]:
y2 = readers.MassSpecReader(y, verbose=False)
In [13]:
y2 == y
Out[13]:
In [14]:
y3 = readers.MassSpecReader(verbose=True)
filename = yeast.get_yeast_small_data()
y3.read_csv(filename)
In [15]:
y3 == y
Out[15]:
Here, the data read using the function read_csv seems to be different. Indeed, when reading a file normally, the cleanup function is called automatically. So, you have to call the cleanup function manually:
In [16]:
y3.cleanup()
In [17]:
y3 == y
Out[17]:
In [ ]: