| 1 |
BBTools are sensitive to filename extensions. For example, this command: |
| 2 |
reformat.sh in=reads.fq out=reads.fa.gz |
| 3 |
...will convert reads from fastq format to gzipped fasta. The recognized sequence file extensions are as follows: |
| 4 |
|
| 5 |
fastq (fq) |
| 6 |
fasta (fa, fna, fas, ffn, frn, seq, fsa, faa) |
| 7 |
sam |
| 8 |
bam [requires samtools] |
| 9 |
qual |
| 10 |
scarf [input only] |
| 11 |
phylip [input only; only supported by phylip2fasta.sh] |
| 12 |
header [output only] |
| 13 |
oneline [tab delimited 2-column: name and bases] |
| 14 |
embl [input only] |
| 15 |
gbk [input only] |
| 16 |
|
| 17 |
The recognized compression extensions: |
| 18 |
|
| 19 |
gzip (gz) [can be accelerated by pigz] |
| 20 |
zip |
| 21 |
bz2 [requires bzip2 or pbzip2 or lbzip2] |
| 22 |
fqz [requires fqz_comp] |
| 23 |
|
| 24 |
In order to stream using standard in or standard out, it is recommended to include the format. For example: |
| 25 |
cat data.fq.gz | reformat.sh in=stdin.fq.gz out=stdout.fa > file.fa |
| 26 |
This allows the tool to determine the format. Otherwise it will revert to the default. |
| 27 |
|
| 28 |
BBTools can usually determine the type of sequence data by examining the contents. To test this, run: |
| 29 |
fileformat.sh in=file |
| 30 |
|
| 31 |
...which will print the way the data is detected, e.g. Sanger (ASCII-33) quality, interleaved, etc. These can normally be overridden with the "qin" and "interleaved" flags. |
| 32 |
|
| 33 |
When BBTools are processing gzipped files, they may, if possible, attempt to spawn a pigz process to accelerate it. This behavior can be forced with the "pigz=t unpigz=t" flags, or prevented with "pigz=f unpigz=f"; otherwise, the default behavior depends on the tool. In some cluster configurations, and some Amazon nodes, spawning a process may cause the program to killed with an indication that it used too much virtual memory. I recommend pigz be enabled unless that scenario occurs. |
| 34 |
|
| 35 |
The most recent extension added is "header". You can use it like this: |
| 36 |
reformat.sh in=reads.fq out=reads.header minlen=100 |
| 37 |
|
| 38 |
That will create a file containing headers of reads that pass the "minlen" filter. |