Hi all,
When I use bowtie2-build to build index, I cannot use .fa.gz file. I also tried gunzip file.fa.gz | bowtie2-build - name, it didn't work. So bowtie2-build must input unzipped fasta file? thanks.
Hi all,
When I use bowtie2-build to build index, I cannot use .fa.gz file. I also tried gunzip file.fa.gz | bowtie2-build - name, it didn't work. So bowtie2-build must input unzipped fasta file? thanks.
In your second attempt, you need the -c flag for gunzip; this outputs the file content to STDOUT so you can pipe it to other commands:
gunzip -c file.fa.gz | bowtie2-build [options]
Looking at the bowtie2 manual, I think bowtie2-build also requires a -c flag in this case. Haven't used it myself so no guarantee that any of this works, apart from the gunzip -c part.
It seems bowtie2-build won't work with pipeline by "|", though bowtie2 does. (Bowtie 2 version 2.2.3)
Try the command below? It works with small .fa.gz files; haven't tested with large files yet !
bowtie2-build -c $(zcat filename.fa.gz | awk '/^>/&&NR>1{printf ","}{ printf "%s",/^>/ ? "":$0 }') filename.bowtie2
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I tried this, didn't work either...