Skip to content

Commit

Permalink
Added version number
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnmy committed Dec 1, 2020
1 parent e8c68bf commit a8e00f2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Prerequirements

To be able to use `RiboDetector`, all you need to do is to install `Python 3.8` with `conda` and Python libraries: `tqdm`, `numpy`, `biopython`, `torch`, `onnxruntime` (if run on CPU mode) using `pip`, for example:
To be able to use `RiboDetector`, all you need to do is to install `Python 3.8` (make sure you have version `3.8` because `3.7` cannot serialize a string larger than 4GiB) with `conda` and Python libraries: `tqdm`, `numpy`, `biopython`, `torch` or `onnxruntime` (if run on CPU mode) using `pip`, for example:

```shell
conda create -n ribodetector python=3.8
Expand Down
2 changes: 1 addition & 1 deletion data_loader/seq_encoder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import itertools
# import itertools
import gzip
from Bio.Seq import Seq
from pathlib import Path
Expand Down
3 changes: 3 additions & 0 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from parse_config import ConfigParser
from torch.multiprocessing import Pool
from torch.utils.data import DataLoader
from utils.__version__ import __version__
from argparse import RawTextHelpFormatter
import data_loader.seq_encoder as SeqEncoder
from data_loader.dataset import SeqData, PairedReadData
Expand Down Expand Up @@ -654,6 +655,8 @@ def separate_paired_reads(self, r1, r1_labels, r2, r2_labels):
'Not needed when free RAM >=5 * your_file_size (uncompressed, sum of paired ends)',
'When chunk_size=256, memory=16 it will load 256 * 16 * 1024 reads each chunk (use ~20 GB for 100bp paired end)'
))
args.add_argument('-v', '--version', action='version',
version='%(prog)s {version}'.format(version=__version__))

if not isinstance(args, tuple):
args = args.parse_args()
Expand Down
6 changes: 5 additions & 1 deletion detect_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import onnxruntime
import numpy as np
from tqdm import tqdm
import torch.multiprocessing as mp
import multiprocessing as mp
from collections import defaultdict
from parse_config import ConfigParser
from utils.__version__ import __version__

from argparse import RawTextHelpFormatter
import data_loader.seq_encoder as SeqEncoder
Expand Down Expand Up @@ -432,6 +433,9 @@ def listener(self, q_pbar):
'When chunk_size=1024 and threads=10, each process will load 1024 reads, in total consumming 10G memory'
))

args.add_argument('-v', '--version', action='version',
version='%(prog)s {version}'.format(version=__version__))

if not isinstance(args, tuple):
args = args.parse_args()
if args.config is None:
Expand Down

0 comments on commit a8e00f2

Please sign in to comment.