diff --git a/.goreleaser.yml b/.goreleaser.yml index 8d2c7622..c36e46d7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -111,68 +111,4 @@ release: # If set to auto, the release will not be pushed to the docker repository # in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1 # Defaults to false. - # skip_push: true - - -snapcrafts: - # You can change the name of the package. - # Default: `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}` - - name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" - - # Wether to publish the snap to the snapcraft store. - # Remember you need to `snapcraft login` first. - # Defaults to false. - publish: true - - # Single-line elevator pitch for your amazing snap. - # 79 char long at most. - summary: A complete toolkit for shotgun proteomics data analysis. - - # This the description of your snap. You have a paragraph or two to tell the - # most important story about your snap. Keep it under 100 words though, - # we live in tweetspace and your description wants to look good in the snap - # store. - description: - Philosopher is a software designed for proteome bioinformatics analysis. - - # A guardrail to prevent you from releasing a snap to all your users before - # it is ready. - # `devel` will let you release only to the `edge` and `beta` channels in the - # store. `stable` will let you release also to the `candidate` and `stable` - # channels. More info about channels here: - # https://snapcraft.io/docs/reference/channels - grade: stable - - # Snaps can be setup to follow three different confinement policies: - # `strict`, `devmode` and `classic`. A strict confinement where the snap - # can only read and write in its own namespace is recommended. Extra - # permissions for strict snaps can be declared as `plugs` for the app, which - # are explained later. More info about confinement here: - # https://snapcraft.io/docs/reference/confinement - confinement: strict - - # Your app's license, based on SPDX license expressions: https://spdx.org/licenses - # Default is empty. - license: GPL-3.0 - - # A snap of type base to be used as the execution environment for this snap. - # Valid values are: - # * bare - Empty base snap; - # * core - Ubuntu Core 16; - # * core18 - Ubuntu Core 18. - # Default is empty. - #base: core18 - - # Each binary built by GoReleaser is an app inside the snap. In this section - # you can declare extra details for those binaries. It is optional. - apps: - - # The name of the app must be the same name as the binary built or the snapcraft name. - philosopher: - - # If your app requires extra permissions to work outside of its default - # confined space, declare them here. - # You can read the documentation about the available plugs and the - # things they allow: - # https://snapcraft.io/docs/reference/interfaces. - plugs: ["home", "network"] + # skip_push: true \ No newline at end of file diff --git a/Changelog b/Changelog index 3bfca9b2..f2089709 100644 --- a/Changelog +++ b/Changelog @@ -1,10 +1,9 @@ ### Added -- Support for TMTPro (18-plex) + ### Changed -- Decoys have NextAA and PrevAA -- Improved the filtering process + ### Fixed -- Fixed an issue with the labelling of the TMT-6 channels -- Minor bugs and issues +- Fixed an issue with the ion mobility column not showing in empty PSM tables. +- Fixed an issue where high-scoring peptides mapping to complicated razor cases where not showing in the reports. diff --git a/cmd/msfragger.go b/cmd/msfragger.go index 79b7b4cb..aa327824 100644 --- a/cmd/msfragger.go +++ b/cmd/msfragger.go @@ -73,7 +73,7 @@ func init() { msfraggerCmd.Flags().StringVarP(&m.MSFragger.SearchEnzymeCut2, "search_enzyme_cut_2", "", "", "Second enzyme's cutting amino acid.") msfraggerCmd.Flags().StringVarP(&m.MSFragger.SearchEnzymeNocut2, "search_enzyme_nocut_2", "", "", "Second enzyme's protecting amino acid.") msfraggerCmd.Flags().IntVarP(&m.MSFragger.AllowedMissedCleavage2, "allowed_missed_cleavage_2", "", 2, "Second enzyme's allowed number of missed cleavages per peptide. Maximum value is 5.") - msfraggerCmd.Flags().StringVarP(&m.MSFragger.SearchEnzymeSense2, "search_enzyme_sense_2", "", "", "Second enzyme's cutting terminal.") + msfraggerCmd.Flags().StringVarP(&m.MSFragger.SearchEnzymeSense2, "search_enzyme_sense_2", "", "C", "Second enzyme's cutting terminal.") msfraggerCmd.Flags().IntVarP(&m.MSFragger.NumEnzymeTermini, "num_enzyme_termini", "", 2, "2 for enzymatic, 1 for semi-enzymatic, 0 for nonspecific digestion") msfraggerCmd.Flags().IntVarP(&m.MSFragger.ClipNTermM, "clip_nTerm_M", "", 1, "") msfraggerCmd.Flags().StringVarP(&m.MSFragger.VariableMod01, "variable_mod_01", "", "", "") diff --git a/cmd/report.go b/cmd/report.go index 1226a2c9..f339013b 100644 --- a/cmd/report.go +++ b/cmd/report.go @@ -43,6 +43,7 @@ func init() { reportCmd.Flags().BoolVarP(&m.Report.Decoys, "decoys", "", false, "add decoy observations to reports") reportCmd.Flags().BoolVarP(&m.Report.MSstats, "msstats", "", false, "create an output compatible with MSstats") reportCmd.Flags().BoolVarP(&m.Report.MZID, "mzid", "", false, "create a mzID output") + reportCmd.Flags().BoolVarP(&m.Report.IonMob, "ionmobility", "", false, "forces the printing of the ion mobility column") } RootCmd.AddCommand(reportCmd) diff --git a/lib/aba/pro.go b/lib/aba/pro.go index 2f485b62..b7f2708a 100644 --- a/lib/aba/pro.go +++ b/lib/aba/pro.go @@ -214,7 +214,8 @@ func processProteinCombinedFile(a met.Abacus, database dat.Base) rep.CombinedPro for i := range list { for _, j := range database.Records { - if strings.Contains(j.OriginalHeader, list[i].ProteinName) && !strings.Contains(j.OriginalHeader, a.Tag) { + if strings.Contains(j.OriginalHeader, list[i].ProteinName) && strings.HasPrefix(j.OriginalHeader, list[i].ProteinID) && !strings.Contains(j.OriginalHeader, a.Tag) { + //if strings.Contains(j.OriginalHeader, list[i].ProteinName) && !strings.Contains(j.OriginalHeader, a.Tag) { list[i].ProteinName = j.PartHeader list[i].ProteinID = j.ID list[i].EntryName = j.EntryName diff --git a/lib/dat/dat_test.go b/lib/dat/dat_test.go index 18b7826a..6c2c4430 100644 --- a/lib/dat/dat_test.go +++ b/lib/dat/dat_test.go @@ -73,8 +73,8 @@ func TestBase_ProcessDB(t *testing.T) { } d.ProcessDB(tt.args.file, tt.args.decoyTag) - if len(d.Records) != 20371 { - t.Errorf("Number of FASTA entries is incorrect, got %d, want %d", len(d.Records), 20371) + if len(d.Records) != 20360 { + t.Errorf("Number of FASTA entries is incorrect, got %d, want %d", len(d.Records), 20360) } }) } diff --git a/lib/dat/db.go b/lib/dat/db.go index 8b898e88..85df6230 100644 --- a/lib/dat/db.go +++ b/lib/dat/db.go @@ -395,8 +395,15 @@ func ProcessGeneric(k, v, decoyTag string) Record { idm := idReg.FindStringSubmatch(k) e.ID = idm[1] - e.Description = "" - e.EntryName = "" + part := strings.Split(k, " ") + + if len(part) > 1 { + e.Description = part[1] + } else { + e.Description = k + } + + e.EntryName = k e.GeneNames = "" e.Organism = "" e.SequenceVersion = "" @@ -405,7 +412,6 @@ func ProcessGeneric(k, v, decoyTag string) Record { e.Length = len(v) e.OriginalHeader = k - part := strings.Split(k, " ") e.PartHeader = part[0] if strings.HasPrefix(k, decoyTag) { diff --git a/lib/fil/fdr.go b/lib/fil/fdr.go index 3dbe23df..0c5768a7 100644 --- a/lib/fil/fdr.go +++ b/lib/fil/fdr.go @@ -213,178 +213,185 @@ func RazorFilter(p id.ProtXML) id.ProtXML { var r RazorMap = make(map[string]RazorCandidate) var rList []string - // for each peptide sequence, collapse all parent protein peptides from ions originated from the same sequence - for _, i := range p.Groups { - for _, j := range i.Proteins { - for _, k := range j.PeptideIons { - - v, ok := r[k.PeptideSequence] - if !ok { - - var rc RazorCandidate - rc.Sequence = k.PeptideSequence - rc.MappedProteinsW = make(map[string]float64) - rc.MappedProteinsGW = make(map[string]float64) - rc.MappedProteinsTNP = make(map[string]int) - rc.MappedproteinsSID = make(map[string]string) - - rc.MappedProteinsW[j.ProteinName] = k.Weight - rc.MappedProteinsGW[j.ProteinName] = k.GroupWeight - rc.MappedProteinsTNP[j.ProteinName] = j.TotalNumberPeptides - rc.MappedproteinsSID[j.ProteinName] = j.GroupSiblingID - - for _, i := range j.IndistinguishableProtein { - rc.MappedProteinsW[i] = -1 - rc.MappedProteinsGW[i] = -1 - rc.MappedProteinsTNP[i] = -1 - rc.MappedproteinsSID[i] = "zzz" - } + // perform a test load of the razor assingment, if there's a file, then the assignment is skipped, and the current file used. + r.Restore(true) + if len(r) == 0 { + + // for each peptide sequence, collapse all parent protein peptides from ions originated from the same sequence + for _, i := range p.Groups { + for _, j := range i.Proteins { + for _, k := range j.PeptideIons { + + v, ok := r[k.PeptideSequence] + if !ok { + + var rc RazorCandidate + rc.Sequence = k.PeptideSequence + rc.MappedProteinsW = make(map[string]float64) + rc.MappedProteinsGW = make(map[string]float64) + rc.MappedProteinsTNP = make(map[string]int) + rc.MappedproteinsSID = make(map[string]string) + + rc.MappedProteinsW[j.ProteinName] = k.Weight + rc.MappedProteinsGW[j.ProteinName] = k.GroupWeight + rc.MappedProteinsTNP[j.ProteinName] = j.TotalNumberPeptides + rc.MappedproteinsSID[j.ProteinName] = j.GroupSiblingID + + for _, i := range j.IndistinguishableProtein { + rc.MappedProteinsW[i] = -1 + rc.MappedProteinsGW[i] = -1 + rc.MappedProteinsTNP[i] = -1 + rc.MappedproteinsSID[i] = "zzz" + } - for _, i := range k.PeptideParentProtein { - rc.MappedProteinsW[i] = -1 - rc.MappedProteinsGW[i] = -1 - rc.MappedProteinsTNP[i] = -1 - rc.MappedproteinsSID[i] = "zzz" - } + for _, i := range k.PeptideParentProtein { + rc.MappedProteinsW[i] = -1 + rc.MappedProteinsGW[i] = -1 + rc.MappedProteinsTNP[i] = -1 + rc.MappedproteinsSID[i] = "zzz" + } - r[k.PeptideSequence] = rc + r[k.PeptideSequence] = rc - } else { - var c = v + } else { + var c = v - // doing like this will allow proteins that map to shared peptidesto be considered - c.MappedProteinsW[j.ProteinName] = k.Weight - c.MappedProteinsGW[j.ProteinName] = k.GroupWeight - c.MappedProteinsTNP[j.ProteinName] = j.TotalNumberPeptides - c.MappedproteinsSID[j.ProteinName] = j.GroupSiblingID - r[k.PeptideSequence] = c + // doing like this will allow proteins that map to shared peptidesto be considered + c.MappedProteinsW[j.ProteinName] = k.Weight + c.MappedProteinsGW[j.ProteinName] = k.GroupWeight + c.MappedProteinsTNP[j.ProteinName] = j.TotalNumberPeptides + c.MappedproteinsSID[j.ProteinName] = j.GroupSiblingID + r[k.PeptideSequence] = c - } + } + } } } - } - - // this will make the assignment more deterministic - for k := range r { - rList = append(rList, k) - } - sort.Strings(rList) - - var razorPair = make(map[string]string) - // get the best protein candidate for each peptide sequence and make the razor pair - for _, k := range rList { - // 1st pass: mark all cases with weight > 0.5 - for pt, w := range r[k].MappedProteinsW { - if w > 0.5 { - razorPair[k] = pt - } + // this will make the assignment more deterministic + for k := range r { + rList = append(rList, k) } - } - - // 2nd pass: mark all cases with highest group weight in the list - for _, k := range rList { - - _, ok := razorPair[k] - if !ok { + sort.Strings(rList) - var topPT string - var topCount int - var topGW float64 - var topTNP int - var topGWMap = make(map[float64]uint8) - var topTNPMap = make(map[int]uint8) + var razorPair = make(map[string]string) - if len(r[k].MappedProteinsGW) == 1 { - - for pt := range r[k].MappedProteinsGW { + // get the best protein candidate for each peptide sequence and make the razor pair + for _, k := range rList { + // 1st pass: mark all cases with weight > 0.5 + for pt, w := range r[k].MappedProteinsW { + if w > 0.5 { razorPair[k] = pt } + } + } - } else if len(r[k].MappedProteinsGW) > 1 { - - for pt, tnp := range r[k].MappedProteinsGW { - if tnp >= topGW { - topGW = tnp - topPT = pt - topGWMap[topGW]++ - } - } + // 2nd pass: mark all cases with highest group weight in the list + for _, k := range rList { - var tie bool - if topGWMap[topGW] >= 2 { - tie = true - } + _, ok := razorPair[k] + if !ok { - if !tie { - razorPair[k] = topPT + var topPT string + var topCount int + var topGW float64 + var topTNP int + var topGWMap = make(map[float64]uint8) + var topTNPMap = make(map[int]uint8) - } else { + if len(r[k].MappedProteinsGW) == 1 { - var tnpList []string - for pt := range r[k].MappedProteinsTNP { - tnpList = append(tnpList, pt) + for pt := range r[k].MappedProteinsGW { + razorPair[k] = pt } - sort.Strings(tnpList) + } else if len(r[k].MappedProteinsGW) > 1 { - for _, pt := range tnpList { - if r[k].MappedProteinsTNP[pt] >= topTNP { - topTNP = r[k].MappedProteinsTNP[pt] + for pt, tnp := range r[k].MappedProteinsGW { + if tnp >= topGW { + topGW = tnp topPT = pt - topTNPMap[topTNP]++ + topGWMap[topGW]++ } } var tie bool - if topTNPMap[topTNP] >= 2 { + if topGWMap[topGW] >= 2 { tie = true } if !tie { + razorPair[k] = topPT - var mplist []string + } else { + + var tnpList []string for pt := range r[k].MappedProteinsTNP { - mplist = append(mplist, pt) + tnpList = append(tnpList, pt) } - sort.Strings(mplist) - for _, pt := range mplist { - if r[k].MappedProteinsTNP[pt] >= topCount { - topCount = r[k].MappedProteinsTNP[pt] + sort.Strings(tnpList) + + for _, pt := range tnpList { + if r[k].MappedProteinsTNP[pt] >= topTNP { + topTNP = r[k].MappedProteinsTNP[pt] topPT = pt + topTNPMap[topTNP]++ } } - razorPair[k] = topPT + var tie bool + if topTNPMap[topTNP] >= 2 { + tie = true + } - } else { + if !tie { - var idList []string - for protein, id := range r[k].MappedproteinsSID { - id = fmt.Sprintf("%s_%s", id, protein) - idList = append(idList, id) - } + var mplist []string + for pt := range r[k].MappedProteinsTNP { + mplist = append(mplist, pt) + } + sort.Strings(mplist) - sort.Strings(idList) + for _, pt := range mplist { + if r[k].MappedProteinsTNP[pt] >= topCount { + topCount = r[k].MappedProteinsTNP[pt] + topPT = pt + } + } - id := strings.Split(idList[0], "_") - razorPair[k] = id[1] - } + razorPair[k] = topPT + } else { + + var idList []string + for protein, id := range r[k].MappedproteinsSID { + id = fmt.Sprintf("%s#%s", id, protein) + idList = append(idList, id) + } + + sort.Strings(idList) + + id := strings.Split(idList[0], "#") + razorPair[k] = id[1] + } + + } } } } - } - for _, k := range rList { - pt, ok := razorPair[k] - if ok { - razor := r[k] - razor.MappedProtein = pt - r[k] = razor + for _, k := range rList { + pt, ok := razorPair[k] + if ok { + razor := r[k] + razor.MappedProtein = pt + r[k] = razor + } } + + r.Serialize() } for i := range p.Groups { @@ -417,8 +424,6 @@ func RazorFilter(p id.ProtXML) id.ProtXML { } } - r.Serialize() - return p } @@ -659,7 +664,7 @@ func twoDFDRFilter(pep id.PepIDList, pro id.ProtIDList, psm, peptide, ion float6 func correctRazorAssignment(list id.PepIDList) id.PepIDList { var rm RazorMap = make(map[string]RazorCandidate) - rm.Restore() + rm.Restore(false) for i := range list { v, ok := rm[list[i].Peptide] @@ -675,7 +680,7 @@ func correctRazorAssignment(list id.PepIDList) id.PepIDList { } } - rm.Serialize() + //rm.Serialize() return list } diff --git a/lib/fil/fil.go b/lib/fil/fil.go index 7fd256b9..ec59f28b 100644 --- a/lib/fil/fil.go +++ b/lib/fil/fil.go @@ -9,12 +9,10 @@ import ( "strings" "philosopher/lib/cla" - "philosopher/lib/dat" "philosopher/lib/id" "philosopher/lib/inf" "philosopher/lib/met" "philosopher/lib/mod" - "philosopher/lib/msg" "philosopher/lib/rep" "philosopher/lib/sys" @@ -33,13 +31,23 @@ func Run(f met.Data) met.Data { f.Filter.Razor = true - if _, err := os.Stat(f.Filter.RazorBin); os.IsNotExist(err) { - logrus.Warn("razor peptides not found: ", f.Filter.RazorBin, ". Skipping razor assignment") - f.Filter.RazorBin = "" - } else { + if _, err := os.Stat(f.Filter.RazorBin); err == nil { + rdest := fmt.Sprintf("%s%s.meta%srazor.bin", f.Home, string(filepath.Separator), string(filepath.Separator)) sys.CopyFile(f.Filter.RazorBin, rdest) + + var rm RazorMap = make(map[string]RazorCandidate) + rm.Restore(false) + logrus.Info("Fetching razor assignment from: ", f.Filter.RazorBin, ": ", len(rm), " razor groups imported.") + _ = rm + + } else if errors.Is(err, os.ErrNotExist) { + + logrus.Warn("razor peptides not found: ", f.Filter.RazorBin, ". Calculating a new assignment") + f.Filter.RazorBin = "" + } + } // get the database tag from database command @@ -70,6 +78,7 @@ func Run(f met.Data) met.Data { } else if len(f.Filter.Pox) > 0 && !strings.EqualFold(f.Filter.Pox, "combined") { protXML := ReadProtXMLInput(f.Filter.Pox, f.Filter.Tag, f.Filter.Weight) + ProcessProteinIdentifications(protXML, f.Filter.PtFDR, f.Filter.PepFDR, f.Filter.ProtProb, f.Filter.Picked, f.Filter.Razor, false, f.Filter.Tag) pro.Restore() @@ -109,13 +118,13 @@ func Run(f met.Data) met.Data { } - var dtb dat.Base - dtb.Restore() - if len(dtb.Records) < 1 { - msg.Custom(errors.New("database annotation not found, interrupting the processing"), "fatal") - } + // var dtb dat.Base + // dtb.Restore() + // if len(dtb.Records) < 1 { + // msg.Custom(errors.New("database annotation not found, interrupting the processing"), "fatal") + // } - if f.Filter.TwoD || f.Filter.Razor { + if f.Filter.Razor || len(f.Filter.RazorBin) > 0 { var psm id.PepIDList psm.Restore("psm") psm = correctRazorAssignment(psm) @@ -174,10 +183,10 @@ func Run(f met.Data) met.Data { e.UpdatePeptideModCount() } - if f.Filter.Razor { + if f.Filter.Razor || len(f.Filter.RazorBin) > 0 { var razor RazorMap = make(map[string]RazorCandidate) - razor.Restore() + razor.Restore(false) for i := range e.PSM { @@ -225,6 +234,7 @@ func Run(f met.Data) met.Data { logrus.Info("Processing protein inference") pro.Restore() + e.AssembleProteinReport(pro, f.Filter.Weight, f.Filter.Tag) pro = nil diff --git a/lib/fil/razor.go b/lib/fil/razor.go index 75e49091..ecf5d07b 100644 --- a/lib/fil/razor.go +++ b/lib/fil/razor.go @@ -37,15 +37,15 @@ func (p *RazorMap) Serialize() { } // Restore reads razor bin files and restore the data sctructure -func (p *RazorMap) Restore() { +func (p *RazorMap) Restore(silent bool) { b, e := ioutil.ReadFile(sys.RazorBin()) - if e != nil { + if e != nil && !silent { msg.ReadFile(e, "warning") } e = msgpack.Unmarshal(b, &p) - if e != nil { + if e != nil && !silent { msg.DecodeMsgPck(e, "warning") } diff --git a/lib/id/pro.go b/lib/id/pro.go index 8f7e7abc..8146ef74 100644 --- a/lib/id/pro.go +++ b/lib/id/pro.go @@ -41,6 +41,7 @@ type ProteinIdentification struct { GroupNumber uint32 GroupSiblingID string ProteinName string + Description string UniqueStrippedPeptides []string Length string PercentCoverage float32 @@ -130,6 +131,7 @@ func (p *ProtXML) Read(f string) { ptid.GroupProbability = i.Probability ptid.Probability = i.Probability ptid.ProteinName = string(j.ProteinName) + ptid.Description = string(j.Annotation.ProteinDescription) ptid.Probability = j.Probability ptid.PercentCoverage = j.PercentCoverage ptid.PctSpectrumIDs = j.PctSpectrumIDs diff --git a/lib/met/met.go b/lib/met/met.go index 9d8092a3..35e2247f 100644 --- a/lib/met/met.go +++ b/lib/met/met.go @@ -415,6 +415,7 @@ type Report struct { Decoys bool `yaml:"withDecoys"` MSstats bool `yaml:"msstats"` MZID bool `yaml:"mzID"` + IonMob bool `yaml:"ionmobility"` } // TMTIntegrator options and parameters diff --git a/lib/pip/bindata.go.zip b/lib/pip/bindata.go.zip index f91d76d0..de44fd67 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 00b5beb7..721246f6 100644 --- a/lib/pip/pip.go +++ b/lib/pip/pip.go @@ -512,8 +512,10 @@ func CombinedProteinList(meta met.Data, p Directives, dir string, data []string) dest := fmt.Sprintf("%s%s.meta%spro.bin", i, string(filepath.Separator), string(filepath.Separator)) sys.CopyFile(proBin, dest) - rdest := fmt.Sprintf("%s%s.meta%srazor.bin", i, string(filepath.Separator), string(filepath.Separator)) - sys.CopyFile(sys.RazorBin(), rdest) + if p.Abacus.Razor { + rdest := fmt.Sprintf("%s%s.meta%srazor.bin", i, string(filepath.Separator), string(filepath.Separator)) + sys.CopyFile(sys.RazorBin(), rdest) + } } e := os.RemoveAll(path.Dir(proBin)) diff --git a/lib/rep/protein.go b/lib/rep/protein.go index 04b04edf..abe930d2 100644 --- a/lib/rep/protein.go +++ b/lib/rep/protein.go @@ -43,6 +43,7 @@ func (evi *Evidence) AssembleProteinReport(pro id.ProtIDList, weight float64, de rep.Modifications.Index = make(map[string]mod.Modification) rep.ProteinName = i.ProteinName + rep.Description = i.Description rep.ProteinGroup = i.GroupNumber rep.ProteinSubGroup = i.GroupSiblingID rep.Length, _ = strconv.Atoi(i.Length) @@ -185,10 +186,8 @@ func (evi *Evidence) AssembleProteinReport(pro id.ProtIDList, weight float64, de // fix the name sand headers and pull database information into protein report for i := range list { for _, j := range dtb.Records { - //if strings.Contains(j.OriginalHeader, list[i].ProteinName) { - if strings.HasPrefix(j.OriginalHeader, list[i].ProteinName) { - //fmt.Println("A:", j.OriginalHeader, "\t", "B:", list[i].ProteinName) + if strings.Contains(j.OriginalHeader, list[i].ProteinName) && strings.Contains(j.OriginalHeader, list[i].Description) { if (j.IsDecoy && list[i].IsDecoy) || (!j.IsDecoy && !list[i].IsDecoy) { diff --git a/lib/rep/psm.go b/lib/rep/psm.go index 9b716d0e..87b1738c 100644 --- a/lib/rep/psm.go +++ b/lib/rep/psm.go @@ -133,13 +133,12 @@ func (evi *Evidence) AssemblePSMReport(pep id.PepIDList, decoyTag string) { } // MetaPSMReport report all psms from study that passed the FDR filter -func (evi Evidence) MetaPSMReport(workspace, brand string, channels int, hasDecoys, isComet, hasLoc, hasLabels bool) { +func (evi Evidence) MetaPSMReport(workspace, brand string, channels int, hasDecoys, isComet, hasLoc, hasIonMob, hasLabels bool) { var header string var modMap = make(map[string]string) var modList []string var hasCompVolt bool - var hasIonMob bool var hasPurity bool output := fmt.Sprintf("%s%spsm.tsv", workspace, string(filepath.Separator)) @@ -179,7 +178,7 @@ func (evi Evidence) MetaPSMReport(workspace, brand string, channels int, hasDeco hasCompVolt = true } - if evi.PSM[i].IonMobility > 0 { + if !hasIonMob && evi.PSM[i].IonMobility > 0 { hasIonMob = true } diff --git a/lib/rep/rep.go b/lib/rep/rep.go index b8016537..7d040ade 100644 --- a/lib/rep/rep.go +++ b/lib/rep/rep.go @@ -441,7 +441,7 @@ func Run(m met.Data) { logrus.Info("Creating reports") // PSM - repo.MetaPSMReport(m.Home, isoBrand, isoChannels, m.Report.Decoys, isComet, hasLoc, hasLabels) + repo.MetaPSMReport(m.Home, isoBrand, isoChannels, m.Report.Decoys, isComet, hasLoc, m.Report.IonMob, hasLabels) // Ion repo.MetaIonReport(m.Home, isoBrand, isoChannels, m.Report.Decoys, hasLabels) diff --git a/philosopher.yml b/philosopher.yml index a8dfb268..69298a2e 100644 --- a/philosopher.yml +++ b/philosopher.yml @@ -1,5 +1,5 @@ # Philosopher pipeline configuration file -# Version 4.0.1 +# Version 4.1.1 # # The pipeline mode automates the processing done by Philosopher and other tools. First, check # the steps you want to execute in the commands section and change them to @@ -74,7 +74,7 @@ Database Search: # MSFragger-3.4 & Comet v201901 search_enzyme_cut_2: # Second enzyme's cutting amino acid. search_enzyme_nocut_2: # Second enzyme's protecting amino acid. allowed_missed_cleavage_2: # Second enzyme's allowed number of missed cleavages per peptide. Maximum value is 5. - search_enzyme_sense_2: # Second enzyme's cutting terminal. + search_enzyme_sense_2: C # Second enzyme's cutting terminal. num_enzyme_termini: 2 # 2 for enzymatic, 1 for semi-enzymatic, 0 for nonspecific digestion clip_nTerm_M: 1 # specifies the trimming of a protein N-terminal methionine as a variable modification (0 or 1) variable_mod_01: 15.99490 M 3 # variable modification