Skip to content

Commit

Permalink
fix star sort memory bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fei0810 committed Aug 22, 2021
1 parent c53973c commit a575c29
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ You can also use [Triti-Map](https://hub.docker.com/r/fei0810/tritimap) via Dock

```sh
# docker pull command
docker pull fei0810/tritimap:v0.9.6
docker pull fei0810/tritimap:v0.9.7
# run docker
docker run -i -t fei0810/tritimap:v0.9.6 /bin/bash
docker run -i -t fei0810/tritimap:v0.9.7 /bin/bash
```

#### Installing from GitHub
Expand Down
4 changes: 2 additions & 2 deletions docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ You can also use [Triti-Map](https://hub.docker.com/r/fei0810/tritimap) via Dock

```sh
# docker pull command
docker pull fei0810/tritimap:v0.9.6
docker pull fei0810/tritimap:v0.9.7
# run docker
docker run -i -t fei0810/tritimap:v0.9.6 /bin/bash
docker run -i -t fei0810/tritimap:v0.9.7 /bin/bash
```

### Installing from GitHub
Expand Down
4 changes: 2 additions & 2 deletions docs/manual_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ python setup.py install

```sh
# 下载 Triti-Map
docker pull fei0810/tritimap:v0.9.6
docker pull fei0810/tritimap:v0.9.7
# 运行 Docker 镜像
docker run -i -t fei0810/tritimap:v0.9.6 /bin/bash
docker run -i -t fei0810/tritimap:v0.9.7 /bin/bash
```

## 准备相关文件
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="tritimap",
version="0.9.6",
version="0.9.7",
author="Fei Zhao",
author_email="zhaofei920810@gmail.com",
url="https://github.com/fei0810/Triti-Map",
Expand Down
7 changes: 7 additions & 0 deletions tritimap/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ elif config['maxthreads'] < 10:
else:
exit("need set maxthreads")

### max memory ####

if config['memory'] <= 100:
star_memory = 100*1000000000
else:
star_memory = config['memory']*1000000000

#### GATK java parameter ####

java_parameter = '--java-options "-Xmx'+str(config['memory'])+"G"+' -Djava.io.tmpdir='+dir_path+'"'
Expand Down
2 changes: 1 addition & 1 deletion tritimap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os

__version__ = "0.9.6"
__version__ = "0.9.7"

root_dir = os.path.dirname(os.path.abspath(__file__))
2 changes: 1 addition & 1 deletion tritimap/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ snpindex:
# If your chip-seq data have multiple histone modification types, option 'split' is recommended when the server memory is less than 300G.
# merge_lib option: merge/split
merge_lib: merge
# the memory(G) spades software can use when assemble RNA-seq data
# the memory(G) spades and STAR software can use when assemble and mapping RNA-seq data
memory: 400
# the kmer abyss software can use when assemble ChIP-seq data, 90 is recommended. No change needed!
abyss:
Expand Down
5 changes: 3 additions & 2 deletions tritimap/rules/rna_mapping.smk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rule STAR1Mapping:
--genomeDir {params.stardir} --readFilesCommand zcat \
--readFilesIn {input} \
--outFileNamePrefix {output.dir}/{params.bulk}_{params.bulktype} \
--outSAMtype BAM Unsorted --limitBAMsortRAM 10000000000 > {log} 2>&1
--outSAMtype BAM Unsorted --limitBAMsortRAM 100000000000 > {log} 2>&1
"""

rule STAR2Mapping:
Expand All @@ -31,6 +31,7 @@ rule STAR2Mapping:
params:
stardir = config['ref']['STARdir'],
sharemem = "NoSharedMemory",
sort_mem = star_memory,
bulk = lambda wildcards: wildcards.bulk,
bulktype = lambda wildcards: wildcards.bulktype
output:
Expand All @@ -45,7 +46,7 @@ rule STAR2Mapping:
--genomeDir {params.stardir} --readFilesCommand zcat \
--readFilesIn {input.fq} \
--outFileNamePrefix {output.dir}/{params.bulk}_{params.bulktype} \
--outSAMtype BAM SortedByCoordinate --limitBAMsortRAM 10000000000 \
--outSAMtype BAM SortedByCoordinate --limitBAMsortRAM {params.sort_mem} \
--sjdbFileChrStartEnd {input.sj} \
--outReadsUnmapped Fastx > {log} 2>&1 ;
samtools index -c {output.step2bam}
Expand Down

0 comments on commit a575c29

Please sign in to comment.