-
Notifications
You must be signed in to change notification settings - Fork 44
feat: integrate hla typing with orthanq #391
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
Open
johanneskoester
wants to merge
16
commits into
master
Choose a base branch
from
feat/orthanq
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
05ee3fd
initial commit
johanneskoester 1a8c8f6
todos
johanneskoester 2437682
prototype work
huzuner 3e22f3b
fix
huzuner 6b805e1
fix caller wildcard to contain orthanq and the locus nam, add new rul…
huzuner 82bc1b4
fmt
huzuner ee1cbbf
implement sample-level output for orthanq
huzuner 0ea01ce
add hla-typing to config_primers
huzuner d29f552
add hla-typing to configs of all tests
huzuner de3abe1
output per alias names instead of sample names
huzuner 927af17
use orthanq wrappers
huzuner 57fd8bb
Update workflow/rules/hla_typing.smk
huzuner 17f9c45
fix wrapper version
huzuner ecbf499
Merge branch 'feat/orthanq' of github.com:snakemake-workflows/dna-seq…
huzuner 6ee2287
update sra-tools wrapper version
huzuner 2050598
activate cleanup for sra_download
huzuner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - orthanq =1.15.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # dowloads latest IMGT/HLA database version | ||
| rule get_hla_genes_and_xml: | ||
| output: | ||
| genes="results/preparation/hla_gen.fasta", | ||
| xml="results/preparation/hla.xml.zip", | ||
| log: | ||
| "logs/get_hla_genes_and_xml.log", | ||
| params: | ||
| genes_link="ftp://ftp.ebi.ac.uk/pub/databases/ipd/imgt/hla/hla_gen.fasta", | ||
| xml_link="ftp://ftp.ebi.ac.uk/pub/databases/ipd/imgt/hla/xml/hla.xml.zip", | ||
| shell: | ||
| "wget -c {params.genes_link} -O {output.genes} && " | ||
| "wget -c {params.xml_link} -O {output.xml} 2> {log}" | ||
|
|
||
huzuner marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| rule unzip_xml: | ||
| input: | ||
| "results/preparation/hla.xml.zip", | ||
| output: | ||
| xml="results/preparation/hla.xml", | ||
| log: | ||
| "logs/unzip_xml.log", | ||
| params: | ||
| path_to_unzip=lambda wc, output: os.path.dirname(output.xml), | ||
| shell: | ||
| "unzip -o {input} -d {params.path_to_unzip}" | ||
huzuner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| rule orthanq_candidate_variants: | ||
| input: | ||
| genome=genome, | ||
| xml="results/preparation/hla.xml", | ||
| alleles="results/preparation/hla_gen.fasta", | ||
| output: | ||
| temp(directory("results/orthanq-candidate-calls-temp/")) | ||
| log: | ||
| "logs/orthanq_candidates/candidates.log", | ||
| threads: 8 | ||
| params: | ||
| command="candidates", | ||
| subcommand="hla", | ||
| output_bcf=True | ||
| wrapper: | ||
| "v7.6.2/bio/orthanq" | ||
huzuner marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| rule rename_candidate_bcf: | ||
| input: | ||
| "results/orthanq-candidate-calls-temp/" | ||
| output: | ||
| "results/orthanq-candidate-calls/orthanq-{locus}.hla-variants.bcf" | ||
| log: | ||
| "logs/scatter-candidates/rename_candidates_{locus}.log", | ||
| shell: | ||
| "cp {input}/{wildcards.locus}.bcf {output}" | ||
|
|
||
|
|
||
| # The scatter_candidates rule does not work without group wildcards. | ||
| rule scatter_candidates_orthanq: | ||
| input: | ||
| "results/orthanq-candidate-calls/{orthanq_locus}.hla-variants.bcf", | ||
| output: | ||
| scatter.calling( | ||
| "results/orthanq-candidate-calls/{{orthanq_locus}}.hla-variants.{scatteritem}.bcf" | ||
| ), | ||
| log: | ||
| "logs/scatter-candidates/{orthanq_locus}.log", | ||
| conda: | ||
| "../envs/rbt.yaml" | ||
| shell: | ||
| "rbt vcf-split {input} {output}" | ||
|
|
||
|
|
||
| rule gather_annotated_calls_orthanq: | ||
| input: | ||
| calls=gather.calling("results/calls/{{group}}.{{caller}}.{scatteritem}.bcf"), | ||
| idx=gather.calling("results/calls/{{group}}.{{caller}}.{scatteritem}.bcf.csi"), | ||
| output: | ||
| "results/calls/{group}.{caller}.bcf", | ||
| log: | ||
| "logs/gather-hla-variants/{group}.{caller}.log", | ||
| params: | ||
| extra="-a", | ||
| group: | ||
| "annotation" | ||
| wrapper: | ||
| "v2.3.2/bio/bcftools/concat" | ||
|
|
||
|
|
||
| rule orthanq_call_hla: | ||
| input: | ||
| haplotype_calls="results/calls/{group}.{caller}.bcf", | ||
| haplotype_variants="results/orthanq-candidate-calls/{caller}.hla-variants.bcf", | ||
| xml="results/preparation/hla.xml", | ||
| output: | ||
| directory("results/hla-typing/{group}-{caller}/{alias}") | ||
| log: | ||
| "logs/orthanq/{group}-{alias}-{caller}.log", | ||
| params: | ||
| command="call", | ||
| subcommand="hla", | ||
| prior="diploid", | ||
| extra="" | ||
| wrapper: | ||
| "v7.6.2/bio/orthanq" | ||
|
|
||
| # TODO add other outputs (plots), fill missing inputs and commands | ||
| # TODO decide how to handle deactivation of biases in varlociraptor: | ||
| # my current favorite is a special INFO tag in the orthanq candidates. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.