Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
starting to add doc of new mqlive version
- Loading branch information
1 parent
c0e02c8
commit b5314fc
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pandas as pd | ||
import sys | ||
from scipy import * | ||
from scipy import ndimage | ||
from numpy import * | ||
from pylab import * | ||
|
||
def isfloat(value): | ||
try: | ||
float(value) | ||
return True | ||
except ValueError: | ||
return False | ||
|
||
|
||
def parseLogFile(fName): | ||
fl = open(fName) | ||
data = [i.split()[3:] for i in fl.readlines() if i.find("PEPTIDE_FOUND_MS1") != -1] | ||
data = [["rt:", i[0]] + i[2:] for i in data] | ||
fl.close() | ||
|
||
keys, idz, values = [], [], [] | ||
for c, s in enumerate(data[0]): | ||
if (s[-1] == ":"): keys.append(s.replace(":", "")) | ||
|
||
for s in data: | ||
v = [] | ||
for c, i in enumerate(s): | ||
if (i[-1] == ":"): v.append(s[c + 1]) | ||
if (len(v) == len(keys)): values.append(v) | ||
|
||
values = [[float(v) if isfloat(v) else v for v in val] for val in values] | ||
|
||
peptides = pd.DataFrame(values, columns=keys) | ||
peptideLengths = peptides.groupby('id')['rt'].max() - peptides.groupby('id')['rt'].min() | ||
|
||
peptides = peptides.loc[peptides.groupby('id')['intensity'].idxmax()] | ||
peptides['length'] = peptideLengths.values | ||
|
||
return peptides.sort_values('rt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.