Skip to content

Commit

Permalink
fixing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe da Veiga Leprevost committed May 18, 2020
1 parent df350d1 commit 42b2ee8
Show file tree
Hide file tree
Showing 24 changed files with 72 additions and 70 deletions.
2 changes: 1 addition & 1 deletion cmd/bioquant.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var bioquantCmd = &cobra.Command{
// run clustering
qua.RunBioQuantification(m)

// store paramters on meta data
// store parameters on meta data
m.Serialize()

// clean tmp
Expand Down
2 changes: 1 addition & 1 deletion cmd/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var databaseCmd = &cobra.Command{

m = dat.Run(m)

// store paramters on meta data
// store parameters on meta data
m.Serialize()

msg.Done()
Expand Down
2 changes: 1 addition & 1 deletion cmd/freequant.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var freequant = &cobra.Command{
// run label-free quantification
qua.RunLabelFreeQuantification(m.Quantify)

// store paramters on meta data
// store parameters on meta data
m.Serialize()

// clean tmp
Expand Down
2 changes: 1 addition & 1 deletion cmd/labelquant.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var labelquantCmd = &cobra.Command{

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

// store paramters on meta data
// store parameters on meta data
m.Serialize()

// clean tmp
Expand Down
2 changes: 1 addition & 1 deletion cmd/proproph.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func init() {
proprophCmd.Flags().BoolVarP(&m.ProteinProphet.Fpkm, "fpkm", "", false, "model protein FPKM values")
proprophCmd.Flags().BoolVarP(&m.ProteinProphet.NonSP, "nonsp", "", false, "do not use NSP model")
proprophCmd.Flags().IntVarP(&m.ProteinProphet.Minindep, "minindep", "", 0, "minimum percentage of independent peptides required for a protein")
proprophCmd.Flags().Float64VarP(&m.ProteinProphet.Minprob, "minprob", "", 0.05, "PeptideProphet probabilty threshold")
proprophCmd.Flags().Float64VarP(&m.ProteinProphet.Minprob, "minprob", "", 0.05, "PeptideProphet probability threshold")
proprophCmd.Flags().IntVarP(&m.ProteinProphet.Maxppmdiff, "maxppmdiff", "", 2000000, "maximum peptide mass difference in ppm")
proprophCmd.Flags().BoolVarP(&m.ProteinProphet.Accuracy, "accuracy", "", false, "equivalent to --minprob 0")
proprophCmd.Flags().BoolVarP(&m.ProteinProphet.Normprotlen, "normprotlen", "", false, "normalize NSP using protein length")
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "philosopher",
Short: "philospher: a proteomics data analysis toolkit",
Short: "philosopher: a proteomics data analysis toolkit",
Long: "Philosopher: A toolkit for Proteomics data analysis and post-processing filtering",
}

Expand Down
14 changes: 9 additions & 5 deletions lib/dat/dat.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,14 @@ func (d *Base) Deploy(temp string) {

d.CrapDB = fmt.Sprintf("%s%scrap.fas", temp, string(filepath.Separator))

param, e := Asset("crap.fas")
e = ioutil.WriteFile(d.CrapDB, param, sys.FilePermission())
if e != nil {
msg.WriteFile(e, "fatal")
param, e1 := Asset("crap.fas")
if e1 != nil {
msg.WriteFile(e1, "fatal")
}

e2 := ioutil.WriteFile(d.CrapDB, param, sys.FilePermission())
if e2 != nil {
msg.WriteFile(e2, "fatal")
}

return
Expand Down Expand Up @@ -314,7 +318,7 @@ func (d *Base) Save(home, temp, tag string, isRev, hasIso, noD, Crap bool) strin
return outfile
}

// Serialize saves to disk a msgpack verison of the database data structure
// Serialize saves to disk a msgpack version of the database data structure
func (d *Base) Serialize() {

b, e := msgpack.Marshal(&d)
Expand Down
5 changes: 3 additions & 2 deletions lib/ext/comet/comet.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import (
"path/filepath"
"strings"

"github.com/sirupsen/logrus"
ucomet "philosopher/lib/ext/comet/unix"
wcomet "philosopher/lib/ext/comet/win"
"philosopher/lib/met"
"philosopher/lib/msg"
"philosopher/lib/sys"

"github.com/sirupsen/logrus"
)

// Comet represents the tool configuration
Expand Down Expand Up @@ -132,7 +133,7 @@ func (c *Comet) Deploy(os, arch string) {
return
}

// Execute is the main fucntion to execute Comet
// Execute is the main function to execute Comet
func (c *Comet) Execute(cmdArgs []string, param string) {

par := fmt.Sprintf("-P%s", param)
Expand Down
11 changes: 5 additions & 6 deletions lib/ext/comet/unix/unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ func UnixParameterFile(unixParam string) {

param, e1 := Asset("comet.params")
if e1 != nil {
msg.DeployAsset(errors.New("Unimod"), "Cannot read Comet parameter bin")
} else {
msg.DeployAsset(errors.New("Comet Parameter File"), "Cannot read Comet parameter bin")
}

e2 := ioutil.WriteFile(unixParam, param, sys.FilePermission())
if e2 != nil {
msg.DeployAsset(errors.New("Unimod"), "Cannot deploy Comet parameter")
}
e2 := ioutil.WriteFile(unixParam, param, sys.FilePermission())
if e2 != nil {
msg.DeployAsset(errors.New("Comet Parameter File"), "Cannot deploy Comet parameter")
}

return
Expand Down
12 changes: 6 additions & 6 deletions lib/ext/comet/win/win.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
// WinParameterFile writes the parameter file to the disk
func WinParameterFile(winParam string) {

param, e := Asset("comet.params.txt")
if e != nil {
msg.DeployAsset(errors.New("Comet parameter file"), "fatal")
param, e1 := Asset("comet.params.txt")
if e1 != nil {
msg.DeployAsset(errors.New("Comet Parameter File"), "Cannot read Comet parameter bin")
}

e = ioutil.WriteFile(winParam, param, sys.FilePermission())
if e != nil {
msg.DeployAsset(errors.New("Comet parameter file"), "fatal")
e2 := ioutil.WriteFile(winParam, param, sys.FilePermission())
if e2 != nil {
msg.DeployAsset(errors.New("Comet Parameter File"), "Cannot deploy Comet parameter")
}

return
Expand Down
33 changes: 21 additions & 12 deletions lib/ext/interprophet/win/win.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ import (
// WinInterProphetParser accessor
func WinInterProphetParser(s string) {

bin, e := Asset("InterProphetParser.exe")
e = ioutil.WriteFile(s, bin, sys.FilePermission())
bin, e1 := Asset("InterProphetParser.exe")
if e1 != nil {
msg.DeployAsset(errors.New("InterProphetParser.exe"), "Cannot read InterProphetParser.exe bin")
}

if e != nil {
msg.DeployAsset(errors.New("InterProphetParser"), "trace")
e2 := ioutil.WriteFile(s, bin, sys.FilePermission())
if e2 != nil {
msg.DeployAsset(errors.New("InterProphetParser.exe"), "Cannot deploy InterProphetParser.exe")
}

return
Expand All @@ -25,11 +28,14 @@ func WinInterProphetParser(s string) {
// LibgccDLL accessor
func LibgccDLL(s string) {

bin, e := Asset("libgcc_s_dw2-1.dll")
e = ioutil.WriteFile(s, bin, sys.FilePermission())
bin, e1 := Asset("libgcc_s_dw2-1.dll")
if e1 != nil {
msg.DeployAsset(errors.New("LibgccDLL"), "Cannot read LibgccDLL bin")
}

if e != nil {
msg.DeployAsset(errors.New("libgcc_s_dw2"), "trace")
e2 := ioutil.WriteFile(s, bin, sys.FilePermission())
if e2 != nil {
msg.DeployAsset(errors.New("LibgccDLL"), "Cannot deploy LibgccDLL")
}

return
Expand All @@ -38,11 +44,14 @@ func LibgccDLL(s string) {
// Zlib1DLL accessor
func Zlib1DLL(s string) {

bin, e := Asset("zlib1.dll")
e = ioutil.WriteFile(s, bin, sys.FilePermission())
bin, e1 := Asset("zlib1.dll")
if e1 != nil {
msg.DeployAsset(errors.New("Zlib1DLL"), "Cannot read Zlib1DLL bin")
}

if e != nil {
msg.DeployAsset(errors.New("Zlib1DLL"), "trace")
e2 := ioutil.WriteFile(s, bin, sys.FilePermission())
if e2 != nil {
msg.DeployAsset(errors.New("Zlib1DLL"), "Cannot deploy Zlib1DLL")
}

return
Expand Down
4 changes: 2 additions & 2 deletions lib/ext/msfragger/msfragger.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Run(m met.Data, args []string) met.Data {
return m
}

// Execute is the main fucntion to execute MSFragger
// Execute is the main function to execute MSFragger
func (c *MSFragger) Execute(params met.MSFragger, cmdArgs []string) {

cmd := appendParams(params)
Expand All @@ -79,7 +79,7 @@ func (c *MSFragger) Execute(params met.MSFragger, cmdArgs []string) {
return
}

// ExecutewithParameter is the main fucntion to execute MSFragger
// ExecutewithParameter is the main function to execute MSFragger
func (c *MSFragger) ExecutewithParameter(params met.MSFragger, cmdArgs []string) {

mem := fmt.Sprintf("-Xmx%dG", params.Memory)
Expand Down
2 changes: 1 addition & 1 deletion lib/ext/proteinprophet/proteinprophet.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (p ProteinProphet) appendParams(params met.ProteinProphet, cmd *exec.Cmd) *

// // there is an error in the way how the modified version was implemented.
// // The mod version is *always* active, and the tag makes it normal again.
// // it should be the oposite, so thats why this block looks like that.
// // it should be the opposite, so thats why this block looks like that.
// if c.Excludemods == true {
// // the program is always trying to process os'es
// //cmd.Args = append(cmd.Args, "ALLOWDIFFPROBS")
Expand Down
2 changes: 1 addition & 1 deletion lib/ext/tmtintegrator/tmtintegrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Run(m met.Data, args []string) met.Data {
return m
}

// Execute is the main fucntion to execute TMTIntegrator
// Execute is the main function to execute TMTIntegrator
func (c *TMTIntegrator) Execute(params met.TMTIntegrator, cmdArgs []string) {

cmd := appendParams(params)
Expand Down
2 changes: 1 addition & 1 deletion lib/fil/fdr.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ func mirrorProteinList(p id.ProtIDList, decoyTag string) id.ProtIDList {
}

// add decoys correspondent to the given targets.
// first check if the oposite list doesn't have an entry already.
// first check if the opposite list doesn't have an entry already.
// if not, search for the mirror entry on the original list, if found
// move it to the mirror list, otherwise add fake entry.
for _, k := range list {
Expand Down
8 changes: 4 additions & 4 deletions lib/fil/fil.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func chargeProfile(p id.PepIDList, charge uint8, decoyTag string) (t, d int) {
return t, d
}

//GetUniquePSMs selects only unique pepetide ions for the given data stucture
//GetUniquePSMs selects only unique pepetide ions for the given data structure
func GetUniquePSMs(p id.PepIDList) map[string]id.PepIDList {

uniqMap := make(map[string]id.PepIDList)
Expand All @@ -440,7 +440,7 @@ func GetUniquePSMs(p id.PepIDList) map[string]id.PepIDList {
return uniqMap
}

//getUniquePeptideIons selects only unique pepetide ions for the given data stucture
//getUniquePeptideIons selects only unique pepetide ions for the given data structure
func getUniquePeptideIons(p id.PepIDList) map[string]id.PepIDList {

uniqMap := ExtractIonsFromPSMs(p)
Expand All @@ -466,7 +466,7 @@ func ExtractIonsFromPSMs(p id.PepIDList) map[string]id.PepIDList {
return uniqMap
}

// GetUniquePeptides selects only unique pepetide for the given data stucture
// GetUniquePeptides selects only unique pepetide for the given data structure
func GetUniquePeptides(p id.PepIDList) map[string]id.PepIDList {

uniqMap := make(map[string]id.PepIDList)
Expand Down Expand Up @@ -566,7 +566,7 @@ func processProteinIdentifications(p id.ProtXML, ptFDR, pepProb, protProb float6
}

// processProteinInferenceIdentifications checks if pickedFDR ar razor options should be applied to given data set, if they do,
// the inputed Philospher inference data is processed before filtered.
// the inputed Philosopher inference data is processed before filtered.
func processProteinInferenceIdentifications(psm id.PepIDList, razorMap map[string]string, coverMap map[string]float64, ptFDR, pepProb, protProb float64, isPicked bool, decoyTag string) {

var t int
Expand Down
8 changes: 4 additions & 4 deletions lib/fin/fin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1241,15 +1241,15 @@ func binaryread(r io.Reader, data interface{}) {
// data, and returns the position in the file afterwards
func readAt(rs io.ReadSeeker, pos uint64, v Version, data reader) uint64 {

spos, e := rs.Seek(int64(pos), 0)
if e != nil {
spos, e1 := rs.Seek(int64(pos), 0)
if e1 != nil {
msg.Custom(errors.New("error seeking file"), "fatal")
}

data.Read(rs, v)

spos, e = rs.Seek(0, 1)
if e != nil {
spos, e2 := rs.Seek(0, 1)
if e2 != nil {
msg.Custom(errors.New("error determining position in file"), "fatal")
}

Expand Down
7 changes: 0 additions & 7 deletions lib/id/pep.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,31 +325,24 @@ func processSpectrumQuery(sq spc.SpectrumQuery, massDeviation float64, mods mod.
} else if string(j.Name) == "xcorr" {
value, _ := strconv.ParseFloat(j.Value, 64)
psm.Xcorr = value
value = -99
} else if string(j.Name) == "deltacn" {
value, _ := strconv.ParseFloat(j.Value, 64)
psm.DeltaCN = value
value = -99
} else if string(j.Name) == "deltacnstar" {
value, _ := strconv.ParseFloat(j.Value, 64)
psm.DeltaCNStar = value
value = -99
} else if string(j.Name) == "spscore" {
value, _ := strconv.ParseFloat(j.Value, 64)
psm.SPScore = value
value = -99
} else if string(j.Name) == "sprank" {
value, _ := strconv.ParseFloat(j.Value, 64)
psm.SPRank = value
value = -99
} else if string(j.Name) == "hyperscore" {
value, _ := strconv.ParseFloat(j.Value, 64)
psm.Hyperscore = value
value = -99
} else if string(j.Name) == "nextscore" {
value, _ := strconv.ParseFloat(j.Value, 64)
psm.Nextscore = value
value = -99
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/psi/mzid.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,14 @@ type FilterType struct {
UserParam []UserParam `xml:"userParam"`
}

// Include is all sequences fulfilling the specifed criteria are included
// Include is all sequences fulfilling the specified criteria are included
type Include struct {
XMLName xml.Name `xml:"Include"`
CVParam []CVParam `xml:"cvParam"`
UserParam []UserParam `xml:"userParam"`
}

// Exclude all sequences fulfilling the specifed criteria are excluded
// Exclude all sequences fulfilling the specified criteria are excluded
type Exclude struct {
XMLName xml.Name `xml:"Exclude"`
CVParam []CVParam `xml:"cvParam"`
Expand Down
2 changes: 1 addition & 1 deletion lib/qua/bqt.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func execute(level float64) (string, string) {
cd.ClusterFasta = cd.FileName + ".fasta"
cd.ClusterFile = cd.ClusterFasta + ".clstr"

// deploy binary and paramter to workdir
// deploy binary and parameter to workdir
cd.Deploy()

// run cdhit and create the clusters
Expand Down
2 changes: 1 addition & 1 deletion lib/qua/iso.go
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ func NormToTotalProteins(evi rep.Evidence) rep.Evidence {
channelSum[15] += i.URazorLabels.Channel16.Intensity
}

// find the higest value amongst channels
// find the highest value amongst channels
for _, i := range channelSum {
if i > topValue {
topValue = i
Expand Down
Loading

0 comments on commit 42b2ee8

Please sign in to comment.