Skip to content

Commit

Permalink
fix bug in flag output and quality string reversal
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-p committed Mar 24, 2016
1 parent 1375132 commit 0ec7715
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 14 deletions.
49 changes: 45 additions & 4 deletions scripts/compile.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,45 @@
#!/bin/bash
set -e

branch=$1
version=$2
cxxflags=$3
# from http://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
no_native_arch=false
cxxflags=""

while [[ $# > 1 ]]
do
key="$1"

case $key in
-b|--branch)
branch="$2"
shift # past argument
;;
-v|--version)
version="$2"
shift # past argument
;;
-f|--cxxflags)
cxxflags="$2"
shift # past argument
;;
--no-native)
no_native_arch=true
;;
*)
# unknown option
;;
esac
shift # past argument or value
done

echo "Building rapmap [branch = ${branch}]. Tagging version as ${version}"
if [ "$no_native_arch" = true ] ; then
echo "Disabling -march=native"
fi

if [[ -z $cxxflags ]] ; then
echo "Passed CXXFLAGS ${cxxflags}"
fi

# Activate Holy Build Box environment.
source /hbb_exe/activate
Expand All @@ -27,7 +61,14 @@ mv RapMap-${branch} RapMap
cd RapMap
mkdir build
cd build
cmake -DFETCH_BOOST=TRUE -DCMAKE_CXX_FLAGS=${cxxflags} ..


if [ "$no_native_arch" = true ] ; then
cmake -DFETCH_BOOST=TRUE -DCMAKE_CXX_FLAGS=${cxxflags} -DNO_NATIVE_ARCH ..
else
cmake -DFETCH_BOOST=TRUE -DCMAKE_CXX_FLAGS=${cxxflags} ..
fi

make
make install
make test
Expand Down
21 changes: 11 additions & 10 deletions src/RapMapUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ namespace rapmap {
int32_t end = seq.length()-1, start = 0;
//readWork[end] = '\0';
//qualWork[end] = '\0';
-- end;
while (LIKELY(start < end)) {
readWork[start] = (char)rc_table[(int8_t)seq[end]];
readWork[end] = (char)rc_table[(int8_t)seq[start]];
Expand Down Expand Up @@ -237,10 +236,9 @@ namespace rapmap {
if (qa.isPaired) {
rapmap::utils::getSamFlags(qa, true, flags1, flags2);
if (alnCtr != 0) {
flags1 |= 0x900; flags2 |= 0x900;
} else {
flags2 |= 0x900;
flags1 |= 0x100; flags2 |= 0x100;
}

rapmap::utils::adjustOverhang(qa, txpLens[qa.tid], cigarStr1, cigarStr2);

// Reverse complement the read and reverse
Expand Down Expand Up @@ -297,17 +295,20 @@ namespace rapmap {
} else {
rapmap::utils::getSamFlags(qa, true, flags1, flags2);
if (alnCtr != 0) {
flags1 |= 0x900; flags2 |= 0x900;
} else {
flags1 |= 0x100; flags2 |= 0x100;
}
/*
else {
// If this is the first alignment for this read
// If the left end is mapped, set 0x900 on the right end
// If the left end is mapped, set 0x100 on the right end
if (qa.mateStatus == MateStatus::PAIRED_END_LEFT) {
flags2 |= 0x900;
flags2 |= 0x100;
} else {
// Otherwise, set 0x900 on the left end
flags1 |= 0x900;
// Otherwise, set 0x100 on the left end
flags1 |= 0x100;
}
}
*/

std::string* readSeq{nullptr};
std::string* unalignedSeq{nullptr};
Expand Down

0 comments on commit 0ec7715

Please sign in to comment.