From 6fa3f6779e5f4f97df812d94b073ad353952f068 Mon Sep 17 00:00:00 2001 From: Daniel Cook Date: Tue, 22 Oct 2019 12:03:21 +0100 Subject: [PATCH] fix fq_count var --- .gitignore | 3 ++- sc.nim | 16 +++++++++++++++- src/fq_count.nim | 12 +++++++----- tasks.todo | 10 ++++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 90c9b95..1eb8faf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ nimcache/ tut ssshtest .Rhistory -.python-version \ No newline at end of file +.python-version +bam_set/ \ No newline at end of file diff --git a/sc.nim b/sc.nim index 569b14e..ec303d8 100644 --- a/sc.nim +++ b/sc.nim @@ -14,10 +14,12 @@ import sequtils import terminal import asyncfile import zip/gzipfiles + import src/fq_meta import src/fq_count import src/fq_dedup -#import src/index_swap +import src/vcf2tsv + import src/utils/helpers from constants import ANN_header @@ -336,6 +338,7 @@ var p = newParser("sc"): arg("fastq", nargs = 1, help = "Input FASTQ") run: fq_dedup.fq_dedup(opts.fastq) + command("json", group="VCF"): help("Convert a VCF to JSON") arg("vcf", nargs = 1, help="VCF to convert to JSON") @@ -351,6 +354,17 @@ var p = newParser("sc"): flag("--debug", help="Debug") run: to_json(get_vcf(opts.vcf), opts.region, opts.samples, opts.info, opts.format, opts.zip, opts.annotation, opts.pretty, opts.array, opts.pass) + + command("vcf2tsv", group="VCF"): + help("Converts a VCF to TSV or CSV") + flag("--header", help="Output the header") + arg("vcf", nargs = 1, help = "Input FASTQ") + run: + if opts.vcf.len == 0: + quit_error("No VCF specified", 3) + elif opts.vcf.len > 0: + vcf2tsv(opts.vcf) + command("fasta", group="VCF"): help("Convert a VCF to a FASTA file") arg("vcf", nargs = 1, help="VCF to convert to JSON") diff --git a/src/fq_count.nim b/src/fq_count.nim index dad45e8..e888cb5 100644 --- a/src/fq_count.nim +++ b/src/fq_count.nim @@ -6,11 +6,13 @@ import strformat import strutils import os -const header* = ["reads", - "gc_content", - "gc_bases", - "bases", - "fname"].join("\t") +const fq_count_header* = ["reads", + "gc_content", + "gc_bases", + "n_bases", + "bases", + "basename", + "absolute_path"].join("\t") diff --git a/tasks.todo b/tasks.todo index 52bd397..73bafcd 100644 --- a/tasks.todo +++ b/tasks.todo @@ -33,4 +33,14 @@ Index Swap: ☐ Minimum coverage level (10 reads) ☐ Group by flowcell/lane +BAM: + ☐ BAM list chromoomes + ☐ BAM window iterator + ☐ Tajima's D (Parallelize across chrom?) + +VCF: + ☐ VCF list chromosome + ☐ VCF window iterator + ☐ VCF Subsample? + Genome manager (a better one?):