fixed too many partial CDS bug

Former-commit-id: d733a46f4e92f755f38e452f03a28062de6739f1
Former-commit-id: 36bdc324d2b9a0491d07d40a7e68a4cf7ea73984
This commit is contained in:
alain viari
2015-11-10 22:15:01 +01:00
parent 262995a486
commit 9108ce75f1
530 changed files with 83 additions and 7 deletions

View File

@ -34,12 +34,12 @@ endif
Notify "get genome info from $RefFile"
$AwkCmd -f $LIB_DIR/$RefType.oneliner.awk $RefFile |\
$AwkCmd -f $LIB_DIR/libutil.awk -f $LIB_DIR/$RefType.cds.awk > R_$$
$AwkCmd -f $LIB_DIR/libutil.awk -f $LIB_DIR/$RefType.cds_short.awk > R_$$
Notify "get prediction info from $PrdFile"
$AwkCmd -f $LIB_DIR/$PrdType.oneliner.awk $PrdFile |\
$AwkCmd -f $LIB_DIR/libutil.awk -f $LIB_DIR/$PrdType.cds.awk > P_$$
$AwkCmd -f $LIB_DIR/libutil.awk -f $LIB_DIR/$PrdType.cds_short.awk > P_$$
#
# compare

View File

@ -2,6 +2,40 @@
# utilities library
#
END {
if (_ForceExit_) exit(_ForceExit_)
}
function Notify(key, msg) {
print "# " key " " msg >> "/dev/stderr"
}
function Info(msg) {
Notify("info", msg)
return 1
}
function Warning(msg) {
Notify("warning", msg)
return 0
}
function Exit(status) {
exit(_ForceExit_ = status)
}
function Error(msg, status) {
Notify("error", msg)
Exit(status ? status : 1)
}
function Assert(condition, msg, status) {
if (! condition) {
msg = FILENAME ":" FNR ": " msg
return status ? Error(msg, status) : Warning(msg)
}
}
function Min(a, b) {
return (a < b ? a : b)
}
@ -10,6 +44,24 @@ function Max(a, b) {
return (a > b ? a : b)
}
function Trim(s, regexp) {
if (regexp == 0) regexp = "[ \t]+"
gsub("^" regexp "|" regexp "$", "", s)
return s
}
function TestPath(path, test, _local_, stat) {
if (test == 0) test = "-f"
if (Trim(path) == "")
return 0 # because of a bug in 'test'
gsub(" ", "\\ ", path) # protect spaces
stat = system("test " test " " path)
return stat ? 0 : 1
}
# ---
function Strip(s) {
gsub("complement|join|order|\\)|\\(|<|>| ", "", s)
return s
@ -106,6 +158,30 @@ function GeneFamily(s) {
return s
}
# ---
function ReadFasta(file, _local_, seq, context) {
context = $0
seq = ""
getline < file
while(getline < file) seq = seq "" $0
$0 = context
return seq
}
function PrintFasta(seq, name, CharPerLine, _local_, i, len, rest, chunk) {
if (CharPerLine <= 0) CharPerLine = 60
print ">" name
len = length(seq)
rest = len % CharPerLine
chunk = (len - rest) / CharPerLine
for (i = 0 ; i < chunk ; i++)
print substr(seq, (i*CharPerLine) + 1, CharPerLine)
if (rest != 0)
print substr(seq, (chunk*CharPerLine) + 1, rest)
}
#
# constants
#