Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    A. R. Shajii
    @arshajii
    lambda x is so cumbersome IMO :D
    But we'll probably add it just for Python compatibility
    Mark Henderson
    @markhend
    Probably makes the most sense. Similar as well with no statements or type annotations?
    I thought you might go with something like hypot = (:($1**2 + $2**2)**0.5) :)
    Ibrahim Numanagić
    @inumanag
    Is there anything else except verbosity? The fact that it only accepts a single statement? Or there is sth more serious that I've missed so far. Would x, y => x + y be acceptable (my vote :) )?
    John Leung
    @fuzzthink
    @inumanag Yes, everything you just mentioned.
    1. Anonymous function is supposed to be quick to type, "lambda" defeats the purpose.
    2. Colon as parameter (LHS) and result (RHS) separator does not visually work when both are on the same line. This gets worse if we add typing to it, resulting in multiple colons, with the last one to have complete meaning entirely. Eg. f(a, b, lambda c: int, d: int : c + d). Most (modern?) languages uses arrows, for good reason.
    3. "lambda" and ":" instead of (optional) parens as parameters (LHS) delimiters makes it hard to read code. Eg. f(a, b, lambda c, d: c + d) takes so much more mental processing to read vs. f(a, b, (c, d) => c + d).
    4. Multi-line functions not possible. Here, we can either introduce block delimiters, or to keep it pythonic, we can parse multi-line anonymous functions as:
      result = f(a, b, (c, d) =>
       x = c ** 2
       y = c + d
       x + y # `return` should be optional, keeping consistency with single-line variant
      )
    John Leung
    @fuzzthink
    There are reasons why anonymous functions aren't used as much as in other languages. Its poor design is a big one.
    Mark Henderson
    @markhend
    https://wiki.python.org/moin/AlternateLambdaSyntax
    It's interesting to dig through some of the past discussions.
    Mark Henderson
    @markhend
    Noticed that 2 if statements can now be consecutive in a generator expression. Thanks!
    AminemS
    @AminemS_twitter
    I have a simple question about seq, is it similar to Halide but applied to genomics ?
    A. R. Shajii
    @arshajii
    Hi @AminemS_twitter ; Seq is similar to Halide in that it is a domain-specific language (although for genomics), but it's a much lower-level language than Halide is.
    Actually, it's essentially a Python implementation, so much of what you can do in Python (even aside from genomics) you can do directly in Seq
    But the focus is on genomics and bioinformatics applications, so we have numerous optimizations/language features specifically for that domain
    AminemS
    @AminemS_twitter
    Thank you @arshajii
    Ivan Perez
    @ivanpmartell
    Hi, is it possible to create an empty FASTQRecord? If so how?
    A. R. Shajii
    @arshajii
    Hi, yes that can be done like: FASTQRecord('', s'', '') -- arguments are header, read sequence, read quality
    (we're adding stdlib docs very soon that will detail all fields/methods of built-in types, which will include this info)
    Ivan Perez
    @ivanpmartell
    thanks :)
    A. R. Shajii
    @arshajii
    No problem! :)
    Ivan Perez
    @ivanpmartell
    I keep getting IndexError: string index out of range when using 'for r in BAM(input_file):' any ideas why this might happen? I have redone the index with samtools and tried other bam files and it keeps raising IndexErrors. Could it be libhts that i got from sudo apt-get install libhts-dev?
    Ivan Perez
    @ivanpmartell
    Fixed it. Removed the apt-get libhts and went into the samtools/htslib-1.... folder then configure, make, sudo make install, sudo ldconfig
    gdex19
    @gdex19
    Hello
    Ibrahim Numanagić
    @inumanag
    Yes, you need a fairly recent HTSlib
    mans
    @mansoureh_mans_twitter
    Hi, it seems that the program has been installed successfully but when I try the "seqc xxx.seq" command (in Ubuntu 16.04) nothing actually happens. Could you please help me with this?
    Mark Henderson
    @markhend
    Are you typing that into the command line? Is there any output from the command e.g. seqc: command not found?
    Mark Henderson
    @markhend
    Check your PATH. When the install script finishes, it provides a message to update your PATH based upon your install location. The message for me:
    Seq installed at: /home/mhenders/.seq Make sure to update your PATH environment variable: export PATH="/home/mhenders/.seq/bin:$PATH"
    Mark Henderson
    @markhend
    I added export PATH="/home/mhenders/.seq/bin:$PATH" to my .bash_profile file so the seqc command is available whenever I start my terminal.
    Kasra
    @kkasra12
    is there any built-in command to find the interleave between two FASTQ files ?
    mans
    @mansoureh_mans_twitter
    Hi Mark, thank you very much for your response. The PATH is exported correctly because when I execute Seqc -help, all the options and relevant info are displayed correctly. However, whenever I try seqc xxx.seq I see absolutely no output. Indeed nothing happens and cursor jumps to them next line as if no command has been executed at all.
    A. R. Shajii
    @arshajii
    Hi @mansoureh_mans_twitter what is the content of xxx.seq?
    @kkasra12 Are you trying to produce an interleaved FASTQ? You can do that by reading two FASTQs simultaneously (e.g. with zip as in Python) then printing the two records.
    mans
    @mansoureh_mans_twitter
    Hi A.R. It is fixed now. Apparently I didn't execute Seqc xxx.seq in the folder where xxx.seq exists. That's why Seq was not able to find the file and moved to the next line without any output.
    Ibrahim Numanagić
    @inumanag
    Oh, that is a bug then! Thanks for reporting it
    Gert Hulselmans
    @ghuls
        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:
    Is there a way to get open_func behave like I want (gzip.open and open are different types)?
    A. R. Shajii
    @arshajii
    Are you using the types branch, @ghuls ?
    Gert Hulselmans
    @ghuls
    no, develop, but with the precompiled seq binary
    A. R. Shajii
    @arshajii
    Oh ok, just checking since we're in the process now of incorporating union types :P
    You can do something like this:
    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_file is a generic function -- I believe the APIs for normal files and for gzip'd files should be basically identical
    Gert Hulselmans
    @ghuls
    Ah, in that case I will wait a bit. Any timeframe for a new release?
    Is there a way to process reads of a FASTQ file in parallel, but to write the modified reads in the original input order?
    Gert Hulselmans
    @ghuls
    It would also be nice if seq would allow writing to a stream which would be read by a streaming command line tool. Now I have to write to stdout and then compress the output with 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 -6 it 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
    A. R. Shajii
    @arshajii
    We're just finalizing the new type system now and should hopefully be on track to do a major release in the coming couple weeks
    There's no easy way to do this kind of FASTQ processing as far as I know, but one approach would be the following:
    • For each block, create an empty list the size of the block (e.g. [s''] * N)
    Hm actually scratch this; it will still be out of order w.r.t blocks
    Need to think about this one more
    Also thanks for the note about gzip, will look more into it as well