diff --git a/Changelog b/Changelog index 2b714c2b..86c19e47 100644 --- a/Changelog +++ b/Changelog @@ -1,11 +1,5 @@ ### Added -- Added keepold flag for PTMProphet. - ### Changed -- Philosopher will ignore the interact file when interact.mod is present. -- Improved quantification mapping to all runs. The --mapmods option is only necessary to print mod reports. -- The number of tryptic ternmini is now determined by ProteinProphet. ### Fixed -- Error preventing iTRAQ quantification. -- Several formatting, typoes and Go-Vet issues were fixed. \ No newline at end of file +- Pipeline functions were restored. \ No newline at end of file diff --git a/Makefile b/Makefile index b074c208..bfa2ba4b 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ BINARY = philosopher VERSION = $(shell date +%Y%m%d) BUILD = $(shell date +%Y%m%d%H%M) -TAG = v3.2.4 +TAG = v3.2.5 LDFLAGS = -ldflags "-w -s -X main.version=${TAG} -X main.build=${BUILD}" diff --git a/cmd/pipeline.go b/cmd/pipeline.go index 21d4ffd8..071d28c8 100644 --- a/cmd/pipeline.go +++ b/cmd/pipeline.go @@ -10,6 +10,7 @@ import ( "philosopher/lib/met" "philosopher/lib/msg" "philosopher/lib/pip" + "philosopher/lib/sla" "philosopher/lib/sys" "github.com/sirupsen/logrus" @@ -77,34 +78,42 @@ var pipelineCmd = &cobra.Command{ meta = pip.DatabaseSearch(meta, p, dir, args) } - // PeptideProphet - PTMProphet - ProteinProphet - if p.PeptideProphet.Concurrent == true { - meta = pip.ParallelProphets(meta, p, dir, args) - } else { - meta = pip.Prophets(meta, p, dir, args) + // PeptideProphet + if p.Commands.PeptideProphet == "yes" { + meta = pip.PeptideProphet(meta, p, dir, args) + } + + // PTMProphet + if p.Commands.PTMProphet == "yes" { + meta = pip.PTMProphet(meta, p, dir, args) + } + + // ProteinProphet + if p.Commands.ProteinProphet == "yes" { + meta = pip.ProteinProphet(meta, p, dir, args) } // Abacus - combined pepxml - //meta = pip.CombinedPeptideList(meta, p, dir, args) + meta = pip.CombinedPeptideList(meta, p, dir, args) // Abacus - combined protxml - //meta = pip.CombinedProteinList(meta, p, dir, args) + meta = pip.CombinedProteinList(meta, p, dir, args) // Filter - Quantification - Clustering - Report - //meta = pip.FilterQuantifyReport(meta, p, dir, args) + meta = pip.FilterQuantifyReport(meta, p, dir, args) // Abacus - //meta = pip.Abacus(meta, p, dir, args) + meta = pip.Abacus(meta, p, dir, args) // TMT-Integrator - //meta = pip.TMTIntegrator(meta, p, dir, args) + meta = pip.TMTIntegrator(meta, p, dir, args) // Backup and Clean //pip.BackupAndClean(meta, p, dir, Version, Build, args) - // if len(p.SlackToken) > 0 { - // sla.Run("Philosopher", p.SlackToken, "Philosopher pipeline is done", p.SlackChannel, p.SlackUserID) - // } + if len(p.SlackToken) > 0 { + sla.Run("Philosopher", p.SlackToken, "Philosopher pipeline is done", p.SlackChannel, p.SlackUserID) + } met.CleanTemp(meta.Temp) diff --git a/lib/pip/bindata.go.zip b/lib/pip/bindata.go.zip index 629d7f10..17834671 100644 Binary files a/lib/pip/bindata.go.zip and b/lib/pip/bindata.go.zip differ diff --git a/lib/pip/pip.go b/lib/pip/pip.go index 5eb71731..21756a81 100644 --- a/lib/pip/pip.go +++ b/lib/pip/pip.go @@ -273,95 +273,161 @@ func Prophets(meta met.Data, p Directives, dir string, data []string) met.Data { return meta } -// ParallelProphets execute the TPP Prophets -func ParallelProphets(meta met.Data, p Directives, dir string, data []string) met.Data { +// PeptideProphet executes PeptideProphet in Parallel mode +func PeptideProphet(meta met.Data, p Directives, dir string, data []string) met.Data { - var wg sync.WaitGroup - wg.Add(len(data)) + if p.PeptideProphet.Concurrent == false { + for _, i := range data { - meta.Restore(sys.Meta()) - meta.Database = p.Database + logrus.Info("Running the validation and inference on ", i) - if p.Commands.PeptideProphet == "yes" || p.Commands.ProteinProphet == "yes" || p.Commands.PTMProphet == "yes" { + // getting inside de the dataset folder + dsAbs, _ := filepath.Abs(i) + os.Chdir(dsAbs) - if p.Commands.PeptideProphet == "yes" { - for _, ds := range data { + // // reload the meta data + meta.Restore(sys.Meta()) - db := p.Database.Annot + // PeptideProphet + if p.Commands.PeptideProphet == "yes" { + logrus.Info("Executing PeptideProphet on ", i) + meta.PeptideProphet = p.PeptideProphet + meta.PeptideProphet.Database = p.Database.Annot + meta.PeptideProphet.Decoy = p.Database.Tag + meta.PeptideProphet.Output = "interact" + meta.PeptideProphet.Combine = true + gobExt := fmt.Sprintf("*.%s", p.PeptideProphet.FileExtension) + files, e := filepath.Glob(gobExt) + if e != nil { + msg.Custom(e, "fatal") + } + peptideprophet.Run(meta, files) + meta.Serialize() + } - go func(ds, db string) { - defer wg.Done() + // return to the top level directory + os.Chdir(dir) + } + } else { - logrus.Info("Running the validation and inference on ", ds) + var wg sync.WaitGroup + wg.Add(len(data)) - // getting inside de the dataset folder - dsAbs, _ := filepath.Abs(ds) - absMeta := fmt.Sprintf("%s%s%s", dsAbs, string(filepath.Separator), sys.Meta()) + meta.Restore(sys.Meta()) + meta.Database = p.Database - // reload the meta data - meta.Restore(absMeta) + for _, ds := range data { - // PeptideProphet - logrus.Info("Executing PeptideProphet on ", ds) - meta.PeptideProphet = p.PeptideProphet - meta.PeptideProphet.Database = p.Database.Annot - meta.PeptideProphet.Decoy = p.Database.Tag - meta.PeptideProphet.Output = "interact" - meta.PeptideProphet.Combine = true + db := p.Database.Annot - gobExt := fmt.Sprintf("%s%s*.%s", dsAbs, string(filepath.Separator), p.PeptideProphet.FileExtension) + go func(ds, db string) { + defer wg.Done() - files, e := filepath.Glob(gobExt) - if e != nil { - msg.Custom(e, "fatal") - } + logrus.Info("Running the validation and inference on ", ds) - peptideprophet.Run(meta, files) + // getting inside de the dataset folder + dsAbs, _ := filepath.Abs(ds) + absMeta := fmt.Sprintf("%s%s%s", dsAbs, string(filepath.Separator), sys.Meta()) - // give a chance to the execution to untangle the output - time.Sleep(time.Second * 1) + // reload the meta data + meta.Restore(absMeta) - }(ds, db) - } + // PeptideProphet + logrus.Info("Executing PeptideProphet on ", ds) + meta.PeptideProphet = p.PeptideProphet + meta.PeptideProphet.Database = p.Database.Annot + meta.PeptideProphet.Decoy = p.Database.Tag + meta.PeptideProphet.Output = "interact" + meta.PeptideProphet.Combine = true - wg.Wait() + gobExt := fmt.Sprintf("%s%s*.%s", dsAbs, string(filepath.Separator), p.PeptideProphet.FileExtension) + + files, e := filepath.Glob(gobExt) + if e != nil { + msg.Custom(e, "fatal") + } + + peptideprophet.Run(meta, files) + + // give a chance to the execution to untangle the output + time.Sleep(time.Second * 1) + + }(ds, db) } - // // PTMProphet - // if p.Commands.PTMProphet == "yes" { - // logrus.Info("Executing PTMProphet on ", i) - // meta.PTMProphet = p.PTMProphet - // var files []string - // files = append(files, "interact.pep.xml") - // meta.PTMProphet.InputFiles = files - // ptmprophet.Run(meta, files) - // meta.Serialize() - // } - - // // ProteinProphet - // if p.Commands.ProteinProphet == "yes" { - // logrus.Info("Executing ProteinProphet on ", i) - // meta.ProteinProphet = p.ProteinProphet - // meta.ProteinProphet.Output = "interact" - // var files []string - // if p.Commands.PTMProphet == "yes" { - // files = append(files, "interact.mod.pep.xml") - // } else { - // files = append(files, "interact.pep.xml") - // } - // proteinprophet.Run(meta, files) - // meta.Serialize() - // } + wg.Wait() + } - // return to the top level directory - //os.Chdir(dir) + os.Chdir(dir) + + return meta +} + +// PTMProphet execute the TPP PTMProphet +func PTMProphet(meta met.Data, p Directives, dir string, data []string) met.Data { + + for _, i := range data { + + logrus.Info("Running the validation and inference on ", i) + + // getting inside de the dataset folder + dsAbs, _ := filepath.Abs(i) + os.Chdir(dsAbs) // reload the meta data - //meta.Restore(sys.Meta()) - // /} + meta.Restore(sys.Meta()) + + // PTMProphet + if p.Commands.PTMProphet == "yes" { + logrus.Info("Executing PTMProphet on ", i) + meta.PTMProphet = p.PTMProphet + var files []string + files = append(files, "interact.pep.xml") + meta.PTMProphet.InputFiles = files + ptmprophet.Run(meta, files) + meta.Serialize() + } + + // return to the top level directory + os.Chdir(dir) } - os.Chdir(dir) + return meta +} + +// ProteinProphet execute the TPP ProteinProphet +func ProteinProphet(meta met.Data, p Directives, dir string, data []string) met.Data { + + for _, i := range data { + + logrus.Info("Running the validation and inference on ", i) + + // getting inside de the dataset folder + dsAbs, _ := filepath.Abs(i) + os.Chdir(dsAbs) + + // reload the meta data + meta.Restore(sys.Meta()) + + // ProteinProphet + if p.Commands.ProteinProphet == "yes" { + logrus.Info("Executing ProteinProphet on ", i) + meta.ProteinProphet = p.ProteinProphet + meta.ProteinProphet.Output = "interact" + var files []string + if p.Commands.PTMProphet == "yes" { + files = append(files, "interact.mod.pep.xml") + } else { + files = append(files, "interact.pep.xml") + } + proteinprophet.Run(meta, files) + meta.Serialize() + met.CleanTemp(meta.Temp) + } + + // return to the top level directory + os.Chdir(dir) + } return meta } diff --git a/philosopher.yml b/philosopher.yml index 340f72ee..3f7c5e75 100644 --- a/philosopher.yml +++ b/philosopher.yml @@ -257,7 +257,7 @@ abacus: uniqueOnly: false # report TMT quantification based on only unique peptides reprint: false # create abacus reports using the Reprint format -tmtintegrator: # v1.1.8 +tmtintegrator: # v1.1.10 path: # path to TMT-Integrator jar memory: 6 # memory allocation, in Gb output: # the location of output files @@ -282,4 +282,5 @@ tmtintegrator: # v1.1.8 top3_pep: true # use top 3 most intense peptide ions as part of the reference sample abundance estimation print_RefInt: false # print individual reference sample abundance estimates for each multiplex in the final reports (in addition to the combined reference sample abundance estimate) add_Ref: -1 # add an artificial reference channel if there is no reference channel (-1: don't add the reference; 0: use summation as the reference; 1: use average as the reference; 2: use median as the reference) - max_pep_prob_thres: 0 # the threshold for maximum peptide probability \ No newline at end of file + max_pep_prob_thres: 0 # the threshold for maximum peptide probability + min_ntt: 0 # minimum allowed number of enzymatic termini \ No newline at end of file