Skip to content

Commit

Permalink
add genetic code 15
Browse files Browse the repository at this point in the history
  • Loading branch information
telatin committed Aug 24, 2023
1 parent b32056a commit ea4d14f
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 70 deletions.
2 changes: 1 addition & 1 deletion seqfu.nimble
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Package
version = "1.19.0"
version = "1.20.0"
author = "Andrea Telatin"
description = "SeqFu command-line tools"
license = "MIT"
Expand Down
21 changes: 8 additions & 13 deletions src/fu_orf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ proc length(self:FastxRecord): int =
## returns length of sequence
self.seq.len()

# proc `$`(s: FastxRecord): string =
# "@" & s.name & " " & s.comment & "\n" & s.seq & "\n+\n" & s.qual

iterator codons(self: FastxRecord) : string =
var i = 0
var s = self.seq.toUpperAscii
Expand Down Expand Up @@ -69,7 +66,7 @@ proc translate*(self:FastxRecord, code = 1): FastxRecord =
## translates a nucleotide sequence with the given genetic code number:
## https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi for codes
var codeMap =
["FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
["FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG", # 1: The Standard Code
"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSS**VVVVAAAADDEEGGGG",
"FFLLSSSSYY**CCWWTTTTPPPPHHQQRRRRIIMMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
Expand All @@ -78,11 +75,11 @@ proc translate*(self:FastxRecord, code = 1): FastxRecord =
"", "",
"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNNKSSSSVVVVAAAADDEEGGGG",
"FFLLSSSSYY**CCCWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
"FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
"FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG", # 11: The Bacterial, Archaeal and Plant Plastid Code
"FFLLSSSSYY**CC*WLLLSPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSSGGVVVVAAAADDEEGGGG",
"FFLLSSSSYYY*CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNNKSSSSVVVVAAAADDEEGGGG",
"",
"FFLLSSSSYY*QCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG", # 15 [Restored] Blepharisma Nuclear Code
"FFLLSSSSYY*LCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
"", "", "", "",
"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNNKSSSSVVVVAAAADDEEGGGG",
Expand Down Expand Up @@ -284,7 +281,7 @@ proc parseArraySingle(pool: seq[FastxRecord], opts: mergeCfg): string =


proc printCodes() =
echo """NCBI Genetics Codes:
echo """NCBI Genetic Codes:
1. The Standard Code
2. The Vertebrate Mitochondrial Code
Expand All @@ -298,6 +295,7 @@ proc printCodes() =
12. The Alternative Yeast Nuclear Code
13. The Ascidian Mitochondrial Code
14. The Alternative Flatworm Mitochondrial Code
15. The Blepharisma Nuclear Code [from v1.20.0]
16. Chlorophycean Mitochondrial Code
21. Trematode Mitochondrial Code
22. Scenedesmus obliquus Mitochondrial Code
Expand All @@ -316,6 +314,8 @@ See also: https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi"""

proc main(argv: var seq[string]): int =
let args = docopt("""
fu-orf - extract ORF from nucleotide sequences
Usage:
orf [options] <InputFile>
orf [options] -1 File_R1.fq
Expand Down Expand Up @@ -388,7 +388,7 @@ proc main(argv: var seq[string]): int =
quit(0)

let
validCodes = @[1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 16, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33]
validCodes = @[1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33]

if not validCodes.contains(code):
printCodes()
Expand All @@ -397,11 +397,6 @@ proc main(argv: var seq[string]): int =
quit(1)

echoVerbose("SeqFu ORF")
#[
if len(fileR1) == 0:
verbose("Missing required parameters: -1 FILE1 [-2 FILE2]", true)
quit(0)
]#

if args["<InputFile>"]:
fileR1 = $args["<InputFile>"]
Expand Down
7 changes: 7 additions & 0 deletions src/fu_orf2.nim
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#[
=========================
=========================
NOT IN USE IN PRODUCTION
=========================
=========================
]#
import threadpool
import readfq
import iterutils
Expand Down
1 change: 0 additions & 1 deletion src/fu_orf2.nim.cfg

This file was deleted.

40 changes: 0 additions & 40 deletions src/testneo.nim

This file was deleted.

13 changes: 0 additions & 13 deletions src/travis.sh

This file was deleted.

8 changes: 6 additions & 2 deletions test/makezip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ set -euxo pipefail
gh() {
# Check if `gh` command is available
if ! command -v gh > /dev/null; then
echo "The CLI utility 'gh' was not found"
return 0
else
return 1
echo "OK: CLI utility 'gh' found"
return 1
fi
}

Expand All @@ -15,6 +17,8 @@ getversion() {
# check if gh()
if gh; then
new_tag=$(gh release list -L 1 | grep -o "v\d\+\.\d\+\.\d\+")
else
echo "Could not get remote release""
fi
}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
Expand All @@ -30,4 +34,4 @@ mkdir -p "$DESTDIR"
ZIP="$DESTDIR"/${programName}-${new_tag}-${os_tag}.zip
zip -j "$ZIP" "$BINDIR"/*
gh release upload ${new_tag} "$ZIP"
gh release upload ${new_tag} "$ZIP"

0 comments on commit ea4d14f

Please sign in to comment.