How to make a compressed file directly used as a regular file?

We have a special compressor for genomic data called CRAM, and although it provides excellent compression, people are afraid to use it because it is not as easy to use with bio-information tools as “regular” files. We would like to allow a compressed file that will be used, for example, as parameters for scripts, open in graphical interfaces, etc., As well as classic files.

Like a named pipe or device block file that automatically executes the unzip command whenever it is read. If it is easy to copy from system to system (for email, sftp, etc.), it would be even better.

Our current solution:

  • let's say we have two commands: cram and uncram (here you can replace gzip and gunzip) and the input file X.

  • squeeze:

    cram <fileX> fileX.cram

  • we create a self-extracting archive for cram:

    echo "uncram <fileX.cram"> fileX.cram.sex
    chmod + x fileX.cram.sex

  • we use it as a parameter in tools:

    mytool <(fileX.cram.sex)

Now it is almost easy to use, except for the notation "<()", and the fact that you cannot immediately open it in the graphical interface.

Any ideas how to make the process transparent?

+1
source share
1 answer

, :

$ mytool () {
>  command mytool <( "$1" )
> }
$ mytool fileX.cram.sex

command , , .

, fileX.cram.sex ; script, .

+2

Source: https://habr.com/ru/post/1543413/


All Articles