Closed wasimsandhu closed 1 year ago
For our LC-MS instrument runs, MS data is being collected and written to the file for a certain portion of the time, and then after that, no MS data is being collected but the chromatography is still running. The file is not complete because the instrument still needs to append that chromatography data to the end of it.
With most HILIC and C18 short runs, data is being collected for 12 minutes and then there’s 3 minutes left for that sample where no data is being collected. So the checksum passes and the file is ready to be processed
With this run, data is being collected for 20 minutes and then there’s 10 minutes of the gradient left. So the checksum will pass during the 10 minutes, but the data file is not complete because the chromatography is still going.
The first solution that comes to mind is to require the user to provide these pieces of information when setting up the chromatography method. The solution for now is to attempt to run msconvert 5 times over the course of 15 minutes.
# Run MSConvert (and give 5 more attempts if it fails)
try:
mzml_file = run_msconvert(path, filename, extension, mzml_file_directory)
for attempt in range(5):
if not os.path.exists(mzml_file):
time.sleep(180)
mzml_file = run_msconvert(path, filename, extension, mzml_file_directory)
else:
break
except:
mzml_file = None
print("Failed to run MSConvert.")
traceback.print_exc()