Skip to content

Commit

Permalink
fix tests and novaseq detection
Browse files Browse the repository at this point in the history
  • Loading branch information
danielecook committed Oct 26, 2019
1 parent 2575781 commit 8fd9853
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
16 changes: 11 additions & 5 deletions scripts/functional-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 #
Expand Down Expand Up @@ -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 ':')"
14 changes: 7 additions & 7 deletions src/fq_meta.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8fd9853

Please # to comment.