From 8fd9853a4c6e5b0eadfb1d33f2f6581cd817364d Mon Sep 17 00:00:00 2001 From: Daniel Cook Date: Sat, 26 Oct 2019 19:34:17 +0100 Subject: [PATCH] fix tests and novaseq detection --- scripts/functional-tests.sh | 16 +++++++++++----- src/fq_meta.nim | 14 +++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/scripts/functional-tests.sh b/scripts/functional-tests.sh index 5a9aa4f..27f77e8 100644 --- a/scripts/functional-tests.sh +++ b/scripts/functional-tests.sh @@ -19,7 +19,7 @@ assert_equal 999 "$(cat "$STDOUT_FILE" | jq '.QUAL')" assert_equal \"T\" "$(cat "$STDOUT_FILE" | jq '.REF')" run test_json_pretty sc json --pretty "${PARENT_DIR}/tests/data/test.vcf.gz" X:17276844-17276844 -assert_equal 13 "$(cat $STDOUT_FILE | wc -l)" +assert_equal 13 $(cat $STDOUT_FILE | wc -l) # INFO run single_info_item sc json --info="DP" "${PARENT_DIR}/tests/data/test.vcf.gz" X:17276844-17276844 @@ -40,12 +40,12 @@ assert_equal 2094 "$(cat $STDOUT_FILE | jq '.FORMAT.DP|add')" #==========# run fq_dedup sc fq-dedup tests/fastq/dup.fq -assert_equal 4 "$(cat $STDOUT_FILE | grep '@' | wc -l)" -assert_equal 4 "$(cat $STDOUT_FILE | grep '@' | wc -l)" +assert_equal 4 $(cat $STDOUT_FILE | grep '@' | wc -l) +assert_equal 4 $(cat $STDOUT_FILE | grep '@' | wc -l) run fq_dedup_gz sc fq-dedup tests/fastq/dup.fq.gz -assert_equal 4 "$(cat $STDOUT_FILE | grep '@' | wc -l)" -assert_equal 4 "$(cat $STDOUT_FILE | grep '@' | wc -l)" +assert_equal 4 $(cat $STDOUT_FILE | grep '@' | wc -l) +assert_equal 4 $(cat $STDOUT_FILE | grep '@' | wc -l) #=========# # fq-meta # @@ -112,3 +112,9 @@ assert_equal "$(cat $STDOUT_FILE | cut -f 2)" "HiSeqX" assert_equal "$(cat $STDOUT_FILE | cut -f 3)" "high:machine+flowcell" assert_equal "$(cat $STDOUT_FILE | cut -f 3 | cut -f 1 -d ':')" \ "$(test_fq tests/fastq/illumina_hiseq_x.fq | egrep -o 'high')" + +# Novaseq +run fq_meta_novaseq sc fq-meta tests/fastq/novaseq.fq +assert_equal "$(cat $STDOUT_FILE | cut -f 2)" "NovaSeq" +assert_equal "$(cat $STDOUT_FILE | cut -f 3)" "high:machine+flowcell" +assert_equal "$(cat $STDOUT_FILE | cut -f 3 | cut -f 1 -d ':')" \ No newline at end of file diff --git a/src/fq_meta.nim b/src/fq_meta.nim index 9c912f5..49dbf90 100644 --- a/src/fq_meta.nim +++ b/src/fq_meta.nim @@ -52,7 +52,7 @@ type let InstrumentIDs = @[Instrument(pattern: re"HWI-M[0-9]{4}$", sequencer: @["MiSeq"]), Instrument(pattern: re"HWUSI", sequencer: @["GenomeAnalyzerIIx"]), Instrument(pattern: re"M[0-9]{5}$", sequencer: @["MiSeq"]), - Instrument(pattern: re"A[0-9]{6}$", sequencer: @["NovaSeq"]), + Instrument(pattern: re"A[0-9]{5}$", sequencer: @["NovaSeq"]), Instrument(pattern: re"HWI-C[0-9]{5}$", sequencer: @["HiSeq1500"]), Instrument(pattern: re"C[0-9]{5}$", sequencer: @["HiSeq1500"]), Instrument(pattern: re"HWI-D[0-9]{5}$", sequencer: @["HiSeq2500"]), @@ -89,12 +89,12 @@ let FCIDs = @[Flowcell(pattern: re"AAXX$", sequencer: @["GenomeAnalyzer"], descr Flowcell(pattern: re"H[A-Z,0-9]{4}BGXY$", sequencer: @["NextSeq"], description: "High output flow cell"), Flowcell(pattern: re"H[A-Z,0-9]{4}BGX2$", sequencer: @["NextSeq"], description: "High output flow cell"), Flowcell(pattern: re"H[A-Z,0-9]{4}AFXX$", sequencer: @["NextSeq"], description: "Mid output flow cell"), - Flowcell(pattern: re"A[A-Z,0-9]{4}$", sequencer: @["MiSeq"], description: "MiSeq flow cell"), - Flowcell(pattern: re"B[A-Z,0-9]{4}$", sequencer: @["MiSeq"], description: "MiSeq flow cell"), - Flowcell(pattern: re"D[A-Z,0-9]{4}$", sequencer: @["MiSeq"], description: "MiSeq nano flow cell"), - Flowcell(pattern: re"G[A-Z,0-9]{4}$", sequencer: @["MiSeq"], description: "MiSeq micro flow cell"), - Flowcell(pattern: re"H[A-Z,0-9]{4}DMXX$", sequencer: @["NovaSeq"], description: "S2 flow cell")] - + Flowcell(pattern: re"H[A-Z,0-9]{4}DMXX$", sequencer: @["NovaSeq"], description: "S2 flow cell"), + Flowcell(pattern: re"H[A-Z,0-9]{4}DSXX$", sequencer: @["NovaSeq"], description: "S2 flow cell"), + Flowcell(pattern: re"^A[A-Z,0-9]{4}$", sequencer: @["MiSeq"], description: "MiSeq flow cell"), + Flowcell(pattern: re"^B[A-Z,0-9]{4}$", sequencer: @["MiSeq"], description: "MiSeq flow cell"), + Flowcell(pattern: re"^D[A-Z,0-9]{4}$", sequencer: @["MiSeq"], description: "MiSeq nano flow cell"), + Flowcell(pattern: re"^G[A-Z,0-9]{4}$", sequencer: @["MiSeq"], description: "MiSeq micro flow cell")] proc qual_to_int(q_score: char): int = return qual.find(q_score)