Unverified Commit 1839866a authored by Yun YAN's avatar Yun YAN Committed by GitHub
Browse files

🇨🇳 release v0.5.2

v0.5.2-b
parents 81fad008 b044f324
......@@ -84,12 +84,12 @@ def plotly_qc(fpath, saveto, sep=',', name=''):
total_num_UMIs = expr.sum(axis=0)
num_detected_genes = (expr > 0).sum(axis=0)
mt_index = pd.Series(
[x for x in expr.index if x.startswith('mt-') or x.startswith('MT-')])
mt_index = [x for x in expr.index if x.startswith(
'mt-') or x.startswith('MT-')]
if not mt_index:
percent_mt = 0
else:
mt_umis = expr.loc[mt_index, :].sum(axis=0)
mt_umis = expr.loc[pd.Series(mt_index), :].sum(axis=0)
percent_mt = mt_umis / total_num_UMIs
percent_mt = percent_mt.replace(np.inf, 0)
......
......@@ -23,6 +23,10 @@ STAR: '/absolute/path/to/star'
## Whare is the directory to save STAR index?
STAR_INDEX_DIR: '/absolute/path/to/star/folder/'
## Extra parameters to run aligner. For example:
## '--outSAMmultNmax 1 --outFilterScoreMinOverLread 0.3'
ALIGNER_EXTRA_PARAMETERS: ''
####################################
## Annotations ##
####################################
......
......@@ -43,6 +43,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)
ALIGNER_EXTRA_PARAMETERS = config.get('ALIGNER_EXTRA_PARAMETERS', '')
## Annotations ##
# '/ifs/data/yanailab/refs/danio_rerio/danRer10_87/gtf/Danio_rerio.GRCz10.87.gtf.gz'
GFF = config.get('GFF', None)
......@@ -345,20 +347,21 @@ if ALIGNER == 'bowtie2':
sam = join_path(DIR_PROJ, SUBDIR_ALIGN_ITEM,
'{itemID}', ALIGNER+'.bigsam'),
params:
threads = num_threads
threads = num_threads,
aligner_extra_parameters = ALIGNER_EXTRA_PARAMETERS,
log:
join_path(DIR_PROJ, SUBDIR_LOG, '{itemID}',
'Align-Bowtie2.log')
run:
shell(
"""
{BOWTIE2} \
-p {params.threads} \
-x {BOWTIE2_INDEX_PREFIX} \
-U {input.fq} \
-S {output.sam} 2>{log} \
--seed 42
""")
cmd = '{BOWTIE2} '
cmd += '-p {params.threads} '
cmd += '-x {BOWTIE2_INDEX_PREFIX} '
cmd += '-U {input.fq} '
cmd += '-S {output.sam} '
cmd += '--seed 42 '
cmd += '{params.aligner_extra_parameters} '
cmd += '2>{log} '
shell(cmd)
if ALIGNER == 'star':
rule align_star:
......@@ -377,9 +380,10 @@ if ALIGNER == 'star':
star_prefix = join_path(DIR_PROJ, SUBDIR_ALIGN_ITEM,
'{itemID}', '.star', ''),
threads = num_threads,
aligner_extra_parameters = ALIGNER_EXTRA_PARAMETERS,
run:
mkfolder(params.star_prefix)
cmd = 'STAR '
cmd = '{STAR} '
cmd += ' --runRNGseed 42 '
cmd += ' --genomeLoad NoSharedMemory '
cmd += ' --runThreadN {params.threads} '
......@@ -388,6 +392,7 @@ if ALIGNER == 'star':
cmd += ' --readFilesIn {input.fq} '
cmd += ' --outFileNamePrefix {params.star_prefix} '
# cmd += ' --outSAMmultNmax 1 '
cmd += ' {params.aligner_extra_parameters} '
shell(cmd)
starsam = join_path(params.star_prefix, 'Aligned.out.sam')
......
......@@ -10,6 +10,17 @@
---
## :fa-flag-checkered: **v0.5.2**
:fa-calendar: **2018-04-16**
:fa-star: **Features**
- Generate QC plots for UMI-counts matrices. If ST is performed, an extra QC plot masked on grid is generated.
- Allow experienced users to feed extra parameters to align. See issue #10.
---
## :fa-flag-checkered: **v0.5.1**
:fa-calendar: **2018-04-05**
......
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