fgcz / rawDiag

Brings Orbitrap mass spectrometry data to life; multi-platform, fast and colorful R package
https://bioconductor.org/packages/rawDiag
36 stars 11 forks source link

more columns than column names Fusion Lumos #26

Closed cpanse closed 6 years ago

cpanse commented 6 years ago

...

Bigger bug, I guess you didn’t have a Fusion Lumos file to test with: Extracting the raw file for scans/XIC works, however the read.raw () function throws an error. I guess the naming is different, perhaps one can build a fallback flag to ignore them if none are found. Otherwise this might have to be adapted to different machines. I could provide raw files for Orbitrap XL, Velos, Elite, QE Plus, QE HF, QE HFX, Fusion Lumos.

metadata <- read.raw(rawfile)

system2 is writting to tempfile C:\Users\danielz\AppData\Local\Temp\RtmpqM2GA5\file139c2bc35ba1tsv ...

Error in read.table(file = file, header = header, sep = sep, quote = quote, :

more columns than column names

If you want to reproduce that, I uploaded a BSA raw file from said Fusion Lumos mass spectrometer ...

cpanse commented 6 years ago
cp@fgcz-148:~ > mono RiderProjects/fgcz_raw/fgcz_raw/bin/Debug/fgcz_raw.exe 180627_BSA_ACC_50fmol_R2.raw qc \
  | awk '{print NF}' \
  | sort \
  | uniq -c
      1 54
   1981 55
  31666 57
cpanse commented 6 years ago

screen shot 2018-07-13 at 11 25 31

mono RiderProjects/fgcz-raw/bin/Debug/fgcz_raw.exe raw/180627_BSA_ACC_50fmol_R2.raw qc \
  | head -n 2 \
  | tail -n 1 \
  | tr "\t" "\n" \
  | cat -n 
cpanse commented 6 years ago

propose fix

 foreach (var scanTrailerField in scanTrailer.Values)
                {
                    Console.Write("\t{0}", scanTrailerField.Replace("\t", "").Replace(" ", ""));
                }
                Console.WriteLine();
  var trailerFields = rawFile.GetTrailerExtraHeaderInformation();
                var trailerHeaderFieldCounter = 0;
                foreach (var field in trailerFields)
                {
                    trailerHeaderFieldCounter++;
                    var trailerHeaderFieldValue =
                        field.Label.ToString().CleanRawfileTrailerHeader();

                    if (trailerHeaderFieldValue.Length > 1){
                        Console.Write("\t{0}", trailerHeaderFieldValue, trailerHeaderFieldValue.Length );
                    } else {
                        Console.Write("\tunnamedTrailerHeaderField_{0}", trailerHeaderFieldCounter);
                    }
                }
cpanse commented 6 years ago
mono RiderProjects/fgcz-raw/bin/Debug/fgcz_raw.exe raw/180627_BSA_ACC_50fmol_R2.raw qc \
  > raw/180627_BSA_ACC_50fmol_R2.txt
rv <- read.csv("~/raw/180627_BSA_ACC_50fmol_R2.txt", 
  sep = "\t", stringsAsFactors = FALSE, header = TRUE)

S <- as.rawDiag(rv)
PlotMzDistribution(S)

screen shot 2018-07-13 at 13 19 51

next; testing

cpanse commented 6 years ago

commit c046a13fe6c924794a5541a3e12c249a737f6edc