Commit fa9574f9 authored by yy1533's avatar yy1533
Browse files

🐶 possible codes to i) improve workflow modulization ii) support kallisto

parent 2db56b1b
......@@ -12,15 +12,15 @@ BC_LENGTH: 6
####################################
## Alignment Tools
####################################
## Which RNA-seq aligner to use? 'bowtie2' or 'star'
## Which RNA-seq aligner to use: 'bowtie2', 'star', 'kallisto'
ALIGNER: 'bowtie2'
## What is the absolute path to command bowtie2?
## What is the absolute path to the command bowtie2?
BOWTIE2: '/absolute/path/to/bowtie2'
## What is the sharef prefix of bowtie2 index?
## What is the shared prefix of bowtie2 index file names?
BOWTIE2_INDEX_PREFIX: '/absolute/path/to/bowtie2_index'
## What is the absolute path to command STAR?
## What is the absolute path to the command STAR?
STAR: '/absolute/path/to/star'
## Whare is the directory to save STAR index?
## Where is the directory to save STAR index?
STAR_INDEX_DIR: '/absolute/path/to/star/folder/'
## Extra parameters to run aligner. For example:
......
......@@ -44,6 +44,8 @@ BOWTIE2_INDEX_PREFIX = config.get('BOWTIE2_INDEX_PREFIX', None)
BOWTIE2 = config.get('BOWTIE2', None) # '/local/apps/bowtie2/2.3.1/bowtie2'
STAR_INDEX_DIR = config.get('STAR_INDEX_DIR', None)
STAR = config.get('STAR', None)
KALLISTO = config.get('KALLISTO', None)
KALLISTO_INDEX = config.get('KALLISTO_INDEX', None)
ALIGNER_EXTRA_PARAMETERS = config.get('ALIGNER_EXTRA_PARAMETERS', '')
# Annotations
......@@ -119,6 +121,8 @@ Part-2: Snakemake rules
'''
workdir: DIR_PROJ
include: 'sub.snakemake'
'''
Default task named "all" to request all outputs.
'''
......@@ -422,6 +426,38 @@ if ALIGNER == 'star':
shell('mv {starsam} {output.sam} ')
shell('mv {starlog} {output.log} ')
if ALIGNER == 'kallisto':
rule align_kallisto_pseudobam:
input:
fq = join_path(DIR_PROJ, SUBDIR_FASTQ,
'{itemID}', 'TAGGED.bigfastq'),
output:
sam = join_path(DIR_PROJ, SUBDIR_ALIGN_ITEM,
'{itemID}', ALIGNER + '.bigsam'),
params:
threads = num_threads,
kallisto_outdir_tmp = join_path(DIR_PROJ, SUBDIR_ALIGN_ITEM,
'{itemID}', '.kallisto', ''),
aligner_extra_parameters = ALIGNER_EXTRA_PARAMETERS,
# shadow: "shallow"
log:
join_path(DIR_PROJ, SUBDIR_LOG, '{itemID}',
'Align-Kallisto.log')
run:
cmd = '{KALLISTO} '
cmd += '--index {KALLISTO_INDEX} '
cmd += '--output-dir {params.kallisto_outdir_tmp} '
cmd += '--seed 42 --single --pseudobam '
cmd += '--fragment-length {CUT_LENGTH} '
cmd += '--sd 2 '
cmd += '--threads {params.threads} '
cmd += '{params.aligner_extra_parameters} '
cmd += '{input.fq} '
cmd += '>{output.sam} '
cmd += '2>{log} '
shell(cmd)
# Pipeline Step 2b: Combo-demultiplex the SAM file
rule combo_demultiplexing_sam:
input:
......
'''
Test if snakemake can include multiple snakmake files so that
we can better modulize the long workflow.
Answer is Yes.
'''
rule sub_test:
output: '_test_sub'
run:
shell('touch {output} ')
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment