Skip to content

Commit

Permalink
v0.1.5: fixed a bug of processing multiline output from sra-stat
Browse files Browse the repository at this point in the history
  • Loading branch information
inutano committed Jun 22, 2017
1 parent c272bd3 commit cd50ddd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bin/pfastq-dump
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e

# pfastq-dump version
VERSION="0.1.4"
VERSION="0.1.5"

# default arguments
TMPDIR="$( pwd -P )"
Expand Down Expand Up @@ -153,9 +153,13 @@ parallel_fastq_dump(){
# function to calculate spot count using sra-stat
calc_spot_count(){
local sra="${1}"
sra-stat --meta --quick "${sra}" |\
cut -d '|' -f 3 |\
cut -d ':' -f 1
local txt=`sra-stat --meta --quick "${sra}"`
local total=0
for line in ${txt}; do
local n=`echo ${line} | cut -d '|' -f 3 | cut -d ':' -f 1`
local total=$(( ${total} + ${n} ))
done
echo ${total}
}

# function to check prerequisites
Expand Down

0 comments on commit cd50ddd

Please sign in to comment.