Commit 82f3d173 authored by David Hoksza's avatar David Hoksza
Browse files

added timestamps to logging

parent 6edb2f58
...@@ -35,50 +35,62 @@ check_exit_code(){ ...@@ -35,50 +35,62 @@ check_exit_code(){
fi fi
} }
log() {
echo `date +"%T"`: $1
}
# Get associations from DisGeNET # Get associations from DisGeNET
log "Querying DisGeNET..."
disgenet_out_path=${RES_DIR}/01-disgenet-n_${DISGENET_CNT_THRESHOLD}-s_${DISGENET_ASSOCIATION_SCORE_THRESHOLD_STR}.json disgenet_out_path=${RES_DIR}/01-disgenet-n_${DISGENET_CNT_THRESHOLD}-s_${DISGENET_ASSOCIATION_SCORE_THRESHOLD_STR}.json
$PYTHON_BIN $ASSOCIATIONS_DIR/disgenet.py -o ${ORPHANET_IDS} -n ${DISGENET_CNT_THRESHOLD} -s ${DISGENET_ASSOCIATION_SCORE_THRESHOLD} > ${disgenet_out_path} $PYTHON_BIN $ASSOCIATIONS_DIR/disgenet.py -o ${ORPHANET_IDS} -n ${DISGENET_CNT_THRESHOLD} -s ${DISGENET_ASSOCIATION_SCORE_THRESHOLD} > ${disgenet_out_path}
check_exit_code check_exit_code
echo "Disgenet gene and variant associations stored in ${disgenet_out_path}" log "DisGeNET gene and variant associations stored in ${disgenet_out_path}"
# Get associations from OpenTargets # Get associations from OpenTargets
log "Querying OpenTargets..."
opentargets_out_path=${RES_DIR}/01-opentargets-n_${DISGENET_CNT_THRESHOLD}-s_${OPENTARGETS_ASSOCIATION_SCORE_THRESHOLD_STR}.json opentargets_out_path=${RES_DIR}/01-opentargets-n_${DISGENET_CNT_THRESHOLD}-s_${OPENTARGETS_ASSOCIATION_SCORE_THRESHOLD_STR}.json
$PYTHON_BIN $ASSOCIATIONS_DIR/opentargets.py -o ${ORPHANET_IDS} -n ${OPENTARGETS_CNT_THRESHOLD} -s ${OPENTARGETS_ASSOCIATION_SCORE_THRESHOLD} > ${opentargets_out_path} $PYTHON_BIN $ASSOCIATIONS_DIR/opentargets.py -o ${ORPHANET_IDS} -n ${OPENTARGETS_CNT_THRESHOLD} -s ${OPENTARGETS_ASSOCIATION_SCORE_THRESHOLD} > ${opentargets_out_path}
check_exit_code check_exit_code
echo "Opentargets gene and variant associations stored in ${opentargets_out_path}" log "Opentargets gene and variant associations stored in ${opentargets_out_path}"
# Merge with ClinVar # Merge with ClinVar
log "Merging with ClinVar..."
genes_variants_out_path=${RES_DIR}/02-genes_variants.log genes_variants_out_path=${RES_DIR}/02-genes_variants.log
$PYTHON_BIN $ASSOCIATIONS_DIR/merge_with_clinvar.py -v $disgenet_out_path,$opentargets_out_path -c ${ASSOCIATIONS_DATA_DIR}/OrphaHPO_clinvar_variants_summary.tsv -oid ${ORPHANET_IDS} > ${genes_variants_out_path} $PYTHON_BIN $ASSOCIATIONS_DIR/merge_with_clinvar.py -v $disgenet_out_path,$opentargets_out_path -c ${ASSOCIATIONS_DATA_DIR}/OrphaHPO_clinvar_variants_summary.tsv -oid ${ORPHANET_IDS} > ${genes_variants_out_path}
check_exit_code check_exit_code
echo "Integration with ClinVar stored in ${genes_variants_out_path}" log "Integration with ClinVar stored in ${genes_variants_out_path}"
genes_line=`cat ${genes_variants_out_path} | grep "genes in total"` genes_line=`cat ${genes_variants_out_path} | grep "genes in total"`
genes_out_path=${genes_variants_out_path/02-genes_variants/03-genes} genes_out_path=${genes_variants_out_path/02-genes_variants/03-genes}
#echo ${genes_line#*:} | sed 's/\,/\n/g' > ${genes_out_path} #echo ${genes_line#*:} | sed 's/\,/\n/g' > ${genes_out_path}
echo ${genes_line#*:} | tr ',' '\n' > ${genes_out_path} echo ${genes_line#*:} | tr ',' '\n' > ${genes_out_path}
echo "Genes stored in ${genes_out_path}" log "Genes stored in ${genes_out_path}"
echo "Extending genes list" log "Extending genes list..."
text_mining_out_path=${genes_out_path/03-genes/03-text-mining} text_mining_out_path=${genes_out_path/03-genes/03-text-mining}
echo Rscript --vanilla ${EXTEND_DIR}/get_extended_network.R ${genes_out_path} ${EXTEND_CONFIG} echo Rscript --vanilla ${EXTEND_DIR}/get_extended_network.R ${genes_out_path} ${EXTEND_CONFIG}
check_exit_code check_exit_code
cp ${EXTEND_DIR}/output.txt ${text_mining_out_path} cp ${EXTEND_DIR}/output.txt ${text_mining_out_path}
echo "Genes list extended" log "Genes list extended"
minerva_genes_out_path=${RES_DIR}/04-minerva-genes.txt minerva_genes_out_path=${RES_DIR}/04-minerva-genes.txt
$PYTHON_BIN $ASSOCIATIONS_DIR/minerva_genes.py -f ${genes_out_path} > ${minerva_genes_out_path} $PYTHON_BIN $ASSOCIATIONS_DIR/minerva_genes.py -f ${genes_out_path} > ${minerva_genes_out_path}
check_exit_code check_exit_code
log "Genes stored in ${minerva_genes_out_path}"
var_line=`cat ${genes_variants_out_path} | grep "variants in total"` var_line=`cat ${genes_variants_out_path} | grep "variants in total"`
variants_out_path=${genes_variants_out_path/02-genes_variants/03-variants} variants_out_path=${genes_variants_out_path/02-genes_variants/03-variants}
#echo ${var_line#*:} | sed 's/\,/\n/g' > ${variants_out_path} #echo ${var_line#*:} | sed 's/\,/\n/g' > ${variants_out_path}
echo ${var_line#*:} | tr ',' '\n' > ${variants_out_path} echo ${var_line#*:} | tr ',' '\n' > ${variants_out_path}
echo "Variants stored in ${variants_out_path}" log "Variants stored in ${variants_out_path}"
log "Getting detailed variants information..."
minerva_variants_out_path=${RES_DIR}/04-minerva-variants.txt minerva_variants_out_path=${RES_DIR}/04-minerva-variants.txt
$PYTHON_BIN $ASSOCIATIONS_DIR/minerva_variants.py -f ${variants_out_path} > ${minerva_variants_out_path} $PYTHON_BIN $ASSOCIATIONS_DIR/minerva_variants.py -f ${variants_out_path} > ${minerva_variants_out_path}
log "Detailed variants information obtained"
check_exit_code check_exit_code
if [ ${STOP_AFTER_STAGE} = 1 ]; then if [ ${STOP_AFTER_STAGE} = 1 ]; then
...@@ -86,7 +98,7 @@ if [ ${STOP_AFTER_STAGE} = 1 ]; then ...@@ -86,7 +98,7 @@ if [ ${STOP_AFTER_STAGE} = 1 ]; then
exit 0 exit 0
fi fi
# ------------------------------ 2. Obtain pathways ------------------------------ # ------------------------------ 2. Obtain pathways ------------------------------
echo "Retrieving enriched pathways" log "Retrieving enriched pathways..."
tr '\r' '\n' < ${ENRICHMENT_CONFIG} > ${ENRICHMENT_CONFIG_TMP} tr '\r' '\n' < ${ENRICHMENT_CONFIG} > ${ENRICHMENT_CONFIG_TMP}
...@@ -104,7 +116,7 @@ mv enriched_pathways.txt ${enriched_paths_out_path} ...@@ -104,7 +116,7 @@ mv enriched_pathways.txt ${enriched_paths_out_path}
rm ${ENRICHMENT_CONFIG_TMP} rm ${ENRICHMENT_CONFIG_TMP}
echo "Enriched pathways obtained" log "Enriched pathways retrieved"
if [ ${STOP_AFTER_STAGE} = 2 ]; then if [ ${STOP_AFTER_STAGE} = 2 ]; then
...@@ -118,16 +130,16 @@ if [ ${BUILD_MAP_GENERATOR} = 1 ]; then ...@@ -118,16 +130,16 @@ if [ ${BUILD_MAP_GENERATOR} = 1 ]; then
mvn -DskipTests=true clean install -pl biohackathon -am mvn -DskipTests=true clean install -pl biohackathon -am
cd .. cd ..
fi fi
echo "Map generator built" log "Map generator built"
echo "Assembling the map from pathways ..." log "Assembling the map from pathways ..."
map_out_path=${RES_DIR}/06-minerva_map.xml map_out_path=${RES_DIR}/06-minerva_map.xml
java -Xmx4g -jar ${MAP_GENERATOR_DIR}/biohackathon/target/biohackathon-1.0-jar-with-dependencies.jar --enrichr-file ${enriched_paths_out_path} --minerva-file ${enriched_maps_out_path} --text-mining-file ${text_mining_out_path} --output-file ${map_out_path} java -Xmx4g -jar ${MAP_GENERATOR_DIR}/biohackathon/target/biohackathon-1.0-jar-with-dependencies.jar --enrichr-file ${enriched_paths_out_path} --minerva-file ${enriched_maps_out_path} --text-mining-file ${text_mining_out_path} --output-file ${map_out_path}
#java -Xmx4g -jar ${MAP_GENERATOR_DIR}/biohackathon/target/biohackathon-1.0-jar-with-dependencies.jar --enrichr-file ${enriched_paths_out_path} --minerva-file ${enriched_maps_out_path} --output-file ${map_out_path} #java -Xmx4g -jar ${MAP_GENERATOR_DIR}/biohackathon/target/biohackathon-1.0-jar-with-dependencies.jar --enrichr-file ${enriched_paths_out_path} --minerva-file ${enriched_maps_out_path} --output-file ${map_out_path}
check_exit_code check_exit_code
echo "Pathwaygs assembled into ${map_out_path}" log "Pathwaygs assembled into ${map_out_path}"
echo "Combining map with overlays" log "Combining the map with overlays"
tmp_dir=${RES_DIR}/tmp/ tmp_dir=${RES_DIR}/tmp/
tmp_dir_layouts=${tmp_dir}/layouts/ tmp_dir_layouts=${tmp_dir}/layouts/
...@@ -147,4 +159,4 @@ cd - ...@@ -147,4 +159,4 @@ cd -
mv ${tmp_dir}/tmp.zip ${map_zip_out_path} mv ${tmp_dir}/tmp.zip ${map_zip_out_path}
rm -rf ${tmp_dir} rm -rf ${tmp_dir}
echo "Final map with overlays stored in ${map_zip_out_path}" log "Final map with overlays stored in ${map_zip_out_path}"
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment