diff --git a/Changelog b/Changelog index 61c8e8be..498f7641 100644 --- a/Changelog +++ b/Changelog @@ -1,8 +1,13 @@ ### Added - +- Added support for TMT 18 +- Added option for contaminant tags in the database. ### Changed - Added the parsing rules from the Prophets to the protein description. +- Removed RawReader because of licensing issues. +- Improved processing speed and resource usage. +- Reduced binariy size. ### Fixed - +- Several bugs and code fizes added. +- Fixed issue with TMT 6 plex quantification. diff --git a/cmd/freequant.go b/cmd/freequant.go index 02b6b4a9..b8441301 100644 --- a/cmd/freequant.go +++ b/cmd/freequant.go @@ -64,7 +64,7 @@ func init() { freequant.Flags().StringVarP(&m.Quantify.Dir, "dir", "", "", "folder path containing the raw files") freequant.Flags().Float64VarP(&m.Quantify.Tol, "tol", "", 10, "m/z tolerance in ppm") freequant.Flags().Float64VarP(&m.Quantify.PTWin, "ptw", "", 0.4, "specify the time windows for the peak (minute)") - freequant.Flags().BoolVarP(&m.Quantify.Raw, "raw", "", false, "read raw files instead of converted XML") + //freequant.Flags().BoolVarP(&m.Quantify.Raw, "raw", "", false, "read raw files instead of converted XML") freequant.Flags().BoolVarP(&m.Quantify.Faims, "faims", "", false, "Use FAIMS information for the quantification") } diff --git a/cmd/labelquant.go b/cmd/labelquant.go index cf7f3fd3..f9cf6a52 100644 --- a/cmd/labelquant.go +++ b/cmd/labelquant.go @@ -72,7 +72,7 @@ func init() { labelquantCmd.Flags().Float64VarP(&m.Quantify.RemoveLow, "removelow", "", 0.0, "ignore the lower % of PSMs based on their summed abundances. 0 means no removal, entry value must be a decimal") labelquantCmd.Flags().BoolVarP(&m.Quantify.Unique, "uniqueonly", "", false, "report quantification based only on unique peptides") labelquantCmd.Flags().BoolVarP(&m.Quantify.BestPSM, "bestpsm", "", false, "select the best PSMs for protein quantification") - labelquantCmd.Flags().BoolVarP(&m.Quantify.Raw, "raw", "", false, "read raw files instead of converted XML") + //labelquantCmd.Flags().BoolVarP(&m.Quantify.Raw, "raw", "", false, "read raw files instead of converted XML") } diff --git a/lib/ext/rawfilereader/deb64/bindata.go.zip b/lib/ext/rawfilereader/deb64/bindata.go.zip deleted file mode 100644 index 28168fdf..00000000 Binary files a/lib/ext/rawfilereader/deb64/bindata.go.zip and /dev/null differ diff --git a/lib/ext/rawfilereader/deb64/deb64.go b/lib/ext/rawfilereader/deb64/deb64.go deleted file mode 100644 index 0155aff8..00000000 --- a/lib/ext/rawfilereader/deb64/deb64.go +++ /dev/null @@ -1,24 +0,0 @@ -package rawfilereader - -import ( - "errors" - "io/ioutil" - - "philosopher/lib/msg" - - "philosopher/lib/sys" -) - -// Deb64 deploys RawfileReader for Debian -func Deb64(unix64 string) { - - bin, e1 := Asset("rawFileReaderDeb") - if e1 != nil { - msg.DeployAsset(errors.New("rawFileReaderDeb"), "Cannot read rawFileReaderDeb obo") - } - - e2 := ioutil.WriteFile(unix64, bin, sys.FilePermission()) - if e2 != nil { - msg.DeployAsset(errors.New("rawFileReaderDeb"), "Cannot deploy rawFileReaderDeb 64-bit") - } -} diff --git a/lib/ext/rawfilereader/rawfilereader.go b/lib/ext/rawfilereader/rawfilereader.go deleted file mode 100644 index e2ef3038..00000000 --- a/lib/ext/rawfilereader/rawfilereader.go +++ /dev/null @@ -1,88 +0,0 @@ -package rawfilereader - -import ( - "os/exec" - "path/filepath" - "philosopher/lib/met" - "philosopher/lib/msg" - "philosopher/lib/sys" - "runtime" -) - -// RawFileReader represents the tool configuration -type RawFileReader struct { - met.Data - OS string - Arch string - Deb64Bin string - ReH64Bin string - WinBin string - DefaultBin string - ThermoFisherCommonCoreDataDLL string - ThermoFisherCommonCoreRawFileReaderDLL string -} - -// New constructor -func New() RawFileReader { - - var self RawFileReader - var m met.Data - m.Restore(sys.Meta()) - - self.UUID = m.UUID - self.Distro = m.Distro - self.Home = m.Home - self.MetaFile = m.MetaFile - self.MetaDir = m.MetaDir - self.DB = m.DB - self.Temp = m.Temp - self.TimeStamp = m.TimeStamp - self.OS = m.OS - self.Arch = m.Arch - - self.OS = runtime.GOOS - self.Arch = runtime.GOARCH - self.Deb64Bin = m.Temp + string(filepath.Separator) + "rawFileReaderDeb" - self.ReH64Bin = m.Temp + string(filepath.Separator) + "rawFileReaderReH" - self.WinBin = m.Temp + string(filepath.Separator) + "RawFileReader.exe" - self.ThermoFisherCommonCoreDataDLL = m.Temp + string(filepath.Separator) + "ThermoFisher.CommonCore.Data.dll" - self.ThermoFisherCommonCoreRawFileReaderDLL = m.Temp + string(filepath.Separator) + "ThermoFisher.CommonCore.RawFileReader.dll" - - return self -} - -// Run is the main entry point for rawfilereader -func Run(rawFileName, scanQuery string) string { - - var reader = New() - - // deploy the binaries - reader.Deploy() - - // run - stream := reader.Execute(rawFileName, scanQuery) - - return stream -} - -// Execute is the main function to execute RawFileReader -func (c *RawFileReader) Execute(rawFileName, scanQuery string) string { - - bin := c.DefaultBin - cmd := exec.Command(bin) - - file, _ := filepath.Abs(rawFileName) - cmd.Args = append(cmd.Args, file) - - if len(scanQuery) > 0 { - cmd.Args = append(cmd.Args, scanQuery) - } - - out, e := cmd.CombinedOutput() - if e != nil { - msg.ExecutingBinary(e, "fatal") - } - _ = cmd.Wait() - - return string(out) -} diff --git a/lib/ext/rawfilereader/rawfilereader_unix.go b/lib/ext/rawfilereader/rawfilereader_unix.go deleted file mode 100644 index bdd362b9..00000000 --- a/lib/ext/rawfilereader/rawfilereader_unix.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build linux -// +build linux - -package rawfilereader - -import ( - uDeb "philosopher/lib/ext/rawfilereader/deb64" - uRH "philosopher/lib/ext/rawfilereader/reh64" - "philosopher/lib/sys" -) - -// Deploy generates binaries on workdir -func (c *RawFileReader) Deploy() { - if c.OS == "linux" && c.Distro == sys.Debian() { - - // deploy debian binary - uDeb.Deb64(c.Deb64Bin) - c.DefaultBin = c.Deb64Bin - - } else { - - // deploy red hat binary - uRH.Reh64(c.ReH64Bin) - c.DefaultBin = c.ReH64Bin - - } -} diff --git a/lib/ext/rawfilereader/rawfilereader_win.go b/lib/ext/rawfilereader/rawfilereader_win.go deleted file mode 100644 index e023138d..00000000 --- a/lib/ext/rawfilereader/rawfilereader_win.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build windows -// +build windows - -package rawfilereader - -import ( - wRaw "philosopher/lib/ext/rawfilereader/win" -) - -// Deploy generates binaries on workdir -func (c *RawFileReader) Deploy() { - // deploy windows binary - wRaw.Win(c.WinBin) - wRaw.ThermoFisherCommonCoreDataDLL(c.ThermoFisherCommonCoreDataDLL) - wRaw.ThermoFisherCommonCoreRawFileReaderDLL(c.ThermoFisherCommonCoreRawFileReaderDLL) - c.DefaultBin = c.WinBin -} diff --git a/lib/ext/rawfilereader/reh64/bindata.go.zip b/lib/ext/rawfilereader/reh64/bindata.go.zip deleted file mode 100644 index 4f8e7a38..00000000 Binary files a/lib/ext/rawfilereader/reh64/bindata.go.zip and /dev/null differ diff --git a/lib/ext/rawfilereader/reh64/reh64.go b/lib/ext/rawfilereader/reh64/reh64.go deleted file mode 100644 index 5819939f..00000000 --- a/lib/ext/rawfilereader/reh64/reh64.go +++ /dev/null @@ -1,24 +0,0 @@ -package rawfilereader - -import ( - "errors" - "io/ioutil" - - "philosopher/lib/msg" - - "philosopher/lib/sys" -) - -// Reh64 deploys RawfileReader for Red Hat -func Reh64(unix64 string) { - - bin, e1 := Asset("rawFileReaderReH") - if e1 != nil { - msg.DeployAsset(errors.New("rawFileReaderReH"), "Cannot read rawFileReaderDeb obo") - } - - e2 := ioutil.WriteFile(unix64, bin, sys.FilePermission()) - if e2 != nil { - msg.DeployAsset(errors.New("rawFileReaderReH"), "Cannot deploy rawFileReaderDeb 64-bit") - } -} diff --git a/lib/ext/rawfilereader/win/bindata.go.zip b/lib/ext/rawfilereader/win/bindata.go.zip deleted file mode 100644 index fa548659..00000000 Binary files a/lib/ext/rawfilereader/win/bindata.go.zip and /dev/null differ diff --git a/lib/ext/rawfilereader/win/win.go b/lib/ext/rawfilereader/win/win.go deleted file mode 100644 index d6391f25..00000000 --- a/lib/ext/rawfilereader/win/win.go +++ /dev/null @@ -1,52 +0,0 @@ -package rawfilereader - -import ( - "errors" - "io/ioutil" - - "philosopher/lib/msg" - - "philosopher/lib/sys" -) - -// Win deploys RawfileReader for Red Hat -func Win(win string) { - - bin, e1 := Asset("RawFileReader.exe") - if e1 != nil { - msg.DeployAsset(errors.New("RawFileReader.exe"), "Cannot read rawFileReader.exe obo") - } - - e2 := ioutil.WriteFile(win, bin, sys.FilePermission()) - if e2 != nil { - msg.DeployAsset(errors.New("rawFileReader.exe"), "Cannot deploy rawFileReader.exe 64-bit") - } -} - -// ThermoFisherCommonCoreDataDLL deploys libgcc_s_dw2.dll -func ThermoFisherCommonCoreDataDLL(s string) { - - bin, e1 := Asset("ThermoFisher.CommonCore.Data.dll") - if e1 != nil { - msg.DeployAsset(errors.New("ThermoFisherCommonCoreData"), "Cannot read ThermoFisherCommonCoreData.dll bin") - } - - e2 := ioutil.WriteFile(s, bin, sys.FilePermission()) - if e2 != nil { - msg.DeployAsset(errors.New("ThermoFisherCommonCoreData"), "Cannot deploy ThermoFisherCommonCoreData.dll.dllcDLL") - } -} - -// ThermoFisherCommonCoreRawFileReaderDLL deploys libgcc_s_dw2.dll -func ThermoFisherCommonCoreRawFileReaderDLL(s string) { - - bin, e1 := Asset("ThermoFisher.CommonCore.RawFileReader.dll") - if e1 != nil { - msg.DeployAsset(errors.New("ThermoFisher.CommonCore.RawFileReader.dll"), "Cannot read ThermoFisher.CommonCore.RawFileReader.dll bin") - } - - e2 := ioutil.WriteFile(s, bin, sys.FilePermission()) - if e2 != nil { - msg.DeployAsset(errors.New("ThermoFisher.CommonCore.RawFileReader.dll"), "Cannot deploy ThermoFisher.CommonCore.RawFileReader.dll") - } -} diff --git a/lib/qua/lfq.go b/lib/qua/lfq.go index 540ea17d..f2c797eb 100644 --- a/lib/qua/lfq.go +++ b/lib/qua/lfq.go @@ -5,14 +5,12 @@ import ( "fmt" "math" "path/filepath" + "philosopher/lib/bio" "philosopher/lib/id" + "philosopher/lib/msg" "sort" "strings" - "philosopher/lib/bio" - "philosopher/lib/ext/rawfilereader" - "philosopher/lib/msg" - "philosopher/lib/mzn" "philosopher/lib/rep" @@ -86,9 +84,9 @@ func peakIntensity(evi rep.Evidence, dir, format string, rTWin, pTWin, tol float var fileName string if isRaw { - fileName = fmt.Sprintf("%s%s%s.raw", dir, string(filepath.Separator), s) - stream := rawfilereader.Run(fileName, "") - mz.ReadRaw(s, stream) + //fileName = fmt.Sprintf("%s%s%s.raw", dir, string(filepath.Separator), s) + //stream := rawfilereader.Run(fileName, "") + //mz.ReadRaw(s, stream) } else { fileName = fmt.Sprintf("%s%s%s.mzML", dir, string(filepath.Separator), s) mz.Read(fileName) diff --git a/lib/qua/qua.go b/lib/qua/qua.go index 3328e2b1..7dd28171 100644 --- a/lib/qua/qua.go +++ b/lib/qua/qua.go @@ -9,7 +9,6 @@ import ( "sort" "strings" - "philosopher/lib/ext/rawfilereader" "philosopher/lib/iso" "philosopher/lib/met" "philosopher/lib/msg" @@ -100,10 +99,9 @@ func RunIsobaricLabelQuantification(p met.Quantify, mods bool) met.Quantify { logrus.Info("Processing ", sourceList[i]) if p.Raw { - - fileName = fmt.Sprintf("%s%s%s.raw", p.Dir, string(filepath.Separator), sourceList[i]) - stream := rawfilereader.Run(fileName, "") - mz.ReadRaw(fileName, stream) + //fileName = fmt.Sprintf("%s%s%s.raw", p.Dir, string(filepath.Separator), sourceList[i]) + //stream := rawfilereader.Run(fileName, "") + //mz.ReadRaw(fileName, stream) } else {