<commit_before>#! /bin/sh

make modules
# make subgraph
make tools
make -j

threads=4

### Lambda:
awk '$1 ~/S/ {print ">"$2"\n"$3}' test-data/lambda/layout-miniasm.gfa > test-data/lambda/layout-miniasm.fasta
# contigs=test-data/lambda/layout-miniasm.gfa
reads=test-data/lambda/reads.fastq
# sam=test-data/lambda/alignments.sam
dataset=lambda_30x_ont
# msa=mafft
# msa=poav2
msa=poa
sam=temp/consensus-${dataset}-${msa}-v1.sam
contigs=test-data/lambda/layout-miniasm.fasta
consensus=temp/consensus-${dataset}-${msa}-v1.fasta
#
# contigs=temp/consensus-${dataset}-${msa}-v1.fasta
# sam=temp/consensus-${dataset}-${msa}-v2.sam
# consensus=temp/consensus-${dataset}-${msa}-v2.fasta
#
# contigs=temp/consensus-${dataset}-${msa}-v2.fasta
# sam=temp/consensus-${dataset}-${msa}-v3.sam
# consensus=temp/consensus-${dataset}-${msa}-v3.fasta

mkdir -p temp
reference=test-data/lambda/NC_001416.fa
memtime=temp/consensus-${dataset}-${msa}.memtime
tools/graphmap/bin/Linux-x64/graphmap align -a anchor --rebuild-index --mapq 3 -B 0 -r ${contigs} -d ${reads} -o ${sam} --extcigar -t ${threads}
# tools/graphmap/bin/Linux-x64/graphmap align -a anchor --rebuild-index -B 0 -r ${contigs} -d ${reads} -o ${sam} --extcigar -t ${threads}
/usr/bin/time --format "Command line: %C\nReal time: %e s\nCPU time: -1.0 s\nUser time: %U s\nSystem time: %S s\nMaximum RSS: %M kB\nExit status: %x" --quiet -o $memtime \
	bin/consise --align 1 -M 5 -X -4 -G -8 -E -6 --bq 10 -w 500 --ovl-margin 0.00 -b 20000 -t ${threads} ${contigs} ${sam} ${consensus}
mkdir -p temp/dnadiff-${dataset}
rm temp/dnadiff-${dataset}/consise-${dataset}-${msa}.report
dnadiff -p temp/dnadiff-${dataset}/consise-${dataset}-${msa} ${reference} ${consensus}
grep "TotalBases" temp/dnadiff-${dataset}/consise-${dataset}-${msa}.report
grep "AlignedBases" temp/dnadiff-${dataset}/consise-${dataset}-${msa}.report
grep "AvgIdentity" temp/dnadiff-${dataset}/consise-${dataset}-${msa}.report
cat $memtime

tools/edlib/src/aligner ${consensus} ${reference} -p -f NICE > ${consensus}.refalign.txt
head -n 10 ${consensus}.refalign.txt | tail -n 1<commit_msg>Minor changes to example1-lambda.sh script.<commit_after>#! /bin/sh

make modules
# make subgraph
make tools
make -j

threads=4

### Lambda:
awk '$1 ~/S/ {print ">"$2"\n"$3}' test-data/lambda/layout-miniasm.gfa > test-data/lambda/layout-miniasm.fasta
# contigs=test-data/lambda/layout-miniasm.gfa
reads=test-data/lambda/reads.fastq
# sam=test-data/lambda/alignments.sam
dataset=lambda_30x_ont
# msa=mafft
# msa=poav2
msa=poa
sam=temp/consensus-${dataset}-${msa}-v1.sam
contigs=test-data/lambda/layout-miniasm.fasta
consensus=temp/consensus-${dataset}-${msa}-v1.fasta
#
# contigs=temp/consensus-${dataset}-${msa}-v1.fasta
# sam=temp/consensus-${dataset}-${msa}-v2.sam
# consensus=temp/consensus-${dataset}-${msa}-v2.fasta
#
# contigs=temp/consensus-${dataset}-${msa}-v2.fasta
# sam=temp/consensus-${dataset}-${msa}-v3.sam
# consensus=temp/consensus-${dataset}-${msa}-v3.fasta

mkdir -p temp
reference=test-data/lambda/NC_001416.fa
memtime=temp/consensus-${dataset}-${msa}.memtime
tools/graphmap/bin/Linux-x64/graphmap align -a anchor --rebuild-index -B 0 -r ${contigs} -d ${reads} -o ${sam} --extcigar -t ${threads}
# tools/graphmap/bin/Linux-x64/graphmap align -a anchor --rebuild-index --mapq 3 -B 0 -r ${contigs} -d ${reads} -o ${sam} --extcigar -t ${threads}
# tools/graphmap/bin/Linux-x64/graphmap align -a anchor --rebuild-index -B 0 -r ${contigs} -d ${reads} -o ${sam} --extcigar -t ${threads}
/usr/bin/time --format "Command line: %C\nReal time: %e s\nCPU time: -1.0 s\nUser time: %U s\nSystem time: %S s\nMaximum RSS: %M kB\nExit status: %x" --quiet -o $memtime \
	bin/consise -M 1 -X -1 -G -1 -E -1 --bq 10 -w 500 -b 20000 -t ${threads} ${contigs} ${sam} ${consensus}
	# bin/consise --align 1 -M 1 -X -1 -G -1 -E -1 --bq 10 -w 500 --start-window 2 --num-batches 1 --ovl-margin 0.00 -b 1 -t ${threads} ${contigs} ${sam} ${consensus} > temp/msa.txt
	# bin/consise --align 1 -M 5 -X -4 -G -8 -E -6 --bq 10 -w 500 --ovl-margin 0.00 -b 20000 -t ${threads} ${contigs} ${sam} ${consensus}
	# bin/consise --align 1 -M 5 -X -4 -G -8 -E -6 --bq 10 -w 500 --pileup --ovl-margin 0.00 -b 20000 -t ${threads} ${contigs} ${sam} ${consensus}
mkdir -p temp/dnadiff-${dataset}
rm temp/dnadiff-${dataset}/consise-${dataset}-${msa}.report
dnadiff -p temp/dnadiff-${dataset}/consise-${dataset}-${msa} ${reference} ${consensus}
grep "TotalBases" temp/dnadiff-${dataset}/consise-${dataset}-${msa}.report
grep "AlignedBases" temp/dnadiff-${dataset}/consise-${dataset}-${msa}.report
grep "AvgIdentity" temp/dnadiff-${dataset}/consise-${dataset}-${msa}.report
cat $memtime

# tools/edlib/src/aligner ${consensus} ${reference} -p -f NICE > ${consensus}.refalign.txt
# head -n 10 ${consensus}.refalign.txt | tail -n 1

# tools/edlib/src/aligner ${consensus} ${reference} -p -f NICE -m HW > ${consensus}.refalign.txt
echo ""
echo "Evaluating the results."
scripts/edcontigs.py ${reference} ${consensus}
{'fraction_non_alphanumeric': 0.20791482523101648, 'fraction_numerical': 0.030936118923262354, 'mean_word_length': 4.1066666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3554778', 'n_tokens_mistral': 2119, 'n_tokens_neox': 1997, 'n_words': 426}