diff --git a/detectors/cds/bin/do_rps12.sh b/detectors/cds/bin/do_rps12.sh index ac34f62..b1d33b5 100755 --- a/detectors/cds/bin/do_rps12.sh +++ b/detectors/cds/bin/do_rps12.sh @@ -31,6 +31,10 @@ else QUERY="$1" fi +shift + +GENOME_LENGHT="$2" + if (( $# > 1 )) ; then TEMP=$2 else @@ -45,7 +49,6 @@ AnnotFile="$CDS_DATA_DIR/sp_chlorodb/Annot.lst" ModelsDir="$CDS_DATA_DIR/sp_chlorodb/models" SEQLEN=$(seqlength "${QUERY}") -SEQUENCE=$(readfirstfastaseq "${QUERY}") pushTmpDir ORG.RPS12 @@ -78,7 +81,10 @@ blastx \ {PREV_CDS = $2;} (BEST_EVAL > ($11 + 0.0)) {BEST_EVAL = ($11 + 0.0)} - ' > "rps12_locate.hsps" + ' \ + | $AwkCmd -v glength=${GENOME_LENGHT} \ + '!($7 + 0 > glength + 0 && $8 + 0 > glength + 0)' \ + > "rps12_locate.hsps" # diff --git a/detectors/cds/bin/go_cds.sh b/detectors/cds/bin/go_cds.sh index 1895151..990625a 100755 --- a/detectors/cds/bin/go_cds.sh +++ b/detectors/cds/bin/go_cds.sh @@ -9,6 +9,7 @@ # go_cds.sh [DBROOT] # # - : The fasta file containing the genome to annotate +# - : The length of the genome to annotate # - [DBROOT] : optionnal argument allowing to specify database directory # # Results are printed to the standard output @@ -28,12 +29,14 @@ else Threads=$ANNOT_MAXCPU fi -needarg 1 +needarg 2 Fasta=$1; shift needfile "$Fasta" +GenomeLength=$1; shift + # Genome names is set from the base # name of the genome file without its extension Genome=$(basename ${Fasta%.*}) @@ -92,7 +95,7 @@ fi if [[ "$cdsdetection_pass2" == "yes" ]] ; then loginfo "running pass2:rps12 exonerate of $Genome on $DbRoot" - $PROG_DIR/do_rps12.sh $Fasta $temp + $PROG_DIR/do_rps12.sh $Fasta $GenomeLength $temp fi # diff --git a/detectors/cds/lib/rps12_filter_4.awk b/detectors/cds/lib/rps12_filter_4.awk index 2ad7572..279e184 100644 --- a/detectors/cds/lib/rps12_filter_4.awk +++ b/detectors/cds/lib/rps12_filter_4.awk @@ -34,6 +34,7 @@ function convert(p1,p2) { r = $0 while (length(s) > 0) { match(s,/[0-9]+\.\.[0-9]+/) + if (RLENGTH+0 < 0) break range = substr(s,RSTART,RLENGTH) s = substr(s,RSTART+RLENGTH+1) match(range,/^[0-9]+/) diff --git a/org-annotate.sh b/org-annotate.sh index 3404e93..df4e839 100755 --- a/org-annotate.sh +++ b/org-annotate.sh @@ -441,6 +441,7 @@ do shift done + loginfo "Locus tag prefix provided: $tagprefix" loginfo "Locus tag numbered from..: $locusshift" loginfo "NCBI taxid provided......: $taxid" @@ -572,7 +573,7 @@ pushTmpDir ORG.organnot cdsdetection_pass1=$cdsdetection_pass1 \ cdsdetection_pass2=$cdsdetection_pass2 \ cdsdetection_pass3=$cdsdetection_pass3 \ - ${PROG_DIR}/detectors/cds/bin/go_cds.sh "${RESULTS}.norm.fasta" >> "${RESULTS}.annot" + ${PROG_DIR}/detectors/cds/bin/go_cds.sh "${RESULTS}.norm.fasta" "$sl" >> "${RESULTS}.annot" loginfo "Done." fi