From 269aac88c1a2da4e03deefbaef87299e32073473 Mon Sep 17 00:00:00 2001 From: Felipe da Veiga Leprevost Date: Mon, 18 Jan 2021 09:47:58 -0500 Subject: [PATCH 1/4] replacing tabs for spaces in db header --- lib/dat/dat_test.go | 4 ++-- lib/fas/fas.go | 1 + lib/qua/iso.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/dat/dat_test.go b/lib/dat/dat_test.go index c4925aa4..bd98e6ab 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) != 20370 { - t.Errorf("Number of FASTA entries is incorrect, got %d, want %d", len(d.Records), 20370) + if len(d.Records) != 20379 { + t.Errorf("Number of FASTA entries is incorrect, got %d, want %d", len(d.Records), 20379) } }) } diff --git a/lib/fas/fas.go b/lib/fas/fas.go index 06c865e8..b39651ab 100644 --- a/lib/fas/fas.go +++ b/lib/fas/fas.go @@ -30,6 +30,7 @@ func ParseFile(filename string) map[string]string { if strings.HasPrefix(scanner.Text(), ">") { header := reHeader.FindStringSubmatch(scanner.Text()) fastaHeader = header[1] + fastaHeader = strings.Replace(fastaHeader, "\t", " ", -1) fastaMap[fastaHeader] = "" } else { fastaSeq = fastaMap[fastaHeader] diff --git a/lib/qua/iso.go b/lib/qua/iso.go index 8573219b..b6125032 100644 --- a/lib/qua/iso.go +++ b/lib/qua/iso.go @@ -519,7 +519,8 @@ func correctUnlabelledSpectra(evi rep.Evidence) rep.Evidence { evi.PSM[i].Labels.Channel16.Intensity = 0 } else { for _, j := range evi.PSM[i].Modifications.Index { - if j.MassDiff == 144.1020 || j.MassDiff == 229.1629 || j.MassDiff == 304.2072 { + //if j.MassDiff == 144.1020 || j.MassDiff == 229.1629 || j.MassDiff == 304.2072 { + if j.MassDiff > 144 { flag++ } } From 3a62011e71baf05d5da6ec3ddea7094ec4eb8f3a Mon Sep 17 00:00:00 2001 From: Felipe da Veiga Leprevost Date: Mon, 18 Jan 2021 10:10:54 -0500 Subject: [PATCH 2/4] added support for compensation voltage --- lib/id/pep.go | 2 ++ lib/rep/psm.go | 6 ++++-- lib/rep/rep.go | 1 + lib/spc/pepxml.go | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/id/pep.go b/lib/id/pep.go index 6843f801..83927d94 100644 --- a/lib/id/pep.go +++ b/lib/id/pep.go @@ -86,6 +86,7 @@ type PeptideIdentification struct { Intensity float64 IonMobility float64 IsRejected uint8 + CompesationVoltage float64 Modifications mod.Modifications } @@ -347,6 +348,7 @@ func processSpectrumQuery(sq spc.SpectrumQuery, massDeviation float64, mods mod. psm.AssumedCharge = sq.AssumedCharge psm.RetentionTime = sq.RetentionTimeSec psm.IonMobility = sq.IonMobility + psm.CompesationVoltage = sq.CompensationVoltage if sq.UncalibratedPrecursorNeutralMass > 0 { psm.PrecursorNeutralMass = sq.PrecursorNeutralMass diff --git a/lib/rep/psm.go b/lib/rep/psm.go index e117dfa4..2addfd55 100644 --- a/lib/rep/psm.go +++ b/lib/rep/psm.go @@ -70,6 +70,7 @@ func (evi *Evidence) AssemblePSMReport(pep id.PepIDList, decoyTag string) { p.DiscriminantValue = i.DiscriminantValue p.Intensity = i.Intensity p.IonMobility = i.IonMobility + p.CompensationVoltage = i.CompesationVoltage p.MappedGenes = make(map[string]int) p.MappedProteins = make(map[string]int) p.Modifications = i.Modifications @@ -151,7 +152,7 @@ func (evi Evidence) MetaPSMReport(brand string, channels int, hasDecoys, isComet header += "\tXCorr\tDeltaCN\tDeltaCNStar\tSPScore\tSPRank" } - header += "\tExpectation\tHyperscore\tNextscore\tPeptideProphet Probability\tNumber of Enzymatic Termini\tNumber of Missed Cleavages\tIntensity\tIon Mobility\tAssigned Modifications\tObserved Modifications" + header += "\tExpectation\tHyperscore\tNextscore\tPeptideProphet Probability\tNumber of Enzymatic Termini\tNumber of Missed Cleavages\tIntensity\tIon Mobility\tCompensation Voltage\tAssigned Modifications\tObserved Modifications" if hasLoc == true { header += "\tNumber of Phospho Sites\tPhospho Site Localization" @@ -286,7 +287,7 @@ func (evi Evidence) MetaPSMReport(brand string, channels int, hasDecoys, isComet ) } - line = fmt.Sprintf("%s\t%.14f\t%.4f\t%.4f\t%.4f\t%d\t%d\t%.4f\t%.4f\t%s\t%s", + line = fmt.Sprintf("%s\t%.14f\t%.4f\t%.4f\t%.4f\t%d\t%d\t%.4f\t%.4f\t%.4f\t%s\t%s", line, i.Expectation, i.Hyperscore, @@ -296,6 +297,7 @@ func (evi Evidence) MetaPSMReport(brand string, channels int, hasDecoys, isComet i.NumberOfMissedCleavages, i.Intensity, i.IonMobility, + i.CompensationVoltage, strings.Join(assL, ", "), strings.Join(obs, ", "), ) diff --git a/lib/rep/rep.go b/lib/rep/rep.go index e5e00760..a2513751 100644 --- a/lib/rep/rep.go +++ b/lib/rep/rep.go @@ -151,6 +151,7 @@ type PSMEvidence struct { Intensity float64 IonMobility float64 Purity float64 + CompensationVoltage float64 IsDecoy bool IsUnique bool IsURazor bool diff --git a/lib/spc/pepxml.go b/lib/spc/pepxml.go index 0cd6f6c2..565bbbe0 100644 --- a/lib/spc/pepxml.go +++ b/lib/spc/pepxml.go @@ -192,6 +192,7 @@ type SpectrumQuery struct { Index uint32 `xml:"index,attr"` RetentionTimeSec float64 `xml:"retention_time_sec,attr"` IonMobility float64 `xml:"ion_mobility,attr"` + CompensationVoltage float64 `xml:"compensation_voltage,attr"` SearchResult SearchResult `xml:"search_result"` } From 5e552da268cadb2612980f1342df18d64b48f48c Mon Sep 17 00:00:00 2001 From: Felipe da Veiga Leprevost Date: Mon, 18 Jan 2021 16:49:19 -0500 Subject: [PATCH 3/4] updating changelog --- Changelog | 9 +++------ lib/mod/mod.go | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Changelog b/Changelog index efb98d92..83629920 100644 --- a/Changelog +++ b/Changelog @@ -1,10 +1,7 @@ ### Added -- Fix to PTProphet mod_nterm_mass change when using TMT-16 plex. +- Added support to compensation Voltage. ### Changed -- Updated parallelization for PeptideProphet. -- Updated pipeline configuration file. --When using a GENCODe database, the Gene name will now be the ENSG key from the header. +- Tabular spaces in FASTA headers will be replaces by spaces. -### Fixed -- Fixed issue with empty custom database. \ No newline at end of file +### Fixed \ No newline at end of file diff --git a/lib/mod/mod.go b/lib/mod/mod.go index 49d69a06..9b11921d 100644 --- a/lib/mod/mod.go +++ b/lib/mod/mod.go @@ -8,7 +8,7 @@ import ( "github.com/vmihailenco/msgpack" ) -// Modifications is a collections of modification +// Modifications is a collection of modifications type Modifications struct { Index map[string]Modification } From 699681e860f327b31040188ac87112d50c5dbb77 Mon Sep 17 00:00:00 2001 From: Felipe da Veiga Leprevost Date: Mon, 25 Jan 2021 10:42:06 -0500 Subject: [PATCH 4/4] updating version and peptide list bug --- Changelog | 5 +++-- lib/rep/updater.go | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 83629920..53b32908 100644 --- a/Changelog +++ b/Changelog @@ -2,6 +2,7 @@ - Added support to compensation Voltage. ### Changed -- Tabular spaces in FASTA headers will be replaces by spaces. +- Tabular spaces in FASTA headers will be replaced by a simple space character. -### Fixed \ No newline at end of file +### Fixed +- Fix a bug that would miscalculate the number of peptides to be reported. \ No newline at end of file diff --git a/lib/rep/updater.go b/lib/rep/updater.go index 65c5a264..bcabbd66 100644 --- a/lib/rep/updater.go +++ b/lib/rep/updater.go @@ -59,6 +59,7 @@ func (evi *Evidence) UpdateIonStatus(decoyTag string) { var uniqueSeqMap = make(map[string]string) for _, i := range evi.Proteins { + for _, j := range i.TotalPeptideIons { if j.IsUnique == true { uniqueMap[j.IonForm] = true @@ -151,7 +152,8 @@ func (evi *Evidence) UpdateIonStatus(decoyTag string) { } for i := range evi.Peptides { - v, ok := uniqueSeqMap[evi.Peptides[i].Sequence] + //v, ok := uniqueSeqMap[evi.Peptides[i].Sequence] + v, ok := sequenceMap[evi.Peptides[i].Sequence] if ok { evi.Peptides[i].MappedProteins[evi.Peptides[i].Protein] = 0 delete(evi.Peptides[i].MappedProteins, v)