-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: download of ClinGen dosage sensitivity (#61)
- Loading branch information
Showing
9 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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
3 changes: 3 additions & 0 deletions
3
excerpt-data/796c631dc892eda6/ClinGen_region_curation_list_GRCh38.tsv
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
excerpt-data/e424cce724cdc500/ClinGen_region_curation_list_GRCh37.tsv
Git LFS file not shown
Git LFS file not shown
This file contains 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,48 @@ | ||
## Output rules related to ClinGen dosage sensitivity regions. | ||
|
||
|
||
rule annos_features_clingen_dosage_download_to_bed: # -- convert ClinGen dosage sensitivity to BEd | ||
input: | ||
tsv="work/download/annos/{genome_release}/features/clingen_dosage/{date}/clingen_region_curation_list.tsv", | ||
output: | ||
bed="output/full/annonars/clingen-dosage-{genome_release}/{date}/clingen_region_curation_list.bed.gz", | ||
bed_md5="output/full/annonars/clingen-dosage-{genome_release}/{date}/clingen_region_curation_list.bed.gz.md5", | ||
bed_tbi="output/full/annonars/clingen-dosage-{genome_release}/{date}/clingen_region_curation_list.bed.gz.tbi", | ||
bed_tbi_md5="output/full/annonars/clingen-dosage-{genome_release}/{date}/clingen_region_curation_list.bed.gz.tbi.md5", | ||
spec_yaml="output/full/annonars/clingen-dosage-{genome_release}/{date}/clingen_region_curation_list.spec.yaml", | ||
shell: | ||
r""" | ||
if [[ "{wildcards.genome_release}" == "grch37" ]]; then | ||
chr_prefix= | ||
else | ||
chr_prefix=chr | ||
fi | ||
tail -n +8 {input.tsv} \ | ||
| awk -v chr_prefix=$chr_prefix -F $'\t' 'BEGIN {{ OFS=FS }} | ||
{{ | ||
if ($4 == "tbd") {{ | ||
next; /* skip, unmatched region */ | ||
}} | ||
region=$4; | ||
split($4, a, /[:-]/); | ||
sub(/^chr/, "", a[1]); | ||
print chr_prefix a[1], a[2] - 1, a[3], $0; | ||
}}' \ | ||
| LC_ALL=C sort -k1,1V -k2,2n \ | ||
| bgzip -c \ | ||
> {output.bed} | ||
tabix -f {output.bed} | ||
md5sum {output.bed} > {output.bed_md5} | ||
md5sum {output.bed_tbi} > {output.bed_tbi_md5} | ||
varfish-db-downloader tpl \ | ||
--template rules/output/annonars/clingen_dosage.spec.yaml \ | ||
--value today={wildcards.date} \ | ||
--value genome_release={wildcards.genome_release} \ | ||
\ | ||
--value v_downloader={PV.downloader} \ | ||
> {output.spec_yaml} | ||
""" |
This file contains 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,13 @@ | ||
dc.identifier: annonars/features/clingen-dosage:{{ version }}-{{ genome_release }} | ||
dc.title: ClinGen Dosage Sensitivity | ||
dc.creator: NCBI ClinGen Team | ||
dc.contributor: | ||
- VarFish Developer Teams | ||
dc.format: application/x-bed | ||
dc.date: {{ today }} | ||
x-version: {{ today }} | ||
x-genome-release: {{ genome_release }} | ||
dc.description: | | ||
BED file with ClinGen dosage sensitivity regions. | ||
dc.source: | ||
- https://search.clinicalgenome.org/kb/downloads#section_dosage |
This file contains 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,26 @@ | ||
## Work rules related to ClinGen dosage sensitivity regions. | ||
|
||
|
||
rule annos_features_clingen_dosage_download: # -- download ClinGen dosage sensitivity | ||
output: | ||
tsv="work/download/annos/{genome_release}/features/clingen_dosage/{date}/clingen_region_curation_list.tsv", | ||
tsv_md5="work/download/annos/{genome_release}/features/clingen_dosage/{date}/clingen_region_curation_list.tsv.md5", | ||
shell: | ||
r""" | ||
if [[ "$(date +%Y%m%d)" != "{wildcards.date}" ]] && [[ "{FORCE_TODAY}" != "True" ]]; then | ||
>&2 echo "{wildcards.date} is not today" | ||
exit 1 | ||
fi | ||
if [[ "{wildcards.genome_release}" == "grch37" ]]; then | ||
URL_RELEASE=GRCh37 | ||
else | ||
URL_RELEASE=GRCh38 | ||
fi | ||
wget --no-check-certificate \ | ||
-O {output.tsv} \ | ||
ftp://ftp.clinicalgenome.org/ClinGen_region_curation_list_${{URL_RELEASE}}.tsv | ||
md5sum {output.tsv} > {output.tsv_md5} | ||
""" |