Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkinsc committed Jul 28, 2018
1 parent 4b5697d commit ba83b38
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions pipes/WDL/workflows/tasks/tasks_demux.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,31 @@ task illumina_demux {
${flowcell_tgz} $FLOWCELL_DIR \
--loglevel=DEBUG

echo "FLOWCELL_DIR: $FLOWCELL_DIR"
ls "$FLOWCELL_DIR"

# full RunInfo.xml path
RUNINFO_FILE="$(find $FLOWCELL_DIR -type f -maxdepth 3 -name RunInfo.xml | head -n 1)"
echo "RunInfo.xml: $RUNINFO_FILE"
cat "$RUNINFO_FILE"
cat "$RUNINFO_FILE"
cat "/opt/viral-ngs/source/docker/run_tile_count.sh"
total_tile_count=$("/opt/viral-ngs/source/docker/run_tile_count.sh $RUNINFO_FILE")
# Parse the lane count & run ID from RunInfo.xml file
lane_count=$(xmllint --xpath "string(//Run/FlowcellLayout/@LaneCount)" $RUNINFO_FILE)
if [ -z "$lane_count" ]; then
echo "Could not parse LaneCount from RunInfo.xml. Please check RunInfo.xml is properly formatted"
fi

surface_count=$(xmllint --xpath "string(//Run/FlowcellLayout/@SurfaceCount)" $RUNINFO_FILE)
if [ -z "$surface_count" ]; then
echo "Could not parse SurfaceCount from RunInfo.xml. Please check RunInfo.xml is properly formatted"
fi

swath_count=$(xmllint --xpath "string(//Run/FlowcellLayout/@SwathCount)" $RUNINFO_FILE)
if [ -z "$swath_count" ]; then
echo "Could not parse SwathCount from RunInfo.xml. Please check RunInfo.xml is properly formatted"
fi

tile_count=$(xmllint --xpath "string(//Run/FlowcellLayout/@TileCount)" $RUNINFO_FILE)
if [ -z "$tile_count" ]; then
echo "Could not parse TileCount from RunInfo.xml. Please check RunInfo.xml is properly formatted"
fi

# total data size more roughly tracks total tile count
total_tile_count=$((lane_count*surface_count*swath_count*tile_count))

if [ "$total_tile_count" -le 50 ]; then
echo "Detected $total_tile_count tiles, interpreting as MiSeq run."
Expand Down

0 comments on commit ba83b38

Please sign in to comment.