Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs: # Define jobs for the workflow
# Save the expected output to a file
echo "Processing FASTQ file: ./data/sample.fastq" > expected_output.txt
echo "Number of reads in ./data/sample.fastq: 2" >> expected_output.txt
echo "GC Count: 30" >> expected_output.txt
echo "Total number of bases: 60" >> expected_output.txt
echo "GC Percent : 50%" >> expected_output.txt

# Capture the actual output of the script and save it to a file
./bin/fastq-peek.sh ./data/sample.fastq > actual_output.txt
Expand Down
16 changes: 16 additions & 0 deletions bin/fastq-peek.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ LINE_COUNT=$(wc -l < "$FASTQ_FILE")
READ_COUNT=$((LINE_COUNT / 4))

echo "Number of reads in $FASTQ_FILE: $READ_COUNT"


# Calculate GC count
GC_COUNT=$(cat "$FASTQ_FILE" | grep -o -E "G|C" | wc -l)

echo "GC Count: $GC_COUNT"

# Calculate total base count
TOTAL_BASE_COUNT=$(cat "$FASTQ_FILE" | grep -o -E "A|T|G|C" | wc -l)

echo "Total number of bases: $TOTAL_BASE_COUNT"

# Calculate GC Percent
GC_PERCENT=$((100*$GC_COUNT/$TOTAL_BASE_COUNT))

echo "GC Percent : $GC_PERCENT%"