From 42b2ee89bf6bd38f76737b816b178658a6ab5a68 Mon Sep 17 00:00:00 2001 From: Felipe da Veiga Leprevost Date: Mon, 18 May 2020 10:41:58 -0400 Subject: [PATCH] fixing typos --- cmd/bioquant.go | 2 +- cmd/database.go | 2 +- cmd/freequant.go | 2 +- cmd/labelquant.go | 2 +- cmd/proproph.go | 2 +- cmd/root.go | 2 +- lib/dat/dat.go | 14 ++++++---- lib/ext/comet/comet.go | 5 ++-- lib/ext/comet/unix/unix.go | 11 ++++---- lib/ext/comet/win/win.go | 12 ++++----- lib/ext/interprophet/win/win.go | 33 +++++++++++++++--------- lib/ext/msfragger/msfragger.go | 4 +-- lib/ext/proteinprophet/proteinprophet.go | 2 +- lib/ext/tmtintegrator/tmtintegrator.go | 2 +- lib/fil/fdr.go | 2 +- lib/fil/fil.go | 8 +++--- lib/fin/fin.go | 8 +++--- lib/id/pep.go | 7 ----- lib/psi/mzid.go | 4 +-- lib/qua/bqt.go | 2 +- lib/qua/iso.go | 2 +- lib/rep/mzid.go | 8 ++---- lib/rep/protein.go | 2 +- lib/uti/uti.go | 4 +-- 24 files changed, 72 insertions(+), 70 deletions(-) diff --git a/cmd/bioquant.go b/cmd/bioquant.go index 7d4868f5..8f511cfd 100644 --- a/cmd/bioquant.go +++ b/cmd/bioquant.go @@ -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 diff --git a/cmd/database.go b/cmd/database.go index d39c9638..ba164096 100644 --- a/cmd/database.go +++ b/cmd/database.go @@ -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() diff --git a/cmd/freequant.go b/cmd/freequant.go index 7c7d7e59..ed22b7c8 100644 --- a/cmd/freequant.go +++ b/cmd/freequant.go @@ -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 diff --git a/cmd/labelquant.go b/cmd/labelquant.go index 5336438d..2213fd40 100644 --- a/cmd/labelquant.go +++ b/cmd/labelquant.go @@ -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 diff --git a/cmd/proproph.go b/cmd/proproph.go index e4d9256a..46f3ccb7 100644 --- a/cmd/proproph.go +++ b/cmd/proproph.go @@ -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") diff --git a/cmd/root.go b/cmd/root.go index 203e5531..b2b76db2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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", } diff --git a/lib/dat/dat.go b/lib/dat/dat.go index 657d10a5..3f54ea43 100644 --- a/lib/dat/dat.go +++ b/lib/dat/dat.go @@ -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 @@ -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) diff --git a/lib/ext/comet/comet.go b/lib/ext/comet/comet.go index e154fee0..e99a8968 100644 --- a/lib/ext/comet/comet.go +++ b/lib/ext/comet/comet.go @@ -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 @@ -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) diff --git a/lib/ext/comet/unix/unix.go b/lib/ext/comet/unix/unix.go index 97937ca0..c107bac9 100644 --- a/lib/ext/comet/unix/unix.go +++ b/lib/ext/comet/unix/unix.go @@ -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 diff --git a/lib/ext/comet/win/win.go b/lib/ext/comet/win/win.go index 9ef0341a..3f2115bc 100644 --- a/lib/ext/comet/win/win.go +++ b/lib/ext/comet/win/win.go @@ -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 diff --git a/lib/ext/interprophet/win/win.go b/lib/ext/interprophet/win/win.go index ed3e8bc8..7bdb69ba 100644 --- a/lib/ext/interprophet/win/win.go +++ b/lib/ext/interprophet/win/win.go @@ -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 @@ -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 @@ -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 diff --git a/lib/ext/msfragger/msfragger.go b/lib/ext/msfragger/msfragger.go index 4b5f9bda..328eda13 100644 --- a/lib/ext/msfragger/msfragger.go +++ b/lib/ext/msfragger/msfragger.go @@ -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) @@ -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) diff --git a/lib/ext/proteinprophet/proteinprophet.go b/lib/ext/proteinprophet/proteinprophet.go index f47f870d..24ec3987 100644 --- a/lib/ext/proteinprophet/proteinprophet.go +++ b/lib/ext/proteinprophet/proteinprophet.go @@ -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") diff --git a/lib/ext/tmtintegrator/tmtintegrator.go b/lib/ext/tmtintegrator/tmtintegrator.go index afd55e8a..1f8006fc 100644 --- a/lib/ext/tmtintegrator/tmtintegrator.go +++ b/lib/ext/tmtintegrator/tmtintegrator.go @@ -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) diff --git a/lib/fil/fdr.go b/lib/fil/fdr.go index e2eb0ad7..0f6d6895 100644 --- a/lib/fil/fdr.go +++ b/lib/fil/fdr.go @@ -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 { diff --git a/lib/fil/fil.go b/lib/fil/fil.go index 8a808505..bba5f0ec 100644 --- a/lib/fil/fil.go +++ b/lib/fil/fil.go @@ -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) @@ -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) @@ -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) @@ -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 diff --git a/lib/fin/fin.go b/lib/fin/fin.go index 0515525f..818ee1dd 100644 --- a/lib/fin/fin.go +++ b/lib/fin/fin.go @@ -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") } diff --git a/lib/id/pep.go b/lib/id/pep.go index 419f7cbd..c4611d69 100644 --- a/lib/id/pep.go +++ b/lib/id/pep.go @@ -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 } } diff --git a/lib/psi/mzid.go b/lib/psi/mzid.go index abf91931..a0169c7d 100644 --- a/lib/psi/mzid.go +++ b/lib/psi/mzid.go @@ -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"` diff --git a/lib/qua/bqt.go b/lib/qua/bqt.go index 7f395c52..12d1a7d0 100644 --- a/lib/qua/bqt.go +++ b/lib/qua/bqt.go @@ -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 diff --git a/lib/qua/iso.go b/lib/qua/iso.go index 677f3baa..e24a160b 100644 --- a/lib/qua/iso.go +++ b/lib/qua/iso.go @@ -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 diff --git a/lib/rep/mzid.go b/lib/rep/mzid.go index 0200d3cb..60523ac9 100644 --- a/lib/rep/mzid.go +++ b/lib/rep/mzid.go @@ -17,7 +17,7 @@ func (e Evidence) MzIdentMLReport(version, database string) { var mzid psi.MzIdentML t := time.Now() - var idCounter = 0 + //var idCounter = 0 // collect source file names var sourceMap = make(map[string]uint8) @@ -168,7 +168,7 @@ func (e Evidence) MzIdentMLReport(version, database string) { mzid.AuditCollection = *auditCol // SequenceCollection - DBSequence - idCounter = 0 + idCounter := 0 var seqs []psi.DBSequence for _, i := range dtb.Records { @@ -200,7 +200,6 @@ func (e Evidence) MzIdentMLReport(version, database string) { seqs = append(seqs, *db) } mzid.SequenceCollection.DBSequence = seqs - seqs = nil // SequenceCollection - Peptide var peps []psi.Peptide @@ -240,7 +239,6 @@ func (e Evidence) MzIdentMLReport(version, database string) { peps = append(peps, p) } mzid.SequenceCollection.Peptide = peps - peps = nil // SequenceCollection - PeptideEvidence var pevs []psi.PeptideEvidence @@ -262,7 +260,6 @@ func (e Evidence) MzIdentMLReport(version, database string) { pevs = append(pevs, evi) } mzid.SequenceCollection.PeptideEvidence = pevs - pevs = nil // AnalysisCollection idCounter = 0 @@ -651,7 +648,6 @@ func (e Evidence) MzIdentMLReport(version, database string) { // DataCollection dta := psi.DataCollection{} - idCounter = 0 for _, i := range sources { sf := &psi.SourceFile{ ID: i, diff --git a/lib/rep/protein.go b/lib/rep/protein.go index 16447d2b..bac5585f 100644 --- a/lib/rep/protein.go +++ b/lib/rep/protein.go @@ -320,7 +320,7 @@ func (evi Evidence) MetaProteinReport(labels map[string]string, brand string, ch sort.Strings(obs) sort.Strings(ip) - // change between Unique+Razor and Unique only based on paramter defined on labelquant + // change between Unique+Razor and Unique only based on parameter defined on labelquant var reportIntensities [16]float64 if uniqueOnly == true || hasRazor == false { reportIntensities[0] = i.UniqueLabels.Channel1.Intensity diff --git a/lib/uti/uti.go b/lib/uti/uti.go index 5e30d47a..8a48652c 100644 --- a/lib/uti/uti.go +++ b/lib/uti/uti.go @@ -52,10 +52,10 @@ func ParseFloat(str string) (float64, error) { return val, nil } - //Some number may be seperated by comma, for example, 23,120,123, so remove the comma firstly + //Some number may be separated by comma, for example, 23,120,123, so remove the comma firstly str = strings.Replace(str, ",", "", -1) - //Some number is specifed in scientific notation + //Some number is specified in scientific notation pos := strings.IndexAny(str, "eE") if pos < 0 { return strconv.ParseFloat(str, 64)