This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extracting library information from fastq file to add read group with GATK

I have a large bunch of fastq file from several different sequencing experiments and I'm writing the workflow to get the final BAM for population genetics analyses. Data are short reads obtained from Illumina.

In adding the read group to subsequently mark PCR replicates, I find myself looking at the various pieces of information in the header of each fastq file; I can find the platform unit and read group ID but I'm clueless about the library info. Here and there I read I may have a separate tabvle which associate sample name to library code, but asking around in my lab some people suggest I may still be able to recover it from the fastq file itself.

In which part of the header is this info stored?

zcat /cluster/scratch/sottocritto//RawSamples/GwOak-T198_AATGCCTC-TGGATCGA-AHT5J5DSX2_L001_R1.fastq.gz | head -1
@A00318:256:HT5J5DSX2:1:1101:3079:1000 1:N:0:AATGCCTC+TGGATCGA
zcat  /cluster/scratch/sottocritto/RawSamples/75083_ID2262_38-4-188-4-P01-F05_S82_L001_R1_001.fastq.gz | head -1
@A00618:201:H2GFYDSX3:1:1101:1579:1000 1:N:0:AGCAGCAA+GCTTCTAC

And, silly sillier, is the SM (sample name) the same as the sample code, in example T198 or 4-188-4 ?

read library illumina group gatk

The Illumina fastq headers have the following structure.

@<instrument>:<run number>:<flowcell ID>:<lane>:<tile>:<x-pos>:<y-pos> <read>:<is filtered>:<control number>:<sample index combination>

Other than the index, there are not library information in the fastq headers. To find the replicates, you will need additional metadata.

0 answers

No answers yet.

Log in to answer this question.