Skip to content

Commit

Permalink
fix(emgb): add titles mount
Browse files Browse the repository at this point in the history
  • Loading branch information
pbelmann committed May 12, 2024
1 parent 78e60f3 commit bd56cb0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions bin/emgb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ while [ $# -gt 0 ]; do
;;
--type=*) TYPE="${1#*=}"
;;
--titles=*) TITLES="${1#*=}"
;;
--blastdb=*) BLAST_DB="${1#*=}"
;;
--version) VERSION_CHECK=1
Expand All @@ -40,7 +42,7 @@ done


function getGenes {
nr=$(find $OUTPUT_PATH/$RUN_ID/annotation/ -name "*.${BLAST_DB}.blast.tsv" -exec readlink -f {} \; | sed 's/^/ -nr-blast-tab /g')
nr=$(find $OUTPUT_PATH/$RUN_ID/annotation/ -name "*.${BLAST_DB}.blast.tsv" -exec readlink -f {} \; | sed 's/^/ --blast-tab /g')
tax=$(find $OUTPUT_PATH/$RUN_ID/annotation/ -name "*.taxonomy.tsv" -exec readlink -f {} \; | sed 's/^/ -mmseqs-lineage /g')
ffn=$(find $OUTPUT_PATH/$RUN_ID/annotation -name "*.ffn.gz" -exec readlink -f {} \; | sed 's/^/ -ffn /g')
gff=$(find $OUTPUT_PATH/$RUN_ID/annotation -name "*.gff.gz" -exec readlink -f {} \; | sed 's/^/ -gff /g')
Expand All @@ -50,14 +52,22 @@ function getGenes {
json=" -json-gz $(pwd)/${NAME}.genes.json.gz "
name=" -dataset-name ${NAME} "

cmd="$nr $kegg $gff $faa $ffn $tax $bins $db $json $name"
titles_mount=""
titles=""
if [ ! -z "$TITLES" ]
then
titles=" -title-tsv $TITLES "
titles_mount=" -v $TITLES:$TITLES "
fi

cmd="$nr $kegg $gff $faa $ffn $tax $bins $db $json $name $titles "

if [ ! -z "$DEBUG_CHECK" ]
then
echo $cmd
fi

docker run -i $DBMOUNT -v $(pwd):$(pwd) -v $WORK_DIR:$WORK_DIR -v ${OUTPUT_PATH}:${OUTPUT_PATH} quay.io/emgb/annotatedgenes2json:2.3.1 $cmd
docker run -i $DBMOUNT -v $(pwd):$(pwd) ${titles_mount} -v $WORK_DIR:$WORK_DIR -v ${OUTPUT_PATH}:${OUTPUT_PATH} quay.io/emgb/annotatedgenes2json:2.5.0 $cmd
}


Expand Down Expand Up @@ -110,6 +120,9 @@ help()
echo " -- (Examples: bacmet20_predicted, ncbi_nr)"
echo " --db -- emgb specific kegg database"
echo " --name -- sample name, e.g. the SAMPLE in the paths above"
echo " --titles -- Custom .tsv file mapping IDs to Subject Titles extracted from FASTA (optional)."
echo " -- The following link explains how to create the corresponding tsv file."
echo " -- https://gitlab.ub.uni-bielefeld.de/cmg/emgb/annotatedgenes2json#use-cases"
echo " --type -- if other then Illumina: ONT/Hybrid"
echo " --workdir -- absolute path to Nextflow work directory"
echo " --help -- help page"
Expand Down

0 comments on commit bd56cb0

Please sign in to comment.