-
Notifications
You must be signed in to change notification settings - Fork 45
Species metabolic coupling analysis with SMETANA
Francisco Zorrilla edited this page Mar 22, 2021
·
2 revisions
Now we organize our GEMs into sample specific folders prior to simulation using organizeGEMs
:
rule organizeGEMs:
input:
f'{config["path"]["root"]}/{config["folder"]["refined"]}'
message:
"""
Organizes GEMs into sample specific subfolders, assumes that the refined_bins folder has sample-specific subfolders.
Necessary to run smetana per sample using the IDs wildcard.
"""
shell:
"""
cd {input}
for folder in */;do
echo -n "Creating GEM subfolder for sample $folder ... "
mkdir -p ../{config[folder][GEMs]}/$folder;
echo -n "moving GEMs ... "
mv ../{config[folder][GEMs]}/$(echo $folder|sed 's|/||')_*.xml ../{config[folder][GEMs]}/$folder;
echo "done. "
done
"""
Now we switch back to using the wildcard expansion of sample specific {{IDs}}
to run SMETANA
simulations per sample:
rule smetana:
input:
f'{config["path"]["root"]}/{config["folder"]["GEMs"]}/{{IDs}}'
output:
f'{config["path"]["root"]}/{config["folder"]["SMETANA"]}/{{IDs}}_detailed.tsv'
benchmark:
f'{config["path"]["root"]}/benchmarks/{{IDs}}.smetana.benchmark.txt'
shell:
"""
set +u;source activate {config[envs][metabagpipes]};set -u
mkdir -p {config[path][root]}/{config[folder][SMETANA]}
cp {config[path][root]}/{config[folder][scripts]}/{config[scripts][carveme]} {input}/*.xml $SCRATCHDIR
cd $SCRATCHDIR
smetana -o $(basename {input}) --flavor fbc2 \
--mediadb media_db.tsv -m {config[params][smetanaMedia]} \
--detailed \
--solver {config[params][smetanaSolver]} -v *.xml
cp *.tsv {config[path][root]} #safety measure for backup of results in case rule fails for some reason
mv *.tsv $(dirname {output})
"""
- Quality filter reads with fastp
- Assembly with megahit
- Draft bin sets with CONCOCT, MaxBin2, and MetaBAT2
- Refine & reassemble bins with metaWRAP
- Taxonomic assignment with GTDB-tk
- Relative abundances with bwa
- Reconstruct & evaluate genome-scale metabolic models with CarveMe and memote
- Species metabolic coupling analysis with SMETANA