Skip to content

Commit

Permalink
Merge branch 'dev' into meth
Browse files Browse the repository at this point in the history
  • Loading branch information
hasindu2008 committed Jul 17, 2024
2 parents be9e20d + 4241f69 commit d7a3784
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 2 deletions.
47 changes: 46 additions & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ ex() {
fi
}

# DNA R9
echo "Basic DNA"
ex ./squigulator test/nCoV-2019.reference.fasta -o a.slow5 -q a.fasta -n 10 --seed 1 --dwell-std 1.0 -r 20000 -t1 || die "Running the tool failed"
diff -q test/fasta.exp a.fasta || die "diff failed"
diff -q test/slow5.exp a.slow5 || die "diff failed"

# RNA R9
echo "Basic RNA"
ex ./squigulator -x rna-r9-prom test/rnasequin_sequences_2.4.fa -o a.slow5 -q a.fastq -n 10 --seed 1 --prefix=yes --dwell-std 3.0 -t1 || die "Running the tool failed"
diff -q test/rna_slow5.exp a.slow5 || die "diff failed"

# --ideal
echo "--ideal"
ex ./squigulator test/nCoV-2019.reference.fasta -o a.slow5 -n 2 --seed 1 --ideal -r 20000 -t1 || die "Running the tool failed"
diff -q test/dna_ideal_slow5.exp a.slow5 || die "diff failed"
Expand All @@ -44,25 +47,31 @@ diff -q test/dna_ideal_amp_slow5.exp a.slow5 || die "diff failed"
ex ./squigulator test/nCoV-2019.reference.fasta -o a.slow5 -n 2 --seed 1 --amp-noise 0.0 -r 20000 --dwell-std 5.0 -t1 || die "Running the tool failed"
diff -q test/dna_ideal_amp_slow5.exp a.slow5 || die "diff failed"


# prefixes for dna
echo "--prefix=yes"
ex ./squigulator test/nCoV-2019.reference.fasta -o a.slow5 -n 2 --seed 1 --prefix=yes -r 20000 --dwell-std 5.0 -t1 || die "Running the tool failed"
diff -q test/dna_prefix_slow5.exp a.slow5 || die "diff failed"

# prefixes for rnana

echo "--prefix=no"
ex ./squigulator -x rna-r9-prom test/rnasequin_sequences_2.4.fa -o a.slow5 -n 2 --seed 1 --dwell-std 3.0 -t1 || die "Running the tool failed"
diff -q test/rna_prefixno_slow5.exp a.slow5 || die "diff failed"


# full contigs
echo "--full-contigs"
ex ./squigulator test/nCoV-2019.reference.fasta -o a.slow5 --seed 1 --full-contigs --dwell-std 5.0 -t1 || die "Running the tool failed"
diff -q test/dna_full_contig.exp a.slow5 || die "diff failed"

# r10 and paf and fasta
echo "r10 PAF out"
ex ./squigulator -x dna-r10-prom -o a.slow5 -n 1 --seed 1 --dwell-std 4.0 -t1 test/nCoV-2019.reference.fasta -c a.paf -q a.fa
diff -q test/dna_r10_paf.exp a.slow5 || die "diff failed"
diff -q test/dna_r10_paf.paf.exp a.paf || die "diff failed"
diff -q test/dna_r10_paf.fa.exp a.fa || die "diff failed"

# r9 rna paf and sam and fasta outputs
echo "r9 rna paf out and sam out"
ex ./squigulator -x rna-r9-prom -o a.slow5 -n 1 --seed 1 --dwell-std 3.0 -t1 -t1 test/rnasequin_sequences_2.4.fa -c a.paf -q a.fa -a a.sam
diff -q test/rna_paf.exp a.slow5 || die "diff failed"
Expand All @@ -82,7 +91,43 @@ ex ./squigulator -x dna-r10-prom -o a.slow5 -n 2 --seed 2 --dwell-std 4.0 -t1 te
diff -q test/dna_r10_paf-ref.exp a.slow5 || die "diff failed"
diff -q test/dna_r10_paf-ref.sam.exp a.sam || die "diff failed"

# rna004
echo "rna004 test"
ex ./squigulator -x rna004-prom -o a.slow5 -n 1 --seed 1 --dwell-std 3.0 -t1 test/rnasequin_sequences_2.4.fa
diff -q test/rna004.slow5.exp a.slow5 || die "diff failed"

# -r and -f and --amp-noise
echo "read lens and fold coverage"
ex ./squigulator -x dna-r10-prom -o a.slow5 -r 20000 -f 1 --seed 2 --amp-noise 0.5 -t1 test/nCoV-2019.reference.fasta
diff -q test/dna_r10_amp_noise.exp a.slow5 || die "diff failed"

# dwell mean and std
ex ./squigulator -x rna004-min -o a.slow5 -n 1 --seed 1 --dwell-mean 30 --dwell-std 3.0 -t1 test/rnasequin_sequences_2.4.fa
diff -q test/rna004_dwell.exp a.slow5 || die "diff failed"

# bps
ex ./squigulator -x dna-r10-prom -o a.slow5 --seed 1 --bps 200 -t1 -n 2 test/nCoV-2019.reference.fasta
diff -q test/bps.exp a.slow5 || die "diff failed"

# cdna
ex ./squigulator -x dna-r10-min -o a.slow5 -n 1 --seed 1 --dwell-std 3.0 -t1 test/rnasequin_sequences_2.4.fa --cdna
diff -q test/cdna.exp a.slow5 || die "diff failed"

# trans count

# trans trunc
ex ./squigulator -x rna004-prom -o a.slow5 -n 1 --seed 1 --trans-trunc -t1 test/rnasequin_sequences_2.4.fa
diff -q test/trans_trunc.exp a.slow5 || die "diff failed"

# ont-friendly
ex ./squigulator -x dna-r10-min -o a.slow5 -n 1 --seed 1 -t1 test/rnasequin_sequences_2.4.fa --ont-friendly=yes
diff -q test/ont_friendly.exp a.slow5 || die "diff failed"

# digitisation, sample-rate, range, offset-mean, offset-std, median-before-mean, median-before-std
ex ./squigulator -x dna-r10-min -o a.slow5 -n 1 --seed 1 -t1 test/rnasequin_sequences_2.4.fa --digitisation 4096 --sample-rate 10000 --range 300 --offset-mean -1000 --offset-std 0 --median-before-mean 100 --median-before-std 0
diff -q test/dev.exp a.slow5 || die "diff failed"

# threads and batch size
redundancy_check () {
N=$(grep -v ^[@#] a.slow5 | cut -f ${1} | sort | uniq -c | sort -nr -k1,1 | head -1 | awk '{print $1}')
[ "$N" != "1" ] && die "failed thread test for column ${1}"
Expand Down
13 changes: 13 additions & 0 deletions test/bps.exp

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions test/cdna.exp

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions test/dev.exp

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions test/dna_r10_amp_noise.exp

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions test/ont_friendly.exp

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions test/rna004.slow5.exp

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions test/rna004_dwell.exp

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion test/test_extensive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ echo "RNA004 RNA"
identityrna.sh $REF_GENCODE new.fastq > a.acc 2>> a.log || die "identitydna failed"
cat a.acc
CHECK_ACC 0.77 a.acc
REMOVE_TMP
REMOVE_TMP

# CDNA
12 changes: 12 additions & 0 deletions test/trans_trunc.exp

Large diffs are not rendered by default.

0 comments on commit d7a3784

Please sign in to comment.