This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
set -o nounset | |
for i in `seq 1 100`; | |
do | |
start=`date +%N`; | |
grep -c "^+$" test.fq >/dev/null; | |
end=`date +%N`; | |
TS=`expr $end - $start`; | |
TM=`echo $TS/1000.0 | bc -l` | |
echo -e "grep\t1\t$TM" >> count_timing.tsv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
set -o nounset # Treat unset variables as an error | |
TSV="count_timing.tsv" | |
CORES=2 | |
TAGS=$1 | |
echo -n "" > test.fq | |
for c in `seq 1 32`; do cat ../tests/pcs109_5k.fq >> test.fq; done | |
echo -e "Group\tBuffSize\tTime" > $TSV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
set -o nounset # Treat unset variables as an error | |
TSV="big_count_timing.tsv" | |
CORES=2 | |
TAGS="lines exact-buff buff-readahead" | |
echo -n "" > test.fq | |
for c in `seq 1 128`; do cat ../tests/pcs109_5k.fq >> test.fq; done | |
echo -e "Group\tBuffSize\tTime" > $TSV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bufio | |
import "github.com/klauspost/readahead" | |
// ... | |
// Create new readahead buffered reader: | |
reader, err := readahead.NewReaderSize(fh, 100, buffSize) | |
checkError(err) | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CountFastxRecords counts the number of records in a fastx file. | |
func CountFastxRecords(fh *os.File, buffSize int, format string) int { | |
// Start the timer: | |
start := time.Now() | |
pattern := []byte{'\n', '+', '\n'} // Pattern to look for. | |
// Create new buffered reader: | |
reader := bufio.NewReaderSize(fh, buffSize) | |
// Byte buffer: | |
buffer := make([]byte, buffSize) | |
// Auxiliary buffer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CountFastxRecords counts the number of records in a fastx file. | |
func CountFastxRecords(fh *os.File, buffSize int, format string) int { | |
// Start the timer: | |
start := time.Now() | |
pattern := []byte("\n+\n") // Pattern to look for. | |
// Create new buffered reader: | |
reader := bufio.NewReaderSize(fh, buffSize) | |
// Byte buffer: | |
buffer := make([]byte, buffSize) | |
// Variable for counting records: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
set -o nounset # Treat unset variables as an error | |
TSV="count_timing.tsv" | |
CORES=4 | |
echo "Time" > $TSV | |
for i in `seq 1 10000` | |
do | |
seqkit -j $CORES count pcs109_5k.fq 1>/dev/null 2>> $TSV | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CountFastxRecords counts the number of records in a fastx file. | |
func CountFastxRecords(fh *os.File, buffSize int, format string) int { | |
// Start the timer: | |
start := time.Now() | |
pattern := "+\n" // Pattern to look for. | |
// Create new buffered reader: | |
reader := bufio.NewReaderSize(fh, buffSize) | |
// Variable for counting records: | |
var records int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func CountFastxRecords(fh *os.File, buffSize int, format string) int { | |
// Do the counting here. | |
return 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INPUT_FQ=demo_reads.fq | |
TRANSCRIPTOME="transcriptome.fas" | |
COUNT_TSV="online_counts.tsv" | |
COUNT_MONITOR="[ -f $COUNT_TSV ] && ( csvtk -t watch -O sec_dist.pdf -B 100 -f SecCount $COUNT_TSV ; sleep 2)" # script to monitor secondary read count distribution | |
csvtk cat $INPUT_FQ \ | |
| seqkit seq -Q 3 \ | |
| seqkit watch -x -f MeanQual -p 20000 \ |
NewerOlder