Skip to content

Commit

Permalink
Merge pull request #360 from Nesvilab/v4.2.2
Browse files Browse the repository at this point in the history
V4.2.2
  • Loading branch information
Felipe da Veiga Leprevost committed May 27, 2022
2 parents ed6e57f + 4dc0774 commit 3ec05f4
Show file tree
Hide file tree
Showing 26 changed files with 439 additions and 211 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.15
- name: Set up Go 1.18
uses: actions/setup-go@v1
with:
go-version: 1.15
go-version: 1.18
id: go

- name: Check out code into the Go module directory
Expand All @@ -34,9 +34,6 @@ jobs:
unzip -o lib/ext/ptmprophet/win/bindata.go.zip -d lib/ext/ptmprophet/win/
unzip -o lib/ext/proteinprophet/unix/bindata.go.zip -d lib/ext/proteinprophet/unix/
unzip -o lib/ext/proteinprophet/win/bindata.go.zip -d lib/ext/proteinprophet/win/
unzip -o lib/ext/rawfilereader/deb64/bindata.go.zip -d lib/ext/rawfilereader/deb64/
unzip -o lib/ext/rawfilereader/reh64/bindata.go.zip -d lib/ext/rawfilereader/reh64/
unzip -o lib/ext/rawfilereader/win/bindata.go.zip -d lib/ext/rawfilereader/win/
unzip -o lib/pip/bindata.go.zip -d lib/pip/
unzip -o lib/dat/bindata.go.zip -d lib/dat/
unzip -o lib/obo/unimod/bindata.go.zip -d lib/obo/unimod/
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*.a
*.so

Makefile
philosopher

# Folders
Expand Down
15 changes: 5 additions & 10 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
### Added
- Added support for TMT 18
- Added option for contaminant tags in the database.

### Changed
- Added the parsing rules from the Prophets to the protein description.
- Removed RawReader because of licensing issues.
- Improved processing speed and resource usage.
- Reduced binariy size.
- Decoys tag now appear inthe Gene and ProteinID
- Support for TAIR database
- Support for neXtProt database
- Support for MSBooster scores which now appear in the PSM table

### Fixed
- Several bugs and code fizes added.
- Fixed issue with TMT 6 plex quantification.
- Minor bugs andd issues were fixed
71 changes: 71 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
SOURCEDIR=.
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')

BINARY = philosopher

VERSION = $(shell date +%Y%m%d)
BUILD = $(shell date +%Y%m%d%H%M)

TAG = v4.2.2

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

.DEFAULT_GOAL: $(BINARY)

$(BINARY): $(SOURCES)
go build ${LDFLAGS} -o ${BINARY} main.go

.PHONY: deploy
deploy:
unzip -o lib/dat/bindata.go.zip -d lib/dat/

unzip -o lib/ext/cdhit/unix/bindata.go.zip -d lib/ext/cdhit/unix/
unzip -o lib/ext/cdhit/win/bindata.go.zip -d lib/ext/cdhit/win/

unzip -o lib/ext/comet/unix/bindata.go.zip -d lib/ext/comet/unix/
unzip -o lib/ext/comet/win/bindata.go.zip -d lib/ext/comet/win/rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz
unzip -o lib/ext/rawfilereader/reh64/bindata.go.zip -d lib/ext/rawfilereader/reh64/
unzip -o lib/ext/rawfilereader/win/bindata.go.zip -d lib/ext/rawfilereader/win/

unzip -o lib/pip/bindata.go.zip -d lib/pip/

unzip -o lib/dat/bindata.go.zip -d lib/dat/

unzip -o lib/obo/unimod/bindata.go.zip -d lib/obo/unimod/

.PHONY: test
test:
go test ./... -v

.PHONY: rc
rc:
env CGO_ENABLED=0 gox -os="linux" ${LDFLAGS} -arch=amd64 -output philosopher-${TAG}-RC
env CGO_ENABLED=0 gox -os="windows" ${LDFLAGS} -arch=amd64 -output philosopher-${TAG}-RC
mv philosopher-${TAG}-RC ~/bin/
mv philosopher-${TAG}-RC.exe ~/bin/

.PHONY: linux
linux:
env CGO_ENABLED=0 gox -os="linux" ${LDFLAGS} -arch=amd64 -output philosopher

.PHONY: windows
windows:
env CGO_ENABLED=0 gox -os="windows" ${LDFLAGS} -arch=amd64 -output philosopher

.PHONY: all
all:
env CGO_ENABLED=0 gox -os="linux" ${LDFLAGS} -arch=amd64 -output philosopher
env CGO_ENABLED=0 gox -os="windows" ${LDFLAGS} -arch=amd64 -output philosopher

.PHONY: draft
draft:
goreleaser --skip-publish --snapshot --release-notes=Changelog --rm-dist

.PHONY: push
push:
git tag -a ${TAG} -m "Philosopher ${TAG}"
git push origin master -f --tags

.PHONY: release
release:
goreleaser --release-notes=Changelog --rm-dist
6 changes: 5 additions & 1 deletion cmd/freequant.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ var freequant = &cobra.Command{
msg.InputNotFound(errors.New("unknown file format"), "fatal")
}

if m.Quantify.Raw {
msg.Custom(errors.New("support for Thermo raw files was temporarily removed, please convert your files to mzML"), "fatal")
}

//forcing the larger time window to be the same as the smaller one
//m.Quantify.RTWin = 3
m.Quantify.RTWin = m.Quantify.PTWin
Expand All @@ -64,7 +68,7 @@ func init() {
freequant.Flags().StringVarP(&m.Quantify.Dir, "dir", "", "", "folder path containing the raw files")
freequant.Flags().Float64VarP(&m.Quantify.Tol, "tol", "", 10, "m/z tolerance in ppm")
freequant.Flags().Float64VarP(&m.Quantify.PTWin, "ptw", "", 0.4, "specify the time windows for the peak (minute)")
//freequant.Flags().BoolVarP(&m.Quantify.Raw, "raw", "", false, "read raw files instead of converted XML")
freequant.Flags().BoolVarP(&m.Quantify.Raw, "raw", "", false, "read raw files instead of converted XML")
freequant.Flags().BoolVarP(&m.Quantify.Faims, "faims", "", false, "Use FAIMS information for the quantification")
}

Expand Down
6 changes: 5 additions & 1 deletion cmd/labelquant.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ var labelquantCmd = &cobra.Command{
msg.InputNotFound(errors.New("unknown file format"), "fatal")
}

if m.Quantify.Raw {
msg.Custom(errors.New("support for Thermo raw files was temporarily removed, please convert your files to mzML"), "fatal")
}

m.Quantify = qua.RunIsobaricLabelQuantification(m.Quantify, m.Filter.Mapmods)

// store parameters on meta data
Expand Down Expand Up @@ -72,7 +76,7 @@ func init() {
labelquantCmd.Flags().Float64VarP(&m.Quantify.RemoveLow, "removelow", "", 0.0, "ignore the lower % of PSMs based on their summed abundances. 0 means no removal, entry value must be a decimal")
labelquantCmd.Flags().BoolVarP(&m.Quantify.Unique, "uniqueonly", "", false, "report quantification based only on unique peptides")
labelquantCmd.Flags().BoolVarP(&m.Quantify.BestPSM, "bestpsm", "", false, "select the best PSMs for protein quantification")
//labelquantCmd.Flags().BoolVarP(&m.Quantify.Raw, "raw", "", false, "read raw files instead of converted XML")
labelquantCmd.Flags().BoolVarP(&m.Quantify.Raw, "raw", "", false, "read raw files instead of converted XML")

}

Expand Down
8 changes: 1 addition & 7 deletions lib/aba/pro.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func saveProteinAbacusResult(session string, evidences rep.CombinedProteinEviden
}
defer file.Close()

header := "Protein\tProtein ID\tEntry Name\tGene\tProtein Length\tCoverage\tOrganism\tProtein Existence\tDescription\tProtein Probability\tTop Peptide Probability\tCombined Total Peptides\tCombined Spectral Count\tCombined Unique Spectral Count\tCombined Total Spectral Count"
header := "Protein\tProtein ID\tEntry Name\tGene\tProtein Length\tOrganism\tProtein Existence\tDescription\tProtein Probability\tTop Peptide Probability\tCombined Total Peptides\tCombined Spectral Count\tCombined Unique Spectral Count\tCombined Total Spectral Count"

// Add Unique+Razor SPC
for _, i := range namesList {
Expand Down Expand Up @@ -492,8 +492,6 @@ func saveProteinAbacusResult(session string, evidences rep.CombinedProteinEviden

line += fmt.Sprintf("%d\t", i.Length)

line += fmt.Sprintf("%.2f\t", i.Coverage)

line += fmt.Sprintf("%s\t", i.Organism)

line += fmt.Sprintf("%s\t", i.ProteinExistence)
Expand All @@ -512,10 +510,6 @@ func saveProteinAbacusResult(session string, evidences rep.CombinedProteinEviden

line += fmt.Sprintf("%d\t", summTotalSpC[i.ProteinID])

//line += fmt.Sprintf("%d\t", len(razorPeptides[i.ProteinID]))

//line += fmt.Sprintf("%d\t", len(uniquePeptides[i.ProteinID]))

// Add Unique+Razor SPC
for _, j := range namesList {
line += fmt.Sprintf("%d\t", i.UrazorSpc[j])
Expand Down
10 changes: 10 additions & 0 deletions lib/dat/dat.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ func (d *Base) ProcessDB(file, decoyTag string) {
db := ProcessUniRef(k, v, decoyTag)
d.Records = append(d.Records, db)

} else if class == "tair" {

db := ProcessTair(k, v, decoyTag)
d.Records = append(d.Records, db)

} else if class == "nextprot" {

db := ProcessNextProt(k, v, decoyTag)
d.Records = append(d.Records, db)

} else {
msg.ParsingFASTA(errors.New(""), "fatal")
}
Expand Down
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) != 20361 {
t.Errorf("Number of FASTA entries is incorrect, got %d, want %d", len(d.Records), 20360)
if len(d.Records) != 20371 {
t.Errorf("Number of FASTA entries is incorrect, got %d, want %d", len(d.Records), 20371)
}
})
}
Expand Down
Loading

0 comments on commit 3ec05f4

Please sign in to comment.