moiexpositoalonsolab / grenepipe

A flexible, scalable, and reproducible pipeline to automate variant calling from raw sequence reads, with lots of bells and whistles.
http://grene-net.org
GNU General Public License v3.0
93 stars 21 forks source link

config file error #26

Closed BFeldmeyer closed 1 year ago

BFeldmeyer commented 2 years ago

Hi there, I was trying to use the most recent version of grenepipe since we had issues with getting all files processed previously. I am now getting the following error "WorkflowError in line 28 of /cluster/home/bin/grenepipe-0.10.0/rules/common.smk: Config file is not valid JSON or YAML. In case of YAML, make sure to not mix whitespace and tab indentation. File "/cluster/home/bin/grenepipe-0.10.0/Snakefile", line 7, in File "/cluster/home/bin/grenepipe-0.10.0/rules/common.smk", line 28, in "

Line 28 does not contain any intendation, not sure what the problem is....? Would be great if you could help out. best Barbara

lczech commented 2 years ago

Hi Barbara,

thanks for giving grenepipe another shot - do yuo rembember what the issues were when you previously tested it? If it is fixed by now, all good - but if not, let me know! Happy to help!

As for your current issue: The error occurs in line 28 of the file rules/common.smk, because that is where the config.yaml is loaded. It is however not the problem itself. Somewhere in the config.yaml seems to be a part that does not follow yaml rules (such as indentation rules). I assume that you edited the config.yaml to your needs for running the pipeline? If you could post this file here, I can have a look. It's likely that you accidentally edited it in a way that is not conforming with yaml any more.

Cheers and so long Lucas

lczech commented 1 year ago

Hey @BFeldmeyer, any update on this? It just looks like that your config.yaml accidentally got broken, so I hope that this is not too hard to fix. Let me know if I can help ;-)

AdeleCrane commented 1 year ago

Hi, I had this issue as well!

I found that editing it in Atom actually removed most of the indentation and that was fixed in XCode. I also kept having the error until I made sure that certain extra parameters were on the same line. For example, the raw config.yaml file had this for GATK hard filters:

INDEL:
    "QD < 2.0 || FS > 200.0 || ReadPosRankSum < -20.0"

I edited so that the parameters were on the same line:

INDEL: "QD < 2.0 || FS > 200.0 || ReadPosRankSum < -20.0"

Is there a different editing program you recommend? I'm not sure if this is part of the original config.yaml file or a function of XCode (given my previous trouble with Atom).

Thanks, Adele

lczech commented 1 year ago

Hi @AdeleCrane,

thanks for bringing this up, the INDEL thing is indeed not correctly set up in the original config file, I will fix this! It should be on the same line, as you said.

However, for me (Snakemake 6.0.5) it still works - that's why I didn't notice before. Are you using a different version of Snakemake or Python than described in the wiki? That might explain why it fails for you, but not for me. Doesn't really matter, as this is clearly an issue in the original config file, but I'm curious why this is only affecting some and not others.

As for the editor: I am using Atom myself, and are quite happy with it. You might need to change your indentation settings, see for example here. Usually, you should be able to configure any decent editor to not mess up your tabs, or it should ideally recognize the file format and do the right thing out of the box. It's working fine with Atom for me, so maybe you have changed some of the indentation related settings? For example, in my version (Atom 1.57.0), I have Auto Indent active, and Auto Indent On Paste. Also, I'd highly recommend to activate Show Invisibles, so that you see if spaces or tabs are used, and can avoid mixing them by accident.

Hope that helps Lucas

lczech commented 1 year ago

Okay, fixed the indentation issue with INDEL and SNP in the latest commit.

Also, for future reference, @BFeldmeyer and @AdeleCrane, you can install the program yamllint on your computer and run it from within the main grenepipe directory as follows to check your file:

yamllint -c schemas/yamllint.yaml path/to/your/config.yaml

This will output a few minor warnings about some long lines, and comments, but should not report any errors.

Alternatively, you can paste your whole config.yaml file here to check its validity: http://www.yamllint.com/

I'm closing the issue for now, but feel free to re-open should there be any further issues!

Cheers Lucas