Skip to content

Commit

Permalink
Merge pull request #179 from Nesvilab/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Felipe Leprevost committed Jan 25, 2021
2 parents 8eb086d + 699681e commit c862a66
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 12 deletions.
8 changes: 3 additions & 5 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
### 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 replaced by a simple space character.

### Fixed
- Fixed issue with empty custom database.
- Fix a bug that would miscalculate the number of peptides to be reported.
4 changes: 2 additions & 2 deletions lib/dat/dat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}
Expand Down
1 change: 1 addition & 0 deletions lib/fas/fas.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions lib/id/pep.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type PeptideIdentification struct {
Intensity float64
IonMobility float64
IsRejected uint8
CompesationVoltage float64
Modifications mod.Modifications
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/mod/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion lib/qua/iso.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
}
}
Expand Down
6 changes: 4 additions & 2 deletions lib/rep/psm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand All @@ -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, ", "),
)
Expand Down
1 change: 1 addition & 0 deletions lib/rep/rep.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ type PSMEvidence struct {
Intensity float64
IonMobility float64
Purity float64
CompensationVoltage float64
IsDecoy bool
IsUnique bool
IsURazor bool
Expand Down
4 changes: 3 additions & 1 deletion lib/rep/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions lib/spc/pepxml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down

0 comments on commit c862a66

Please sign in to comment.