Esempio n. 1
0
    def __init__(self,
                 file_location,
                 analyzer='Unknown',
                 instrument_label='Unknown'):
        """
         # Parameters
		----------
        file_location: text,  pathlib.Path(), or s3path.S3Path 
            Path object from pathlib containing the file location
        """

        if isinstance(file_location, str):
            # if obj is a string it defaults to create a Path obj, pass the S3Path if needed
            file_location = Path(file_location)

        if not file_location.exists():
            raise FileNotFoundError("%s not found" % file_location)

        if not file_location.suffix == '.corems':

            raise TypeError("%s is not a valid CoreMS file" % file_location)

        Thread.__init__(self)

        ReadCoremsMasslist.__init__(self, file_location)

        self.lcms = LCMSBase(self.file_location,
                             analyzer=analyzer,
                             instrument_label=instrument_label)
Esempio n. 2
0
def test_import_corems_mass_list():

    file_location = Path.cwd() / "tests/tests_data/ESI_NEG_SRFA_COREMS.csv"
    
    #polarity need to be set or read from the file
    
    #load any type of mass list file, change the delimeter to read another type of file, i.e : "," for csv, "\t" for tabulated mass list, etc
    mass_list_reader = ReadCoremsMasslist(file_location,  analyzer='ICR', instrument_label='12T')

    mass_spectrum = mass_list_reader.get_mass_spectrum()

    for mspeak in mass_spectrum:
        
        if mspeak:
            
            for mf in mspeak:
                print(mf.string)

    file_location = Path.cwd() / "tests/tests_data/" /  "NEG_ESI_SRFA_CoreMS.corems"

    read_lc_ms = ReadCoremsMassSpectraText(file_location)

    read_lc_ms.start()
    read_lc_ms.join()
    
    mass_spectra = read_lc_ms.get_lcms_obj()

    for mspeak in mass_spectra[0]:
        
        if mspeak:
            
            for mf in mspeak:
                
                print('mass_spectra', mf.string)                
Esempio n. 3
0
def import_corems_mass_list():

    file_location = Path.cwd() / "tests/tests_data/" / "ESI_NEG_SRFA_COREMS.csv"
    
    #polarity need to be set or read from the file
    
    #load any type of mass list file, change the delimeter to read another type of file, i.e : "," for csv, "\t" for tabulated mass list, etc
    mass_list_reader = ReadCoremsMasslist(file_location)

    mass_spectrum = mass_list_reader.get_mass_spectrum()

    return mass_spectrum
Esempio n. 4
0
 def __init__(self, file_location, analyzer='Unknown', instrument_label='Unknown'):
     
     if not Path(file_location).exists:
         raise FileNotFoundError("%s not found" % file_location)
     
     if not Path(file_location).suffix == '.corems':
         
         raise TypeError("%s is not a valid CoreMS file" % file_location)
     
     Thread.__init__(self)
     
     ReadCoremsMasslist.__init__(self, file_location)
     
     self.lcms = LCMSBase(self.file_location, analyzer=analyzer,instrument_label=instrument_label)