Skip to content

Commit

Permalink
Reduce waste by inactivating empty assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Aug 29, 2024
1 parent eed9d36 commit 58bdde4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/miga/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module MiGA
# - String indicating release status:
# - rc* release candidate, not released as gem
# - [0-9]+ stable release, released as gem
VERSION = [1.3, 20, 2].freeze
VERSION = [1.3, 20, 3].freeze

##
# Nickname for the current major.minor version.
Expand Down
10 changes: 8 additions & 2 deletions scripts/cds.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ if [[ -e "../05.assembly/$DATASET.LargeContigs.fna.gz" \
miga add_result -P "$PROJECT" -D "$DATASET" -r assembly -f
fi

# Check if the input assembly is empty
ASM_LEN=$(grep -v '^>' "../05.assembly/${DATASET}.LargeContigs.fna" \
| wc -lc | awk '{ print $2-$1 }')
if [[ "$ASM_LEN" -lt 1 ]] ; then
miga edit -P "$PROJECT" -D "$DATASET" --inactivate "Empty assembly"
exit 0
fi

# Run Prodigal
TYPE=$(miga ls -P "$PROJECT" -D "$DATASET" -m type | cut -f 2)
case "$TYPE" in
Expand All @@ -27,8 +35,6 @@ case "$TYPE" in
P_LEN=0
BEST_CT=0
PROCEDURE=single
ASM_LEN=$(grep -v '^>' "../05.assembly/${DATASET}.LargeContigs.fna" \
| wc -lc | awk '{ print $2-$1 }')
[[ "$ASM_LEN" -lt 2000 ]] && PROCEDURE=meta
echo "# Codon table selection:" > "${DATASET}.ct.t"
for ct in 11 4 ; do
Expand Down

0 comments on commit 58bdde4

Please sign in to comment.