f(a, b, lambda c: int, d: int : c + d). Most (modern?) languages uses arrows, for good reason.
f(a, b, lambda c, d: c + d)takes so much more mental processing to read vs.
f(a, b, (c, d) => c + d).
result = f(a, b, (c, d) => x = c ** 2 y = c + d x + y # `return` should be optional, keeping consistency with single-line variant )
Seq installed at: /home/mhenders/.seq Make sure to update your PATH environment variable: export PATH="/home/mhenders/.seq/bin:$PATH"
zipas in Python) then printing the two records.
Is there a way to get
open_func: Union[function[gzFile,str,str], function[File,str,str]] = open open_func = open open_mode = 'w' # Define open function and open mode to the correct setting, depending on the fact # that the output file is gzipped or not. if fastq_filename.endswith('.gz'): open_func = gzip.open open_mode = 'wb6' else: open_func = open open_mode = 'w' with open_func(fastq_filename, open_mode) as fastq_fh:
open_funcbehave like I want (
openare different types)?
def process_file(fastq_fh): ... if fastq_filename.endswith('.gz'): with gzip.open(fastq_filename, 'wb6') as fastq_fh: process_file(fastq_fh) else: with open(fastq_filename, 'w') as fastq_fh: process_file(fastq_fh)
process_fileis a generic function -- I believe the APIs for normal files and for gzip'd files should be basically identical
pigz(parallel gzip). I was using the buildin gzip functionality (with gzip level 6) before, but then my script takes 35 minutes to run on that FASTQ file. After just writing to a file or stdout, it takes less than 8 minutes. When compressing that plain text output with
gzip -6it takes 15 minutes to compress (same time them when running the script and piping the output directly to
gzip -6. When piping the plain text output (uncompressed modifed FASTQ file) of my script to
pigz -t 4 -6, it takes less than8 minutes too. So buildin gzip compression seems to be quite slow. Being able to write directly to stdin of pigz (or other tools) would be great. In AWK output redirection to commands exists: https://www.gnu.org/software/gawk/manual/gawk.html#Redirection
[s''] * N)