Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix changing number of fields by SeqFilter #122

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,15 @@ perl:
- "5.18.3-thr"
- "5.20.1-thr"
- "5.22.0-thr"
env:
- SAMTOOLSVERSION="1.2"
- SAMTOOLSVERSION="1.3"
- SAMTOOLSVERSION="1.3.1"
- SAMTOOLSVERSION="1.4"
- SAMTOOLSVERSION="1.4.1"
- SAMTOOLSVERSION="1.5"
- SAMTOOLSVERSION="1.6"
- SAMTOOLSVERSION="1.7"
cache:
directories:
- $HOME/samtools-$SAMTOOLSVERSION
@@ -15,9 +24,6 @@ addons:
apt:
packages:
- ncbi-blast+
env:
- SAMTOOLSVERSION="1.3"
- SAMTOOLSVERSION="1.2"
before_install:
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
- source ~/travis-perl-helpers/init
@@ -29,8 +35,9 @@ install:
- cd $HOME && wget 'https://github.com/samtools/samtools/releases/download/'"$SAMTOOLSVERSION"'/samtools-'"$SAMTOOLSVERSION"'.tar.bz2'
- tar xjf samtools-"$SAMTOOLSVERSION".tar.bz2
- cd samtools-"$SAMTOOLSVERSION" && make && export PATH=$PWD:"$PATH" && ls && pwd && cd -
- mkdir -p /tmp/shunit2 && cd /tmp/shunit2 && wget 'https://github.com/greatfireball/shunit2/archive/v2.1.7.tar.gz' -O - | tar xzf - --strip 1
script:
- cd $PROOVREADDIR && make sample
- cd $PROOVREADDIR/test && bash testInstallation.sh && bash testSeqFilterError.sh
notifications:
slack:
secure: Mu7v0562KyuYMc76eg+9UWtqdF25fH9+ZKBzDD19h41YkjzxCmdPvF+jyD0SJGTsMZh0lKXSt8Ftqb9EWk3JDqzrkNOsDQunNuFwOgT/kF9i0s69mYl7KYR8vUUFHZirJ2aEXrWkeM1kF/tcopmMp/YytALKDDSoW1/6jHRj/go=
5 changes: 3 additions & 2 deletions bin/proovread
Original file line number Diff line number Diff line change
@@ -1708,14 +1708,15 @@ sub correct_sr_mt{
$VB->hline;
$VB->verbose($cmd);
my $re = qx($cmd);
my ($bpt, $bpN) = (split(/\s/, $re))[1,6];
# extract the second field (total number of nucleotids) and the last field (number of N positions)
my ($bpt, $bpN) = (split(/\s/, $re))[1,-1];
$VB->hline;

$V->exit("SeqFilter failed to mask $fq_file: $?\n") if $?;

my $bpN_frac = $bpN/$bpt;
$VB->nline;
$VS->verbose(sprintf "Masked : %0.1f%%", $bpN/$bpt*100);
$VS->verbose(sprintf "Masked : %0.1f%%", $bpN_frac*100);

return wantarray ? (\@ref_idxs, $bpN_frac) : \@ref_idxs; # wantarray guarantees backward compatibility
}
4 changes: 4 additions & 0 deletions sample/F.antasticus_long_error.singleseq.fq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@long_error_0_0 RSTART:86026 with-iupac-chars
GAGTGAAAAAGTGACGGCGCTAGGATTAAACGTGGTGCAATGACAMTCGGATGGCATAACGCGTCTGCTTGCGGGCAGTGGAAGTCATCCCCCGTCTCCTTTGGGTTATATTATACACCCGGAAAAAGTTCGCCTTTGAGAACCCAACGCCAAAGATCTAGACGCGGACAAATCAGGACACCCCCGTCTAAACGTGACGCTCATTGCACAACCAAAATGAATTGGGCAGTCAGTATAAGGCGGTCAAATTGACTATCTTAGCCTGTTATGTAGTCGAGTGAGGTTTTACACAGCTCTTACCGATGGTTAAATAACCGTATTGTCGTTTCTGCATGTACTGCTTGGAACGCAGGGGAGTTTCTCAATGCGTCCATAATCTTCGGTTGGGTACCAGTGTGACCTGTAGCAGAACATCGCGCCAGAGCTGGCAGGACAGGAAGAACCGC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$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
12 changes: 12 additions & 0 deletions test/testInstallation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

testInstallation() {
../bin/proovread --pre test --overwrite --long ../sample/F.antasticus_long_error.fq --short ../sample/F.antasticus_short.fq --sr-qv-offset 33 &>/dev/null
returnCode=$?
assertEquals "Testrun exited with exit code of 0" 0 $returnCode
assertTrue "test.trimmed.fq exists" "[ -e test/test.trimmed.fq ]"
assertTrue "test.trimmed.fa exists" "[ -e test/test.trimmed.fa ]"
assertTrue "test.untrimmed.fq exists" "[ -e test/test.untrimmed.fq ]"
}

. /tmp/shunit2/shunit2
19 changes: 19 additions & 0 deletions test/testSeqFilterError.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

testMultipleSeqs() {
../bin/proovread --pre test_multiple_seqs --overwrite --long ../sample/F.antasticus_long_error.fq --short ../sample/F.antasticus_short.fq --sr-qv-offset 33 2>log_multiple_seqs
returnCode=$?
assertEquals "Testrun exited with exit code of 0" 0 $returnCode
numWarnings=$(grep -c "Use of uninitialized value \$bpN in division" log_multiple_seqs)
assertEquals "No warnings messages are given indicating a problem with SeqFilter" 0 $numWarnings
}

testSingleSeq() {
../bin/proovread --pre test_single_seq --overwrite --long ../sample/F.antasticus_long_error.singleseq.fq --short ../sample/F.antasticus_short.fq --sr-qv-offset 33 2>log_single_seq
returnCode=$?
assertEquals "Testrun exited with exit code of 0" 0 $returnCode
numWarnings=$(grep -c "Use of uninitialized value \$bpN in division" log_single_seq)
assertEquals "No warnings messages are given indicating a problem with SeqFilter" 0 $numWarnings
}

. /tmp/shunit2/shunit2