franciscozorrilla / metaGEM

:gem: An easy-to-use workflow for generating context specific genome-scale metabolic models and predicting metabolic interactions within microbial communities directly from metagenomic data
https://franciscozorrilla.github.io/metaGEM/
MIT License
203 stars 42 forks source link

Update needed to modelVis rule for models reconstructed using CarveMe version>=1.5.0 #52

Open shreyanshumale opened 3 years ago

shreyanshumale commented 3 years ago

Hello, again Francisco!

I think I figured out the problem with the modelVis rule. Just small corrections are needed for users working with a carveme >1.5.0.

Changes (In the Snakefile): In lines 1511 to 1518:

while read model;do 
            id=$(echo $(basename $model)|sed 's/.xml//g'); 
            mets=$(less $model| grep "species id="|cut -d ' ' -f 8|sed 's/..$//g'|sort|uniq|wc -l);
            rxns=$(less $model|grep -c 'reaction id=');
            genes=$(less $model|grep 'fbc:geneProduct fbc:id='|grep -vic spontaneous);
            echo "Model: $id has $mets mets, $rxns reactions, and $genes genes ... "
            echo "$id $mets $rxns $genes" >> GEMs.stats;
        done< <(find . -name "*.xml")
  1. species id ----->species metaid
  2. reaction id ------>reaction metaid
  3. fbc:geneProduct fbc:id ------>fbc:geneProduct metaid

These changes are reflected in a smooth run of this rule!

I hope this helps!

P.S.: I am still trying to figure out the multiple job submission on an OGE cluster and the memote errors. I will keep you posted if I find something!

Thanks and regards, Shreyansh

franciscozorrilla commented 3 years ago

Hey Shreyansh,

Thank you for bringing this up, I would not have found this bug myself since I am using v1.4.1 of CarveMe. Will implement your suggested changes soon :)

Best wishes, Francisco