-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.go
More file actions
25 lines (24 loc) · 1.06 KB
/
Copy pathcheck.go
File metadata and controls
25 lines (24 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* check.go provides checks for the phageLog project
* confirms logical inputs, making fact checking easier for the poeple
*/
package main
// check basic properties of the start and stop values
// input: implicit parameter g, a *Gene
// return: a string explanation of error, or empty string if no error
func (g *Gene) checkSSC() string {
// if it's forward, then the differnce between stop and start + 1 should be a multiple of three
// if it's reverse, then the difference between start and stop + 1 should be a multiple of three
if (g.forward && ( (g.length()%3) != 0)) || (!g.forward && (g.length())%3 != 0) {
// error("Length must be a multiple of 3.")
return "Error: Length must be a multiple of 3."
}
if g.forward && g.start > g.stop {
// error("For a forward gene, start must be less than stop."
return "For a forward gene, start must be less than stop."
}
if !g.forward && g.stop > g.start {
// error("For a reverse gene, stop must be less than start."
return "For a reverse gene, stop must be less than start."
}
return " "
}