This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
3 deletions.
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
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,52 @@ | ||
# vim: syntax=python tabstop=4 expandtab | ||
# coding: utf-8 | ||
|
||
''' | ||
@author: jpreuss | ||
Provides rules for reference related modifications | ||
''' | ||
|
||
from snakemake.remote.FTP import RemoteProvider as FTPRemoteProvider | ||
FTP = FTPRemoteProvider() | ||
|
||
rule reference_download: | ||
input: | ||
FTP.remote(expand(config['reference']['URL'], **config['reference']), keep_local = True) | ||
output: | ||
GENCODE_FASTA | ||
threads: 1 | ||
message: | ||
'Downloading gencode transcriptome reference.' | ||
shell: | ||
""" | ||
zcat {input} > {output} | ||
""" | ||
|
||
if 'spikeIns' in config.get('reference', {}): | ||
rule reference_addSpikes: | ||
input: | ||
ref = GENCODE_FASTA, | ||
spike = config['reference']['spikeIns'] | ||
output: | ||
join(config['dirs']['ref'], config['reference']['organism'], config['reference']['release'] + '-withSpikeIns.fa') | ||
threads: 1 | ||
message: | ||
'Adding spike-in sequences to gencode transcriptome reference' | ||
shell: | ||
""" | ||
cat {input.ref} {input.spike} > {output} | ||
""" | ||
|
||
rule tx2gene_from_fasta: | ||
input: | ||
REFERENCE_FASTA | ||
output: | ||
join(config['dirs']['ref'], 'tx2gene', basename(REFERENCE_FASTA).rstrip(".fa")) | ||
threads: 1 | ||
message: | ||
'Creating tx2gene table from reference {input}.' | ||
shell: | ||
""" | ||
grep ">" {input} | tr -d '>' | cut -d'|' --output-delimiter=$'\t' -f1,2 | sed -e 's/\([A-Z]\+[[:digit:]]\+\)\(\.[[:digit:]]\+\)$/\\1/g' > {output} | ||
""" |