Skip to content

Commit

Permalink
remove low_memory
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewprzh committed Dec 27, 2023
1 parent 938bc15 commit 919c4f0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,9 @@ We recommend _not_ to modify these options unless you are clearly aware of their
for storing the annotation database, because SQLite database cannot be created on a shared disks.
The folder will be created automatically.

`--low_memory`
Deprecated, default behaviour since 3.2.

`--high_memory`
Cache read alignments instead for making several passes over a BAM file, noticeably increases RAM usage.
Cache read alignments instead for making several passes over a BAM file, noticeably increases RAM usage,
but may improve running time when disk I/O is relatively slow.

`--min_mapq`
Filers out all alignments with MAPQ less than this value (will also filter all secondary alignments, as they typically have MAPQ = 0).
Expand Down
15 changes: 6 additions & 9 deletions isoquant.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ def add_hidden_option(*args, **kwargs): # show command only with --full-help
help="align reads to reference without running further analysis")

# ADDITIONAL
add_additional_option("--low_memory", help="decrease RAM consumption (deprecated, set by default)",
action='store_true', default=True)
add_additional_option("--high_memory", help="increase RAM consumption (store alignment and the genome in RAM)",
action='store_true', default=False)
add_additional_option("--no_junc_bed", action="store_true", default=False,
Expand Down Expand Up @@ -239,11 +237,13 @@ def add_hidden_option(*args, **kwargs): # show command only with --full-help
type=str, required=True)
resume_parser.add_argument('--debug', action='store_true', default=argparse.SUPPRESS,
help='Debug log output.')
resume_parser.add_argument("--threads", "-t", help="number of threads to use", type=int, default=argparse.SUPPRESS)
resume_parser.add_argument("--low_memory", help="decrease RAM consumption (deprecated, set by default)",
resume_parser.add_argument("--threads", "-t", help="number of threads to use",
type=int, default=argparse.SUPPRESS)
resume_parser.add_argument("--high_memory",
help="increase RAM consumption (store alignment and the genome in RAM)",
action='store_true', default=False)
resume_parser.add_argument("--keep_tmp", help="do not remove temporary files in the end",
action='store_true', default=argparse.SUPPRESS)
resume_parser.add_argument("--keep_tmp", help="do not remove temporary files in the end", action='store_true',
default=argparse.SUPPRESS)
args, unknown_args = resume_parser.parse_known_args(sys.argv[1:])
if unknown_args:
logger.error("You cannot specify options other than --output/--threads/--debug/--low_memory "
Expand Down Expand Up @@ -294,9 +294,6 @@ def check_and_load_args(args, parser):
elif not os.path.exists(args.genedb_output):
os.makedirs(args.genedb_output)

if args.high_memory:
args.low_memory = False

if not check_input_params(args):
parser.print_usage()
exit(-1)
Expand Down
4 changes: 2 additions & 2 deletions src/alignment_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def __init__(self, chr_id, bam_pairs, params, illumina_bam, genedb=None, chr_rec

self.bam_merger = BAMOnlineMerger(self.bam_pairs, self.chr_id, 0,
self.bam_pairs[0][0].get_reference_length(self.chr_id),
multiple_iterators=self.params.low_memory)
multiple_iterators=not self.params.high_memory)
self.strand_detector = StrandDetector(self.chr_record)
self.read_groupper = read_groupper
self.polya_finder = PolyAFinder(self.params.polya_window, self.params.polya_fraction)
Expand All @@ -238,7 +238,7 @@ def __init__(self, chr_id, bam_pairs, params, illumina_bam, genedb=None, chr_rec

def process(self):
current_region = None
alignment_storage = BAMAlignmentStorage(self.bam_merger) if self.params.low_memory else InMemoryAlignmentStorage()
alignment_storage = BAMAlignmentStorage(self.bam_merger) if not self.params.high_memory else InMemoryAlignmentStorage()

for bam_index, alignment in self.bam_merger.get():
if alignment_storage.alignment_is_not_adjacent(alignment):
Expand Down
2 changes: 1 addition & 1 deletion src/dataset_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def set_polya_requirement_strategy(flag, polya_requirement_strategy):

def collect_reads_in_parallel(sample, chr_id, args):
current_chr_record = Fasta(args.reference)[chr_id]
if not args.low_memory:
if args.high_memory:
current_chr_record = str(current_chr_record)
read_grouper = create_read_grouper(args, sample, chr_id)
lock_file = reads_collected_lock_file_name(sample.out_raw_file, chr_id)
Expand Down

0 comments on commit 919c4f0

Please sign in to comment.