Question

I have some very large files, and a server with not a lot of space, plus it takes so much time to unzip these files so I was hoping to use zcat as input to a function?

What I've been using is

$ zcat file1 | samtools view -bS > outputfile

file1 is the zipped file, and the outputfile is obviously the output of the view function in samtools. The input to samtools usually goes between the -bS and the >

What I have above isn't working, any help? Thanks

Was it helpful?

Solution

You may need to give "-" as argument to samtools, to get it to read from standard input instead of a file:

zcat file1 | samtools view -bS - > outputfile

OTHER TIPS

Are the files zipped or GZipped? If the former, zcat won't do the task. You'll need unzip instead, with the following syntax:

unzip -p file1 | samtools view -bS - > outputfile
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top