Here the aim is to build a graph from a collection of stings (reads) in a FASTQ file. But first, we implement the following function that gets the reads. We remove the new line character from the end of each line (with str.strip()), and for convention, we convert all characters in the reads to uppper case (with str.upper()). The code for that:
def get_reads(filePath):
reads = list() # The list of strings that will store the reads (the DNA strings) in the FASTQ file at filePath
fastqFile = open(filePath, 'r')
fastqLines = fastqFile.readlines()
fastqFile.close()
for lineIndex in range(1, len(fastqLines), 4): # I want this explained
line = fastqLines[lineIndex]
reads.append(line.strip().upper())
return reads
My question is: Explain what is the purpose of the line for lineIndex in range(1, len(fastqLines), 4)?