Skip to content

Commit

Permalink
Catch error where no reference UMIs are produced
Browse files Browse the repository at this point in the history
Catches the error SorenKarst#35
  • Loading branch information
aaronsaunders authored Oct 26, 2020
1 parent 00302fd commit a307b27
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/umi_binning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@ $GAWK \
$UMI_DIR/umi12c.fa \
> $UMI_DIR/umi12cf.fa

# Check that there were umi_ref sequences with which to bin putative UMIs
if [ $(grep -c '^>' $UMI_DIR/umi12cf.fa) = 0 ]; then
echo
echo "Pipeline stopped!"
echo "The pipeline has not produced any umi_ref sequences for the umi mapping.\
none of the perfect UMIs detected have a coverage > 3."
echo "Cluster sizes of perfect UMIs in $UMI_DIR/umi12c.fa";
echo "This result is usually due to the molecule/data ratio in the library being too low";
exit 1;
fi

# Remove potential chimeras
paste <(cat $UMI_DIR/umi12cf.fa | paste - - ) \
<($GAWK '!/^>/{print}' $UMI_DIR/umi12cf.fa | rev | tr ATCG TAGC) |\
Expand Down

0 comments on commit a307b27

Please sign in to comment.