-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,006 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#import klib | ||
import readfq | ||
import strformat | ||
import tables, strutils | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import readfq | ||
import strformat | ||
import tables, strutils | ||
from os import fileExists | ||
import docopt | ||
import ./seqfu_utils | ||
|
||
|
||
|
||
proc fastx_head_v2(argv: var seq[string]): int = | ||
let args = docopt(""" | ||
Usage: less [options] <file_1> [<file_2>] | ||
View a single FASTQ file or paired-end FASTQ dataset. | ||
Options: | ||
-i, --interleaved Input is interleaved paired-end FASTQ | ||
-n, --num NUM Print the first NUM sequences [default: 10] | ||
-k, --skip SKIP Print one sequence every SKIP [default: 0] | ||
-p, --prefix STRING Rename sequences with prefix + incremental number | ||
-s, --strip-comments Remove comments | ||
-b, --basename prepend basename to sequence name | ||
-v, --verbose Verbose output | ||
--print-last Print the name of the last sequence to STDERR (Last:NAME) | ||
--fatal Exit with error if less than NUM sequences are found | ||
--quiet Don't print warnings | ||
--help Show this help | ||
""", version=version(), argv=argv) | ||
|
||
var | ||
num, skip : int | ||
prefix : string | ||
files : seq[string] | ||
printBasename: bool | ||
separator : string | ||
|
||
let | ||
printLast = bool(args["--print-last"]) | ||
fatalWarning = bool(args["--fatal"]) | ||
|
||
|
||
if args["<file_1>"].len() == 0: | ||
if getEnv("SEQFU_QUIET") == "": | ||
stderr.writeLine("[seqfu head] Waiting for STDIN... [Ctrl-C to quit, type with --help for info].") | ||
files.add("-") | ||
else: | ||
for file in args["<inputfile>"]: | ||
files.add(file) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import iterutils | ||
import sequtils | ||
import readfq | ||
import docopt | ||
import seqfu_utils | ||
|
||
template initClosure(id:untyped,iter:untyped) = | ||
let id = iterator():auto {.closure.} = | ||
for x in iter: | ||
yield x | ||
|
||
iterator letters: auto = | ||
for c in 'a' .. 'z': | ||
yield c | ||
|
||
|
||
proc main(argv: var seq[string]): int = | ||
let args = docopt(""" | ||
USAGE: | ||
fqpair FILE1 FILE2 | ||
""", argv=argv) | ||
|
||
let | ||
file1 = $args["FILE1"] | ||
file2 = $args["FILE2"] | ||
|
||
echo "Reading file1: ", file1 | ||
echo "Reading file2: ", file2 | ||
|
||
initClosure(f1,readfq(file1)) | ||
initClosure(f2,readfq(file2)) | ||
|
||
var | ||
c = 0 | ||
for (fwd, rev) in zip(f1, f2): | ||
var | ||
newseq : FQRecord | ||
|
||
newseq = fwd | ||
newseq.sequence &= "*" | ||
c = c + 1 | ||
echo c, "\tfwd: ", fwd.name, " : ", rev.name | ||
echo newseq.sequence | ||
|
||
|
||
when isMainModule: | ||
main_helper(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.