You are on page 1of 1

1 # -*- coding: utf-8 -*-

2 """
3 Created on Fri May 18 10:18:33 2018
4
5 This script asks the user for the input of a folder, loads all .vms files in this
Folder into
6 and read_vms.extractInformation class, merges all peaks with the same name and
7 saves the merged peaks in a subdirectory named Merged_Plots.
8
9 @author: hambsch
10 """
11
12
13 folder = input('Enter the folder that contains .vms files. All .vms files are opened
and merged: ')
14 import sys
15 import os
16 sys.path.append(os.path.split(__file__))
17 import read_vms as vms
18
19 EI = vms.Extract_info()
20 while not os.path.isdir(folder):
21 print(f'{folder} is not a folder. Pleas enter another folder! Abort with "ABB": ')
22 folder = input()
23 if folder == 'ABB':
24 raise Exception('You Aborted the Evaluation!')
25
26 for f in os.listdir(folder):
27 if os.path.isfile(os.path.join(folder, f)):
28 if len(f.split('.')) > 1:
29 if f.split('.')[-1] == 'vms':
30 print(f)
31 EI.new_entry(File = os.path.join(folder, f))
32
33 EI.merge_all_by_peak()
34 EI.path = folder
35 EI.plot_save_merged()

You might also like