Bastien
Chevreux
bach@chevreux.org

> Solomon Short

> ........ .

# The Trace & Short Read Archive at NCBI

## Introduction

...

## SFF format and file conversion

The basic data type you will get from the sequencing instruments from 454 & Ion Torrent will be SFF files. Those files contain almost all information needed for an assembly, but SFFs need to be converted into more standard files before MIRA can use this information.

We'll use the `sff_extract` script to do that.

For MIRA versions < 3.9.0, make sure you have the `sff_extract` version 0.2.*. Starting with MIRA version 3.9.0, you MUST have `sff_extract` version ≥ 0.3.0

Make sure you have Python installed on your system

### Extracting unpaired data

    arcadia:/path/to/myProject$ sff_extract -o bchoc EV10YMP01.sff EV5RTWS01.sff EVX95GF02.sff

The parameters to `sff_extract` tell it to extract to FASTQ (which is the default nowadays), give the output files a prefix name we chose (via -o) and convert the SFFs named `EV10YMP01.sff`, `EV5RTWS01.sff` and `EVX95GF02.sff`.

This can take some time, the 1.2 million FLX reads from this example need approximately 9 minutes for conversion. Your directory should now look something like this:

    arcadia:/path/to/myProject$ ls -lR
    -rw-r--r-- 1 bach users 231698898 2007-10-21 15:16 bchoc.fastq
    -rw-r--r-- 1 bach users 193962260 2007-10-21 15:16 bchoc.xml
    -rw-rw-rw- 1 bach users 475849664 2007-09-23 10:10 EV10YMP01.sff
    -rw-rw-rw- 1 bach users 452630172 2007-09-25 08:59 EV5RTWS01.sff
    -rw-rw-rw- 1 bach users 436489612 2007-09-21 08:39 EVX95GF02.sff

### Extracting paired-end data

The paired-end protocol of 454 will generate reads which contain the front and the back of a DNA template, separated by a linker sequence. You have to know the linker sequence! Ask your sequencing provider to give it to you. If standard protocols were used, then the linker sequence for GS20 and FLX will be

    >flxlinker
    GTTGGAACCGAAAGGGTTTGAATTCAAACCCTTTCGGTTCCAAC

while for Titanium data, you need to use two linker sequences

    >titlinker1
    TCGTATAACTTCGTATAATGTATGCTATACGAAGTTATTACG
    >titlinker2
    CGTAATAACTTCGTATAGCATACATTATACGAAGTTATACGA

For this example, the sequencing provider used the standard unmodified 454 FLX linker. Put that linker sequence into a FASTA file and copy to wherever you like.

    arcadia:bceti_assembly/data$ cp /from/whereever/your/file/is/linker.fasta ../origdata
    arcadia:bceti_assembly/data$ ls -l ../origdata
    -rw-r--r-- 1 bach users        53 2008-11-08 17:32 linker.fasta
    -rw-r--r-- 1 bach users 544623256 2008-11-08 16:49 SRR005481.sff
    -rw-r--r-- 1 bach users 476632488 2008-11-08 16:55 SRR005482.sff
    arcadia:bceti_assembly/data$ cat ../origdata/linker.fasta
    >flxlinker
    GTTGGAACCGAAAGGGTTTGAATTCAAACCCTTTCGGTTCCAAC

Now let's extract the paired end sequences, and this may take eight to ten minutes.

    arcadia:bceti_assembly/data$ sff_extract -Q -o bceti
      -a -l linker.fasta
      SRR005482.sff

    Testing whether SSAHA2 is installed and can be launched ...  ok.
    Working on 'SRR005482.sff':
    Creating temporary file from sequences in 'SRR005482.sff' ... done.
    Searching linker sequences with SSAHA2 (this may take a while) ...  ok.
    Parsing SSAHA2 result file ...  done.
    Converting 'SRR005482.sff' ...  done.
    Converted 268084 reads into 415327 sequences.

The above text tells you that the conversion process saw 268084 reads in the SFF. Searching for the paired-end linker and removing it, 415327 sequences were created. Obviously, some sequences had either no linker or the linker was on the far edges of the read so that the 'split' resulted into just one sequences.

The directory will now look like this:

    arcadia:bceti_assembly/data$ ls -l
    -rw-r--r-- 1 bach users 170346423 2008-11-08 17:55 bceti.fastq
    -rw-r--r-- 1 bach users 165413112 2008-11-08 17:55 bceti.xml
    -rw-r--r-- 1 bach users 476632488 2008-11-08 16:55 SRR005482.sff

That's it.