sgibb / topdownr

R-package for the analysis of Thermo Orbitrap Fusion Top-Down Proteomic Data.
https://sgibb.github.io/topdownr/
GNU General Public License v3.0
1 stars 0 forks source link

Extracting Header Information #83

Open Me9atron opened 4 months ago

Me9atron commented 4 months ago

Hello,

When I tried Extracting Header Information with the following code in R,

runScanHeadsman( path="D:\Raw_data\top down\20240212_myoglobin_480k_mz400-6000", executable="D:\Raw_data\top down\ScanHeadsman-1.3.20220905\ScanHeadsman.exe" )

I always meet the error "First argument should be valid file or folder name; --noMS received", and have not seen any generated .txt (scan header table) and a .csv (method table) file for each .raw file.

My raw files (Thermo Orbitrap) were acquired in direct infusion with only MS2 spectral, and are in the folder of "D:\Raw_data\top down\20240212_myoglobin_480k_mz400-6000", and ScanHeadsman.exe is in the "D:\Raw_data\top down\ScanHeadsman-1.3.20220905. I also tried specifying a single raw file using "path="D:\Raw_data\top down\20240212_myoglobin_480k_mz400-6000\data 1.raw", but I got the same error as above-mentioned.

Could you help me figure it out? Thank you.

Best wishes,

Zhaowei

sgibb commented 4 months ago

Does adding normalizePath and \\ help?

runScanHeadsman(
    path=normalizePath("D:\\Raw_data\\top down\\20240212_myoglobin_480k_mz400-6000"),
    executable="D:\\Raw_data\\top down\\ScanHeadsman-1.3.20220905\ScanHeadsman.exe"
)

BTW: the directory separator \ has to be escaped on windows (by a double slash): \\

Me9atron commented 4 months ago

Thank you, I tried adding normalizePath and \ but still got the same error as below (the double slash became single slash after I sent my message).

runScanHeadsman(

  • path=normalizePath("D:\Raw_data\top down\20240212_myoglobin_480k_mz400-6000"),
  • executable="D:\Raw_data\top down\ScanHeadsman-1.3.20220905\ScanHeadsman.exe"
  • ) First argument should be valid file or folder name; --noMS received

I also tried running ScanHeadsman from the commandline (ScanHeadsman.exe --noMS --methods:CSV) in "Command prompt", but it seemed the command was not recognized as an internal or external command, operable program or batch file.

C:\Users\mzw91>ScanHeadsman.exe --noMS --methods:CSV 'ScanHeadsman.exe' is not recognized as an internal or external command, operable program or batch file.

C:\Users\mzw91>D:\Raw_data\top down\ScanHeadsman-1.3.20220905\ScanHeadsman.exe --noMS --methods:CSV 'D:\Raw_data\top' is not recognized as an internal or external command, operable program or batch file.

Could you help me try something more for fixing this strange issue? Thank you.

Best wishes,

Zhaowei

sgibb commented 4 months ago

I am not familiar with Windows. Could you rename your "top down" directory into "topdown" (or "top_down") to remove the spaces in the filename? At least in

C:\Users\mzw91>D:\Raw_data\top down\ScanHeadsman-1.3.20220905\ScanHeadsman.exe --noMS --methods:CSV 'D:\Raw_data\top' is not recognized as an internal or external command, operable program or batch file.

there seems to be a problem with the space.

Me9atron commented 4 months ago

Awesome! Now it works, the method file and head file were both generated with the following command. Thanks!

C:\Users\mzw91>D:\Raw_data\topdown\ScanHeadsman-1.3.20220905\ScanHeadsman.exe D:\Raw_data\topdown\20240212_myoglobin_480k_mz400-6000 --methods:CSV The input argument is a folder Looking for raw files in it Using default extension for result Processing of D:\Raw_data\topdown\20240212_myoglobin_480k_mz400-6000\20240212_myoglobin_OT_480k.raw Extracting method to D:\Raw_data\topdown\20240212_myoglobin_480k_mz400-6000\20240212_myoglobin_OT_480k.methods.txt Scan processing done; Total: 100 scans Writing to CSV file. Done 1 files processed

I noticed the methods.txt file is empty, I guess it should be because the data was acquired by direct infusion without using an instrument method. Then I put csv. file, mzML file, fasta file and this empty methods.txt file in the same folder "D:\Raw_data\topdown\20240212_myoglobin_480k_mz400-6000", and ran the following script. There was an error saying "Could not find any csv files!" as below, but I checked the csv. file (scan heads) has correct format "csv" and with normal scan header information, could it be the empty methods.file affecting producing the TopDownSet object and triggering that error? I attached the csv. file and methods.txt file for your reference. Thanks.

the mass adduct for a proton

H <- 1.0078250321

myoglobin <- readTopDownFiles(

  • directory path

  • path=normalizePath("D:\Raw_data\topdown\20240212_myoglobin_480k_mz400-6000"),
  • fragmentation types

  • type = c("a", "b", "c", "x", "y", "z"),
  • adducts (add -H/H to c/z and name

  • them cmH/zpH (c minus H, z plus H)

  • adducts = data.frame(
  • mass=c(-H, H),
  • to=c("c", "z"),
  • name=c("cmH", "zpH")),
  • initiator methionine removal

  • modifications = "Met-loss",
  • don't use neutral loss

  • neutralLoss = NULL,
  • tolerance for fragment matching

  • tolerance = 1e-3,
  • topdownrdata was generate with an older version of topdownr,

  • the method files were generated with FilterString identification,

  • use conditions = "ScanDescription" (default) for recent data.

  • conditions = "FilterString"
  • ) Error in .listTopDownFiles(path, pattern = pattern) : Could not find any csv files!

20240212_myoglobin_OT_480k.csv 20240212_myoglobin_OT_480k.methods.txt

sgibb commented 4 months ago

Sorry for the late reply. The csv has to be named 20240212_myoglobin_OT_480k_experiments.csv. The code is looking for experiments.csv at the end of the filename.