Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Gitlab will go into maintenance Friday 3rd February from 9:00 to 10:00
Open sidebar
David Hoksza
bh19-rare-diseases
Commits
82f3d173
Commit
82f3d173
authored
Dec 02, 2019
by
David Hoksza
Browse files
added timestamps to logging
parent
6edb2f58
Changes
1
Hide whitespace changes
Inline
Side-by-side
assemble.sh
View file @
82f3d173
...
...
@@ -35,50 +35,62 @@ check_exit_code(){
fi
}
log
()
{
echo
`
date
+
"%T"
`
:
$1
}
# 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
$PYTHON_BIN
$ASSOCIATIONS_DIR
/disgenet.py
-o
${
ORPHANET_IDS
}
-n
${
DISGENET_CNT_THRESHOLD
}
-s
${
DISGENET_ASSOCIATION_SCORE_THRESHOLD
}
>
${
disgenet_out_path
}
check_exit_code
echo
"Dis
genet
gene and variant associations stored in
${
disgenet_out_path
}
"
log
"Dis
GeNET
gene and variant associations stored in
${
disgenet_out_path
}
"
# 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
$PYTHON_BIN
$ASSOCIATIONS_DIR
/opentargets.py
-o
${
ORPHANET_IDS
}
-n
${
OPENTARGETS_CNT_THRESHOLD
}
-s
${
OPENTARGETS_ASSOCIATION_SCORE_THRESHOLD
}
>
${
opentargets_out_path
}
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
log
"Merging with ClinVar..."
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
}
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_out_path
=
${
genes_variants_out_path
/02-genes_variants/03-genes
}
#echo ${genes_line#*:} | sed 's/\,/\n/g' > ${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
}
echo
Rscript
--vanilla
${
EXTEND_DIR
}
/get_extended_network.R
${
genes_out_path
}
${
EXTEND_CONFIG
}
check_exit_code
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
$PYTHON_BIN
$ASSOCIATIONS_DIR
/minerva_genes.py
-f
${
genes_out_path
}
>
${
minerva_genes_out_path
}
check_exit_code
log
"Genes stored in
${
minerva_genes_out_path
}
"
var_line
=
`
cat
${
genes_variants_out_path
}
|
grep
"variants in total"
`
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
#*
:
}
|
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
$PYTHON_BIN
$ASSOCIATIONS_DIR
/minerva_variants.py
-f
${
variants_out_path
}
>
${
minerva_variants_out_path
}
log
"Detailed variants information obtained"
check_exit_code
if
[
${
STOP_AFTER_STAGE
}
=
1
]
;
then
...
...
@@ -86,7 +98,7 @@ if [ ${STOP_AFTER_STAGE} = 1 ]; then
exit
0
fi
# ------------------------------ 2. Obtain pathways ------------------------------
echo
"Retrieving enriched pathways"
log
"Retrieving enriched pathways
...
"
tr
'\r'
'\n'
<
${
ENRICHMENT_CONFIG
}
>
${
ENRICHMENT_CONFIG_TMP
}
...
...
@@ -104,7 +116,7 @@ mv enriched_pathways.txt ${enriched_paths_out_path}
rm
${
ENRICHMENT_CONFIG_TMP
}
echo
"Enriched pathways
obtain
ed"
log
"Enriched pathways
retriev
ed"
if
[
${
STOP_AFTER_STAGE
}
=
2
]
;
then
...
...
@@ -118,16 +130,16 @@ if [ ${BUILD_MAP_GENERATOR} = 1 ]; then
mvn
-DskipTests
=
true
clean
install
-pl
biohackathon
-am
cd
..
fi
echo
"Map generator built"
echo
"Assembling the map from pathways ..."
log
"Map generator built"
log
"Assembling the map from pathways ..."
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} --output-file ${map_out_path}
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_layouts
=
${
tmp_dir
}
/layouts/
...
...
@@ -147,4 +159,4 @@ cd -
mv
${
tmp_dir
}
/tmp.zip
${
map_zip_out_path
}
rm
-rf
${
tmp_dir
}
echo
"Final map with overlays stored in
${
map_zip_out_path
}
"
\ No newline at end of file
log
"Final map with overlays stored in
${
map_zip_out_path
}
"
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment