Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

When following along here, please start an idev session for running any example commands:

Code Block
idev -m 60 -q development

Illumina sequence data format (FASTQ)

GSAF gives you paired end sequencing data in two matching fastq format files, contining reads for each end sequenced -- for example Sample_ABC_L005_R1.cat.fastq and Sample_ABC_L005_R2.cat.fastq. Each read end sequenced is representd by a 4-line entry in the fastq file.

...

See the Wikipedia FASTQ format page for more information.

Exercise: Examine the 2nd sequence in a FASTQ file

What is the 2nd sequence in the file  

Get your data

To try out exercises, we've provided some sample data on lonestar.

So, go get it!

Code Block
titleGet set up for the exercises
cds
mkdir my_rnaseq_course #this is where you'll be doing all the course exercises
cd my_rnaseq_course
cp -r /corral-repl/utexas/BioITeam/

...

rnaseq_course_2015/

...

fastqc_exercise .
cd fastqc_exercise
 
ls data

Exercise: Examine the 2nd sequence in a FASTQ file

What is the 2nd sequence in the file Sample1_R1.fastq?

Expand
titleHint

Use the head command.

Expand
titleAnswer
Code Block
head /corral-repl/utexas/BioITeam/ngs_course/intro_to_mapping/data/SRR030257Sample1_1R1.fastq

Executing the command above reports that the 2nd sequence has ID = @SRR030257.2 HWI-EAS_4_PE-FC20GCB:6:1:407:767/1, and the sequence TAAGCCAGTCGCCATGGAATATCTGCTTTATTTAGC

...

If this doesn't work, check what directory you are in currently (pwd) and that you've provided the right path to the file. Tab is your friend!

Exercise: Get the first 10 read IDs in the fastq file

Expand
titleHint

grep for lines starting with @HWI since our reads start with that.

For GSAF illumina read ids, they always start with @HWI

Expand
titleAnswer
Code Block
grep '^@HWI' data/Sample1_R1.fastq |head


Counting sequences

One of the first thing to check is that your fastq files are the same length, and that length is evenly divisible by four. The wc command (word count) using the -l switch to tell it to count lines, not words, is perfect for this:

Code Block
titleUsing wc -l to count lines
wc -l $BI/ngs_course/intro_to_mapping/data/SRR030257Sample1_1R1.fastq 

Exercise: Counting FASTQ file lines

...

Expand
titleAnswer

The wc -l command says there are 15200720 16000000 lines. FASTQ files have 4 lines per sequence, so the file has 1516,200000,720000/4 or 34,800000,180 sequences.

What if your fastq file has been compressed, for example by gzip? You can still count the lines, and you don't have to uncompress the file to do it:

Code Block
titleUsing wc -l on a compressed file
gunzip -c $BI/web/yeast_stuff/Sample_Yeast_L005_R1.cat.fastq.gz | wc -l

Here you use gunzip -c to write decompressed data to standard output (-c means "to console", and leaves the original .gz file untouched). You then pipe that output to wc -l to get the line count.

...

000 sequences.

Code Block
grep '^@HWI' data/Sample1_R1.fastq |wc -l

 

Lets move on to assessing the quality of this data...