snakemake-workflows / dna-seq-gatk-variant-calling

This Snakemake pipeline implements the GATK best-practices workflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError in calling.smk rule merge_variants. The bwa mapping stops after creating the indexes files.

ClaraApicella opened this issue · comments

Hello,

I am running the workflow on a small test sample set (n=6) and I get the following error:

`InputFunctionException in rule merge_variants in file https://raw.githubusercontent.com/snakemake-workflows/dna-seq-gatk-variant-calling/v2.1.1/workflow/rules/calling.smk, line 64:
Error:
TypeError: read_table() got an unexpected keyword argument 'squeeze'
Wildcards:

Traceback:
File "https://raw.githubusercontent.com/snakemake-workflows/dna-seq-gatk-variant-calling/v2.1.1/workflow/rules/calling.smk", line 67, in
File "https://raw.githubusercontent.com/snakemake-workflows/dna-seq-gatk-variant-calling/v2.1.1/workflow/rules/common.smk", line 44, in get_contigs`

This appears while bwa is running to generate the index files ( genome.dict, genome.fasta.amb, genome.fasta.ann, genome.fasta.fai, genome.fasta.pac) and the run stops after the .bwt file is completed, but it does not proceed to the mapping step.

I cannot attach the config files becuse the formats are not supported, so I am attaching the .txt version of them.

Could you please help me in solving this issue?

config.txt
samples.txt
units.txt

The Traceback and the TypeError actually point to the problem: The function get_contigs() in line 44 of common.smk uses the pandas function read_table() with the argument squeeze=True:

return pd.read_table(fai, header=None, usecols=[0], squeeze=True, dtype=str)

As the TypeError points out, this is not a known keyword argument for that read_table() function. Previously, this keyword argument existed for this function, which is why it was used here. But the squeeze keyword argument to read_table() was deprecated in pandas a while ago (I think with version 1.4), and snakemake pulls in a newer pandas version (for example, I get pandas 2.0.2 for snakemake 7.26.0 with the conda installation).

I think the fix here would be to use the equivalent .squeeze("columns") on the data frame resulting from the read_table(). Would you feel comfortable providing a pull request with that change?

And also two side-notes:

  1. We don't actively maintain this workflow. For variant calling, I would instead recommend the dna-seq-varlociraptor workflow.
  2. For pasting code lines, GitHub provides Markdown syntax, which is really easy to use. You can also use that to paste the content of .txt files in-line.

Hello @dlaehnemann, thank you very much for your answer and sorry about the formatting of my question. I think I don't feel confortable asking for the change because I feel like I am too new to this and don't really feel like I know what I am talking about. Would you be able to do it?

Thank you for your suggestion, I would like to use the varlociraptor workflow for dealing with pedigrees, I didn't realise I could also use it for general variant-calling scenarios.

No worries about the formatting, it's not always clear where and how to find info such as the docs for the GitHub Markdown syntax. And you definitely provided all the info that was needed for figuring out the problem and we need such error reports to fix and improve the workflows. So thanks to you!

The issue you report here, should be addressed by pull request #40. Once that is merged, feel free to retest your workflow setup.

And as for varlociraptor, you can create all kinds of calling scenarios that can include different kinds of sample dependencies. These can be mendelian inheritance relationships (pedigrees), or clonal inheritance (e.g. tumors and metastases) and all kinds of allele frequency setups. There is a little catalog of example scenarios in the docs:
https://varlociraptor.github.io/varlociraptor-scenarios/landing/

And more detailed docs about how to write such a scenario is here:
https://varlociraptor.github.io/docs/calling/#generic-variant-calling

And also feel free to ask questions in the varlociraptor repository or the repository of the snakemake workflow using varlociraptor.

Thank you so much for submitting the pull request and for all these info on varlociraptor I will look it up!

Hello dlaehnemann and ClaraApicella

Thank you for this issue, I have the same problem while testing this GATK workflow.
I saw in request #40 that we have to change squeeze=True by .squeeze("columns"), which is perfectly clear.

But as I am new in snakemake, which file do I have to modify and how can I rerun the modified workflow to fix this please ?
thanks for your help.

The example in the issue #40 is
y = pd.read_csv(path, index_col=0, squeeze=True, dtype={1: float})
to replace by y = pd.read_csv(path, index_col=0, dtype={1: float}).squeeze("columns")

Regards

Ah, sorry, PR #40 was never quite finished. I'll try and follow it up to get this fixed. Once this PR is merged, I can release a new version of the workflow and you should simply be able to run it with this new version number.

Thanks David.
You rock