Skip to content

Commit

Permalink
added model test mode
Browse files Browse the repository at this point in the history
- `gapseq test-long` reconstructs a model of E. coli, including all
  of gapseq's substeps. the resulting model is functional core model
- model test mode should run in 5-10min
  • Loading branch information
jotech committed Aug 1, 2024
1 parent c21966c commit 46f973a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
15 changes: 12 additions & 3 deletions gapseq
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ usage()
echo " gapseq pan -m toy/MGYG000*-draft.RDS -c toy/MGYG000*-rxnWeights.RDS -g toy/MGYG000*-rxnXgenes.RDS -w toy/MGYG000*.tbl.gz"
echo -e "\nOptions:"
echo " test Testing dependencies and basic functionality of gapseq."
echo " long-test Testing model reconstruction for a E. coli core genome."
echo " find Pathway analysis, try to find enzymes based on homology."
echo " find-transport Search for transporters based on homology."
echo " draft Draft model construction based on results from find and find-transport."
Expand All @@ -63,7 +64,7 @@ exit 1

for arg in $@
do
if [[ -f $arg && "$arg" != "test" ]]; then
if [[ -f $arg && ("$arg" != "test" || "$arg" != "test-long") ]]; then
if [ ! -r $arg ]; then
echo "No read access to file:" $arg
exit 1
Expand All @@ -78,7 +79,7 @@ if [[ "$1" == "doall" ]]; then
# If yes set OPTIND 2 to avoid reading "gapseq doall" and to parse all the options in the following while.
subcommand=$1
OPTIND=2
elif [[ "$1" =~ ^(test|find|find-transport|draft|adapt|medium|fill|pan)$ ]]; then
elif [[ "$1" =~ ^(test|test-long|find|find-transport|draft|adapt|medium|fill|pan)$ ]]; then
# If another command line (like find), the options are not parsed with getopts (as they will be parsed in their own script).
subcommand=$1
parse_options=false
Expand Down Expand Up @@ -146,6 +147,14 @@ fi
if [ "$subcommand" == "test" ]; then
$dir/src/test.sh

elif [ "$subcommand" == "test-long" ]; then
shift
$dir/src/gapseq_find.sh -v 0 -p min $dir/toy/ecore.faa.gz
$dir/src/transporter.sh -v 0 $dir/toy/ecore.faa.gz
Rscript $dir/src/generate_GSdraft.R -r ecore-min-Reactions.tbl -t ecore-Transporter.tbl -c $dir/toy/ecore.faa.gz -p ecore-min-Pathways.tbl
Rscript $dir/src/predict_medium.R -m ecore-draft.RDS -p ecore-min-Pathways.tbl
Rscript $dir/src/gf.suite.R -m ecore-draft.RDS -n ecore-medium.csv -c ecore-rxnWeights.RDS -g ecore-rxnXgenes.RDS -q

elif [ "$subcommand" == "find" ]; then
shift
$dir/src/gapseq_find.sh "$@"
Expand Down Expand Up @@ -187,7 +196,7 @@ elif [ "$subcommand" == "doall" ]; then
[[ ("$3" == "Bacteria" || "$4" == "Bacteria") ]] && taxonomy=Bacteria
[[ ("$3" == "Archaea" || "$4" == "Archaea") ]] && taxonomy=Archaea
$dir/src/gapseq_find.sh -v $verbose -b 200 -p all -t $taxonomy -K $n_threads "$file"
$dir/src/transporter.sh -b 200 -K $n_threads "$file"
$dir/src/transporter.sh -v $verbose -b 200 -K $n_threads "$file"
Rscript $dir/src/generate_GSdraft.R -r "$id-all-Reactions.tbl" -t "$id-Transporter.tbl" -c "$file" -u 200 -l 100 -p "$id-all-Pathways.tbl" -b $taxonomy
[[ ! -s "$3" ]] && Rscript $dir/src/predict_medium.R -m "./${id}-draft.RDS" -p "$id-all-Pathways.tbl"
Rscript $dir/src/gf.suite.R -m "./${id}-draft.RDS" -n "$medium" -c "./${id}-rxnWeights.RDS" -b 100 -g "./${id}-rxnXgenes.RDS"
Expand Down
6 changes: 3 additions & 3 deletions src/gapseq_find.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ case $pathways in
core)
pwyKey="Amino-Acid-Biosynthesis|Nucleotide-Biosynthesis|Cofactor-Biosynthesis|Carbohydrates-Degradation|CARBO-BIOSYNTHESIS|Polyamine-Biosynthesis|Fatty-acid-biosynthesis|Energy-Metabolism|Terpenoid-Biosynthesis|Chorismate-Biosynthesis"
;;
small)
pwyKey="Amino-Acid-Biosynthesis|Nucleotide-Biosynthesis|Cofactor-Biosynthesis|Energy-Metabolism|Sugars-And-Polysaccharides-Degradation"
;;
min)
pwyKey="\\|ETOH-ACETYLCOA-ANA-PWY\\||\\|GLNSYN-PWY\\||\\|GLUCONEO-PWY\\||\\|GLUGLNSYN-PWY\\||\\|GLUTAMATE-DEG1-PWY\\||\\|GLUTAMATE-SYN2-PWY\\||\\|GLUTAMINEFUM-PWY\\||\\|GLUTSYNIII-PWY\\||\\|GLYCOLYSIS\\||\\|GLYOXYLATE-BYPASS\\||\\|NONOXIPENT-PWY\\||\\|OXIDATIVEPENT-PWY\\||\\|P185-PWY\\||\\|P21-PWY\\||\\|PWY0-1312\\||\\|PWY0-1315\\||\\|PWY0-1329\\||\\|PWY0-1334\\||\\|PWY0-1335\\||\\|PWY0-1353\\||\\|PWY0-1517\\||\\|PWY0-1565\\||\\|PWY0-1567\\||\\|PWY0-1568\\||\\|PWY-4341\\||\\|PWY-5084\\||\\|PWY-5480\\||\\|PWY-5482\\||\\|PWY-5484\\||\\|PWY-5690\\||\\|PWY-5766\\||\\|PWY-5913\\||\\|PWY-6028\\||\\|PWY-6333\\||\\|PWY-6543\\||\\|PWY-6549\\||\\|PWY66-21\\||\\|PWY66-398\\||\\|PWY-6697\\||\\|PWY-6964\\||\\|PWY-7167\\||\\|PWY-7685\\||\\|PWY-7686\\||\\|PWY-7980\\||\\|PWY-8178\\||\\|PWY-8215\\||\\|PWY-8274\\||\\|PWY-8404\\||\\|PYRUVDEHYD-PWY\\||\\|TCA-1\\||\\|TCA\\|"
;;
small)
tca="\\|TCA\\||P105-PWY"
resp="PWY-7544|PWY0-1334"
ferm="PYR-TO-BUT-NADPH|2FLHYD|PWY-7385|PWY-6344|PWY-5938|PWY-5494|PWY-5497|P164-PWY|PWY-8086|PWY-5677|PWY-8014|P162-PWY|CENTFERM-PWY|P122-PWY|PWY-6130|P108-PWY|PYR-ACCOA-FROX|BIFIDOSHUNT2|LNT-DEGRADATION|PWY-6583|PWY-5437|FERMENTATION-PWY"
Expand Down
Binary file added toy/ecore.faa.gz
Binary file not shown.

0 comments on commit 46f973a

Please sign in to comment.