Skip to content

Commit

Permalink
Merge pull request #406 from Nesvilab/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Felipe da Veiga Leprevost committed Jan 20, 2023
2 parents b05653d + d42bf48 commit c4d2fcc
Show file tree
Hide file tree
Showing 54 changed files with 246 additions and 415 deletions.
10 changes: 7 additions & 3 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
### Added
- FASTA header verification for IonQuant

### Changed
- New version annoucements will happpen for all updates, including minor changes

### Fixed
- Fixed the protein coverage calculations with partially overlapping and subsumed peptides
- Fixed an issue where peptides would map to multiple locations in the protein after having I/L converted (Needs to be used with MSFragger v3.6.1 or higher)
- Fixed an issue with report tables having no isobaric labels being reported
- Fixed an issue that would not udpate PSMs with razor IDs and description
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ BINARY = philosopher
VERSION = $(shell date +%Y%m%d)
BUILD = $(shell date +%Y%m%d%H%M)

TAG = v4.8.0
RC = RC
TAG = v4.8.1
RC = RC2

LDFLAGS = -ldflags "-w -s -extldflags -static -X main.version=${TAG} -X main.build=${BUILD}"

Expand Down
32 changes: 0 additions & 32 deletions lib/aba/aba.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ type DataSetLabelNames struct {
}

// Run abacus
// TODO update error methos on the abacus function
func Run(m met.Data, args []string) {

// if !m.Abacus.Peptide && !m.Abacus.Protein {
// msg.Custom(errors.New("you need to specify a peptide or protein combined file for the Abacus analysis"), "fatal")
// }

psmLevelAbacus(m, args)

if m.Abacus.Peptide {
Expand All @@ -29,30 +24,3 @@ func Run(m met.Data, args []string) {
proteinLevelAbacus(m, args)
}
}

// addCustomNames adds to the label structures user-defined names to be used on the TMT labels
// func getLabelNames(dataSet, annot string) map[string]string {

// var labels = make(map[string]string)

// file, e := os.Open(annot)
// if e != nil {
// msg.ReadFile(errors.New("cannot open annotation file"), "error")
// }
// defer file.Close()

// scanner := bufio.NewScanner(file)
// for scanner.Scan() {
// names := strings.Fields(scanner.Text())

// name := dataSet + " " + names[0]

// labels[name] = names[1]
// }

// if e = scanner.Err(); e != nil {
// msg.Custom(errors.New("the annotation file looks to be empty"), "fatal")
// }

// return labels
// }
18 changes: 7 additions & 11 deletions lib/aba/pep.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ func peptideLevelAbacus(m met.Data, args []string) {

// collect interact full file names
for _, f := range files {
//if strings.Contains(f.Name(), "pep.xml") {
//interactFile := fmt.Sprintf("%s%s%s", i, string(filepath.Separator), f.Name())
//absPath, _ := filepath.Abs(interactFile)
//xmlFiles = append(xmlFiles, absPath)
//}

if strings.Contains(f.Name(), "annotation") {
var annot = fmt.Sprintf("%s%s%s", i, string(filepath.Separator), f.Name())

file, e := os.Open(annot)
if e != nil {
msg.ReadFile(errors.New("cannot open annotation file"), "error")
msg.ReadFile(errors.New("cannot open annotation file"), "fatal")
}
defer file.Close()

Expand All @@ -78,7 +74,7 @@ func peptideLevelAbacus(m met.Data, args []string) {
}

if e = scanner.Err(); e != nil {
msg.Custom(errors.New("the annotation file looks to be empty"), "fatal")
msg.Custom(errors.New("the annotation file looks to be empty"), "error")
}
}

Expand Down Expand Up @@ -117,7 +113,7 @@ func processPeptideCombinedFile(a met.Abacus) {

if _, e := os.Stat("combined.pep.xml"); os.IsNotExist(e) {

msg.NoParametersFound(errors.New("cannot find the combined.pep.xml file"), "fatal")
msg.NoParametersFound(errors.New("cannot find the combined.pep.xml file"), "error")

} else {

Expand Down Expand Up @@ -272,7 +268,7 @@ func savePeptideAbacusResult(session string, evidences rep.CombinedPeptideEviden
// create result file
file, e := os.Create(output)
if e != nil {
msg.WriteFile(e, "error")
msg.WriteFile(e, "fatal")
}
defer file.Close()

Expand All @@ -286,7 +282,7 @@ func savePeptideAbacusResult(session string, evidences rep.CombinedPeptideEviden
line += "\n"
_, e = io.WriteString(file, line)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

// organize by group number
Expand Down Expand Up @@ -328,7 +324,7 @@ func savePeptideAbacusResult(session string, evidences rep.CombinedPeptideEviden
line += "\n"
_, e = io.WriteString(file, line)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

}
Expand Down
26 changes: 13 additions & 13 deletions lib/aba/pro.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func proteinLevelAbacus(m met.Data, args []string) {

file, e := os.Open(annot)
if e != nil {
msg.ReadFile(errors.New("cannot open annotation file"), "error")
msg.ReadFile(errors.New("cannot open annotation file"), "fatal")
}
defer file.Close()

Expand All @@ -74,7 +74,7 @@ func proteinLevelAbacus(m met.Data, args []string) {
}

if e = scanner.Err(); e != nil {
msg.Custom(errors.New("the annotation file looks to be empty"), "fatal")
msg.Custom(errors.New("the annotation file looks to be empty"), "error")
}
}
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func processProteinCombinedFile(a met.Abacus, database dat.Base) rep.CombinedPro

if _, e := os.Stat("combined.prot.xml"); os.IsNotExist(e) {

msg.Custom(errors.New("cannot find combined.prot.xml file"), "fatal")
msg.Custom(errors.New("cannot find combined.prot.xml file"), "error")

} else {

Expand Down Expand Up @@ -409,7 +409,7 @@ func saveProteinAbacusResult(session, plex string, evidences rep.CombinedProtein
// create result file
file, e := os.Create(output)
if e != nil {
msg.WriteFile(e, "error")
msg.WriteFile(e, "fatal")
}
defer file.Close()

Expand Down Expand Up @@ -464,7 +464,7 @@ func saveProteinAbacusResult(session, plex string, evidences rep.CombinedProtein
} else if plex == "18" {
chs = append(chs, "126", "127N", "127C", "128N", "128C", "129N", "129C", "130N", "130C", "131N", "131C", "132N", "132C", "133N", "133C", "134N", "134C", "135N")
} else {
msg.Custom(errors.New("unsupported number of labels"), "fatal")
msg.Custom(errors.New("unsupported number of labels"), "error")
}

if hasLabels {
Expand All @@ -486,7 +486,7 @@ func saveProteinAbacusResult(session, plex string, evidences rep.CombinedProtein
header += "\n"
_, e = io.WriteString(file, header)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

for _, i := range evidences {
Expand Down Expand Up @@ -631,7 +631,7 @@ func saveProteinAbacusResult(session, plex string, evidences rep.CombinedProtein
line += "\n"
_, e := io.WriteString(file, line)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

}
Expand All @@ -651,7 +651,7 @@ func saveReprintSpCResults(session, plex string, evidences rep.CombinedProteinEv
// create result file
file, e := os.Create(output)
if e != nil {
msg.WriteFile(errors.New("cannot create reprint SpC report"), "error")
msg.WriteFile(errors.New("cannot create reprint SpC report"), "fatal")
}
defer file.Close()

Expand All @@ -672,7 +672,7 @@ func saveReprintSpCResults(session, plex string, evidences rep.CombinedProteinEv

_, e = io.WriteString(file, line)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

// organize by group number
Expand All @@ -691,7 +691,7 @@ func saveReprintSpCResults(session, plex string, evidences rep.CombinedProteinEv
line += "\n"
_, e := io.WriteString(file, line)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

}
Expand All @@ -710,7 +710,7 @@ func saveReprintIntResults(session, plex string, evidences rep.CombinedProteinEv
// create result file
file, e := os.Create(output)
if e != nil {
msg.WriteFile(errors.New("cannot create reprint Int. report"), "error")
msg.WriteFile(errors.New("cannot create reprint Int. report"), "fatal")
}
defer file.Close()

Expand All @@ -731,7 +731,7 @@ func saveReprintIntResults(session, plex string, evidences rep.CombinedProteinEv

_, e = io.WriteString(file, line)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

// organize by group number
Expand All @@ -750,7 +750,7 @@ func saveReprintIntResults(session, plex string, evidences rep.CombinedProteinEv
line += "\n"
_, e := io.WriteString(file, line)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

}
Expand Down
12 changes: 6 additions & 6 deletions lib/aba/psm.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func psmLevelAbacus(m met.Data, args []string) {

file, e := os.Open(annot)
if e != nil {
msg.ReadFile(errors.New("cannot open annotation file"), "error")
msg.ReadFile(errors.New("cannot open annotation file"), "fatal")
}
defer file.Close()

Expand All @@ -57,7 +57,7 @@ func psmLevelAbacus(m met.Data, args []string) {
}

if e = scanner.Err(); e != nil {
msg.Custom(errors.New("the annotation file looks to be empty"), "fatal")
msg.Custom(errors.New("the annotation file looks to be empty"), "error")
}
}
}
Expand Down Expand Up @@ -122,7 +122,7 @@ func savePSMAbacusResult(session, plex string, evidences rep.CombinedPSMEvidence
// create result file
file, e := os.Create(output)
if e != nil {
msg.WriteFile(e, "error")
msg.WriteFile(e, "fatal")
}
defer file.Close()

Expand All @@ -144,7 +144,7 @@ func savePSMAbacusResult(session, plex string, evidences rep.CombinedPSMEvidence
} else if plex == "18" {
chs = append(chs, "126", "127N", "127C", "128N", "128C", "129N", "129C", "130N", "130C", "131N", "131C", "132N", "132C", "133N", "133C", "134N", "134C", "135N")
} else {
msg.Custom(errors.New("unsupported number of labels"), "fatal")
msg.Custom(errors.New("unsupported number of labels"), "error")
}

if hasLabels {
Expand All @@ -164,7 +164,7 @@ func savePSMAbacusResult(session, plex string, evidences rep.CombinedPSMEvidence
header += "\n"
_, e = io.WriteString(file, header)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}

for _, i := range evidences {
Expand Down Expand Up @@ -267,7 +267,7 @@ func savePSMAbacusResult(session, plex string, evidences rep.CombinedPSMEvidence
line += "\n"
_, e := io.WriteString(file, line)
if e != nil {
msg.WriteToFile(e, "fatal")
msg.WriteToFile(e, "error")
}
}

Expand Down
7 changes: 0 additions & 7 deletions lib/bio/bio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ func TestAminoAcids(t *testing.T) {

}

// func TestProtonMass(t *testing.T) {
// p := Proton
// if p != float64(1.007276) {
// t.Errorf("Proton mass is incorrect, got %f, want %f", p, 1.007276)
// }
// }

func TestEnzymes(t *testing.T) {

tes.SetupTestEnv()
Expand Down
Loading

0 comments on commit c4d2fcc

Please sign in to comment.