Skip to content

Commit

Permalink
add fastq-peak executable
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlibuit committed Jun 23, 2024
1 parent 32691c1 commit adcefa2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
32 changes: 32 additions & 0 deletions bin/fastq-peak.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Get the directory of the current script
SCRIPT_DIR=$(dirname "$0")

# Source the library file for reusable functions
source "$SCRIPT_DIR/../lib/utils.sh"

# Check if a FASTQ file is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <fastq_file>"
exit 1
fi

FASTQ_FILE=$1

# Check if the provided file exists
if [ ! -f "$FASTQ_FILE" ]; then
echo "Error: File '$FASTQ_FILE' not found!"
exit 1
fi

echo "Processing FASTQ file: $FASTQ_FILE"

# Count the number of reads in the FASTQ file #
# Count the number of lines in the FASTQ file
LINE_COUNT=$(wc -l < "$FASTQ_FILE")
#Calculate the number of reads (4 lines per read)
READ_COUNT=$((LINE_COUNT / 4))
# Output the number of reads
echo "Number of reads in $FASTQ_FILE: $READ_COUNT"

8 changes: 8 additions & 0 deletions data/sample.fastq
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@SEQ_ID_1
GATTTGGGGTTTCCCAGTCACGACGTTGTA
+
!''*((((***+))%%%++)(%%%%).1**-
@SEQ_ID_2
TGATTTGGGGTTTCCCAGTCACGACGTTGT
+
!''*((((***+))%%%++)(%%%%).1**-

0 comments on commit adcefa2

Please sign in to comment.