问题描述
我们有一个自定义COM pressor名为CRAM基因组数据,并althogugh它提供了卓越的COM pression人都不敢使用它,因为它是不那么容易与生物信息学工具来处理正规的文件。我们希望允许使用例如COM pressed文件作为参数传递给脚本,在图形用户界面中打开,等等。就像经典的文件。
We have a custom compressor for genomic data called CRAM, and althogugh it provides superior compression people are afraid to use it, because it is not-so-easy to handle with bioinformatic tools as "regular" files. We would like to allow compressed file to be used for example as parameters to scripts, be opened in GUIs, etc. just like classic files.
像这样自动执行,只要它是从读取unzip命令命名管道或块设备文件。如果很容易从系统复制到系统(电子邮件,SFTP等它),这将是更好的。
Like a named pipe or block device file that automatically executes the unzip command whenever it is read from. If it is easy to copy from system to system (to email, sftp, etc. it), it would be even better.
我们的目前的解决方案:
Our current solution:
-
让我们说我们有两个命令,补习班和uncram(可以替代,gzip和gunzip这里),并输入文件FILEX。
let's say we have two commands, cram and uncram (you can substitute gzip and gunzip here), and an input file fileX.
我们COM preSS:
we compress:
&补习班LT; FILEX> fileX.cram
cram < fileX > fileX.cram
我们创建自解压的补习班存档:
we create self extracting archive for cram:
回声uncram&LT; fileX.cram> fileX.cram.sex结果
搭配chmod + X fileX.cram.sex
echo "uncram < fileX.cram" > fileX.cram.sex
chmod +x fileX.cram.sex
我们用它作为工具的参数(S):
we use it as a parameter(s) in tools:
mytool≤(fileX.cram.sex)
mytool <(fileX.cram.sex)
现在它几乎是易于使用的除≤()符号,而事实上,你不能马上在GUI中打开它。
now it is almost easy-to-use except for the "<()" notation, and the fact that you cannot immediately open it in a GUI.
任何想法如何使这一过程透明?
Any ideas how to make the process transparent?
推荐答案
您可以尝试一个处理文件的每个命令各地提供了一个简单的包装:
You could try providing a simple wrapper around each command that processes your files:
$ mytool () {
> command mytool <( "$1" )
> }
$ mytool fileX.cram.sex
的命令
内置允许您运行原始命令,而不是阴影它的功能。
The command
builtin allows you run the original command, rather than the function that shadows it.
注意 fileX.cram.sex
不是一个自解压文件;它只是有一个硬codeD输入文件中的shell脚本。
Note that fileX.cram.sex
isn't a self-extracting archive; it's just a shell script that has a hard-coded input file.
这篇关于如何使直接使用作为一个普通文件的COM pressed文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!