forked from yishi-lab/AugurLlama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExperiment.py
31 lines (26 loc) · 1.32 KB
/
Experiment.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from Base import *
from Config import Param
class Experiemnt(object):
def __init__(self,identification_file:str, raw_ms_file:str,fragment_spectra_folder:str,index:int, condition: int):
'''
:param identification_file: PSMs file generated by Proteome Discoverer
:param raw_ms_file: Thermo RAW file
:param index: index num
:param condition: [0,1,2] from mild to harsh
'''
if not verify_file_path(identification_file):
raise FileNotFoundError( "{} does not exists".format(identification_file))
self.peptide_identification_file = identification_file
self.fragment_spectra_folder = os.path.join(fragment_spectra_folder,os.path.splitext(os.path.basename(identification_file))[0],"data")
if Param.QUANTIFICATION :
if not verify_file_path(raw_ms_file):
raise FileNotFoundError("{} does not exists".format(raw_ms_file))
self.raw_ms_file = raw_ms_file
if condition not in (0,1,2):
raise AssertionError("condition must be one of (0,1,2). 0,1,2 -> growing stringent condition")
self.condition = condition
self.index = index
def __eq__(self, other):
return self.index == other.index
def __lt__(self, other):
return self.index < other.index