Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ClaraApicella opened this issue Jun 5, 2023 · 7 comments · May be fixed by #40

Comments

@ClaraApicella
Copy link

ClaraApicella commented Jun 5, 2023

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

@dlaehnemann
Copy link

dlaehnemann commented Jun 6, 2023

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.

@ClaraApicella
Copy link
Author

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.

@dlaehnemann
Copy link

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.

@ClaraApicella
Copy link
Author

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

@luckyluke95
Copy link

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

@dlaehnemann
Copy link

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.

@luckyluke95
Copy link

Thanks David.
You rock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants