<commit_before>#!/bin/bash
# Available variables: $PROJECT, $RUNTYPE, $MIGA, $CORES
set -e
SCRIPT="essential"
echo "MiGA: $MIGA"
echo "Project: $PROJECT"
source "$MIGA/scripts/miga.bash" || exit 1
cd "$PROJECT/data/07.annotation/01.function/01.essential"

# Initialize
date "+%Y-%m-%d %H:%M:%S %z" > "$DATASET.start"
FAA="../../../06.cds/$DATASET.faa"

# Check if there are any proteins
if [[ ! -s $FAA ]] ; then
  echo Empty protein set, bypassing essential genes
  rm "$DATASET.start"
  miga create_dataset -P "$PROJECT" -D $DATASET \
    -m run_essential_genes=false --update
  exit 0
fi

# Find and extract essential genes
[[ -d "$DATASET.ess" ]] && rm -R "$DATASET.ess"
mkdir "$DATASET.ess"
TYPE=$(miga list_datasets -P "$PROJECT" -D "$DATASET" \
   --metadata "type" | awk '{print $2}')
if [[ "$TYPE" == "metagenome" || "$TYPE" == "virome" ]] ; then
   HMM.essential.rb -i "$FAA" -o "$DATASET.ess.faa" \
      -m "$DATASET.ess/" -t "$CORES" -r "$DATASET" --metagenome \
      > "$DATASET.ess/log"
else
   HMM.essential.rb -i "$FAA" -o "$DATASET.ess.faa" \
      -m "$DATASET.ess/" -t "$CORES" -r "$DATASET" \
      > "$DATASET.ess/log"
fi

# Finalize
date "+%Y-%m-%d %H:%M:%S %z" > "$DATASET.done"
miga add_result -P "$PROJECT" -D "$DATASET" -r "$SCRIPT"
<commit_msg>SCRIPT corrected in essential_genes<commit_after>#!/bin/bash
# Available variables: $PROJECT, $RUNTYPE, $MIGA, $CORES
set -e
SCRIPT="essential_genes"
echo "MiGA: $MIGA"
echo "Project: $PROJECT"
source "$MIGA/scripts/miga.bash" || exit 1
cd "$PROJECT/data/07.annotation/01.function/01.essential"

# Initialize
date "+%Y-%m-%d %H:%M:%S %z" > "$DATASET.start"
FAA="../../../06.cds/$DATASET.faa"

# Check if there are any proteins
if [[ ! -s $FAA ]] ; then
  echo Empty protein set, bypassing essential genes
  rm "$DATASET.start"
  miga create_dataset -P "$PROJECT" -D $DATASET \
    -m run_essential_genes=false --update
  exit 0
fi

# Find and extract essential genes
[[ -d "$DATASET.ess" ]] && rm -R "$DATASET.ess"
mkdir "$DATASET.ess"
TYPE=$(miga list_datasets -P "$PROJECT" -D "$DATASET" \
   --metadata "type" | awk '{print $2}')
if [[ "$TYPE" == "metagenome" || "$TYPE" == "virome" ]] ; then
   HMM.essential.rb -i "$FAA" -o "$DATASET.ess.faa" \
      -m "$DATASET.ess/" -t "$CORES" -r "$DATASET" --metagenome \
      > "$DATASET.ess/log"
else
   HMM.essential.rb -i "$FAA" -o "$DATASET.ess.faa" \
      -m "$DATASET.ess/" -t "$CORES" -r "$DATASET" \
      > "$DATASET.ess/log"
fi

# Finalize
date "+%Y-%m-%d %H:%M:%S %z" > "$DATASET.done"
miga add_result -P "$PROJECT" -D "$DATASET" -r "$SCRIPT"

{'fraction_non_alphanumeric': 0.2128982128982129, 'fraction_numerical': 0.008547008547008548, 'mean_word_length': 3.364406779661017, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '333536', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1060, 'n_words': 263}