From: Enrico Seiler <enrico.seiler.debian@outlook.com>
Date: Wed, 27 Nov 2024 13:59:31 +0100
Subject: Upgrade to SeqAn 2.5.0.

---
 CMakeLists.txt    |   2 +-
 FilterFusions.hpp | 122 +++++++++++++++++++++++++++---------------------------
 GeneModel.hpp     |  56 ++++++++++++-------------
 main.cpp          |  60 +++++++++++++--------------
 4 files changed, 120 insertions(+), 120 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c3453e..c2e3851 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@ include_directories( ${ZLIB_INCLUDE_DIRS} )
 add_definitions (${SEQAN_DEFINITIONS})
 
 # Add CXX flags found by find_package (SeqAn).
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS} -std=c++14  -DSEQAN_HAS_ZLIB=1" )
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS} -DSEQAN_HAS_ZLIB=1" )
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
 
 # Add executable and link against SeqAn dependencies.
diff --git a/FilterFusions.hpp b/FilterFusions.hpp
index 47651c7..c8312f5 100644
--- a/FilterFusions.hpp
+++ b/FilterFusions.hpp
@@ -230,25 +230,25 @@ bool filterFusionRecord(const Transcriptome &trx, ProgramOptions& options, const
 
   
   // see if the k-mer matching region of read 1 matches any of the transcripts of read 2
-  typedef seqan::CharString TSeq;
+  typedef seqan2::CharString TSeq;
   TSeq rs1(rec.seq1.substr(rec.kpos1.first, options.k + rec.kpos1.second-rec.kpos1.first).c_str());
   TSeq rs2(rec.seq2.substr(rec.kpos2.first, options.k + rec.kpos2.second-rec.kpos2.first).c_str());
   
 
-  seqan::Align<TSeq, seqan::ArrayGaps> align;
-  seqan::resize(rows(align), 2);
+  seqan2::Align<TSeq, seqan2::ArrayGaps> align;
+  seqan2::resize(rows(align), 2);
 
   auto mapKmersWithErrors = [&](TSeq& krseq, const std::vector<TranscriptPos> &trlist) -> bool {
-    typedef seqan::Index<seqan::StringSet<TSeq>, seqan::IndexQGram<seqan::Shape<seqan::Dna, seqan::UngappedShape<8> >, seqan::OpenAddressing> > TIndex;
-    typedef seqan::Pattern<TIndex, seqan::Swift<seqan::SwiftSemiGlobal> > TPattern;
-    typedef seqan::Finder<const TSeq, seqan::Swift<seqan::SwiftSemiGlobal> > TFinder;
-    seqan::StringSet<TSeq> reads;
+    typedef seqan2::Index<seqan2::StringSet<TSeq>, seqan2::IndexQGram<seqan2::Shape<seqan2::Dna, seqan2::UngappedShape<8> >, seqan2::OpenAddressing> > TIndex;
+    typedef seqan2::Pattern<TIndex, seqan2::Swift<seqan2::SwiftSemiGlobal> > TPattern;
+    typedef seqan2::Finder<const TSeq, seqan2::Swift<seqan2::SwiftSemiGlobal> > TFinder;
+    seqan2::StringSet<TSeq> reads;
     appendValue(reads,krseq);
-    seqan::reverseComplement(krseq);
+    seqan2::reverseComplement(krseq);
     appendValue(reads,krseq);
     TIndex index(reads);
     TPattern pattern(index);
-    int matchlen = seqan::length(krseq);
+    int matchlen = seqan2::length(krseq);
 
     double epsilon = std::min(((double) options.kmerScore) / options.k,0.1);
 
@@ -258,13 +258,13 @@ bool filterFusionRecord(const Transcriptome &trx, ProgramOptions& options, const
         const TSeq &trseq = it->second;
         TFinder finder(trseq);
         while (find(finder, pattern, epsilon, options.k)) {
-          seqan::Finder<const TSeq> verifyFinder(trseq);
-          seqan::setPosition(verifyFinder, seqan::beginPosition(finder));
-          seqan::Pattern<const TSeq, seqan::Myers<>> verifyPattern(reads[seqan::position(pattern).i1]);
-          while (seqan::find(verifyFinder, verifyPattern, -((int) (epsilon*options.k))) 
-              && seqan::position(verifyFinder) < seqan::endPosition(seqan::infix(finder))) {
-            //std::cout << seqan::infix(finder)  << " -- " << tr.tr << std::endl;
-            //std::cout << reads[seqan::position(pattern).i1] << " -- " << rec.n1 << ((rec.type == FusionRecord::PAIR) ? " PAIR" : " SPLIT") << std::endl;
+          seqan2::Finder<const TSeq> verifyFinder(trseq);
+          seqan2::setPosition(verifyFinder, seqan2::beginPosition(finder));
+          seqan2::Pattern<const TSeq, seqan2::Myers<>> verifyPattern(reads[seqan2::position(pattern).i1]);
+          while (seqan2::find(verifyFinder, verifyPattern, -((int) (epsilon*options.k))) 
+              && seqan2::position(verifyFinder) < seqan2::endPosition(seqan2::infix(finder))) {
+            //std::cout << seqan2::infix(finder)  << " -- " << tr.tr << std::endl;
+            //std::cout << reads[seqan2::position(pattern).i1] << " -- " << rec.n1 << ((rec.type == FusionRecord::PAIR) ? " PAIR" : " SPLIT") << std::endl;
             return true;
           }
         }
@@ -308,16 +308,16 @@ bool filterFusionRecord(const Transcriptome &trx, ProgramOptions& options, const
         tr_start = 0;
       }
 
-      if (tr_stop > seqan::length(trseq)) {
-        tr_stop = seqan::length(trseq);
+      if (tr_stop > seqan2::length(trseq)) {
+        tr_stop = seqan2::length(trseq);
       }
 
-      auto read_match = seqan::CharString(seqan::infix(trseq, tr_start, tr_stop));
+      auto read_match = seqan2::CharString(seqan2::infix(trseq, tr_start, tr_stop));
       if ((trpos.strand == Strandedness::REVERSE) == orient) {
-        seqan::reverseComplement(read_match);
+        seqan2::reverseComplement(read_match);
       }
 
-      std::string tseq(seqan::toCString(read_match));
+      std::string tseq(seqan2::toCString(read_match));
       tlist[tseq].push_back(trpos);
     }
     return std::move(tlist);
@@ -332,20 +332,20 @@ bool filterFusionRecord(const Transcriptome &trx, ProgramOptions& options, const
       auto& tseq = it.first;
       auto& tposv = it.second;
 
-      seqan::CharString read(seq.c_str());
-      seqan::CharString ref(tseq.c_str()); // inefficient, refactor at some point
+      seqan2::CharString read(seq.c_str());
+      seqan2::CharString ref(tseq.c_str()); // inefficient, refactor at some point
 
-      int ascore = seqan::globalAlignmentScore(read, ref, seqan::MyersBitVector());
+      int ascore = seqan2::globalAlignmentScore(read, ref, seqan2::MyersBitVector());
       if ( ascore >= -options.alignScore) {
         out_tr.insert(out_tr.end(), tposv.begin(), tposv.end());
         // debuggingstd::cout <<
         /*
-        typedef seqan::Align<seqan::CharString, seqan::ArrayGaps> TAlign;
+        typedef seqan2::Align<seqan2::CharString, seqan2::ArrayGaps> TAlign;
         TAlign align;
-        seqan::resize(seqan::rows(align), 2);
-        seqan::assignSource(seqan::row(align, 0), read);
-        seqan::assignSource(seqan::row(align, 1), ref); 
-        int score = seqan::globalAlignment(align, seqan::Score<int, seqan::Simple>(0, -1, -1));
+        seqan2::resize(seqan2::rows(align), 2);
+        seqan2::assignSource(seqan2::row(align, 0), read);
+        seqan2::assignSource(seqan2::row(align, 1), ref); 
+        int score = seqan2::globalAlignment(align, seqan2::Score<int, seqan2::Simple>(0, -1, -1));
         std::cout << "Score: " << score << std::endl;
         std::cout << align + std::endl;
         */
@@ -400,19 +400,19 @@ bool filterFusionRecord(const Transcriptome &trx, ProgramOptions& options, const
         }
         bool forwardRead = (splitStrand == Strandedness::FORWARD);
         // see if we can align across the sequences        
-        seqan::CharString read(seq.c_str());
-        seqan::CharString splitref(tsplit.first.c_str()); // inefficient, refactor at some point
-        seqan::CharString saferef(tsafe.first.c_str());
-
-        seqan::Gaps<seqan::CharString> readRowLeft, readRowRight, splitRowLeft, safeRowRight;
-        seqan::setSource(readRowLeft, read);
-        seqan::setSource(readRowRight, read);
-        seqan::setSource(splitRowLeft, splitref);
-        seqan::setSource(safeRowRight, saferef);
-
-        seqan::Score<int, seqan::Simple> scoringScheme(0,-1,-1);
-        seqan::AlignConfig<false, true, true, false> config;
-        int splitScore = seqan::splitAlignment(readRowLeft, splitRowLeft, readRowRight, safeRowRight, scoringScheme, config);
+        seqan2::CharString read(seq.c_str());
+        seqan2::CharString splitref(tsplit.first.c_str()); // inefficient, refactor at some point
+        seqan2::CharString saferef(tsafe.first.c_str());
+
+        seqan2::Gaps<seqan2::CharString> readRowLeft, readRowRight, splitRowLeft, safeRowRight;
+        seqan2::setSource(readRowLeft, read);
+        seqan2::setSource(readRowRight, read);
+        seqan2::setSource(splitRowLeft, splitref);
+        seqan2::setSource(safeRowRight, saferef);
+
+        seqan2::Score<int, seqan2::Simple> scoringScheme(0,-1,-1);
+        seqan2::AlignConfig<false, true, true, false> config;
+        int splitScore = seqan2::splitAlignment(readRowLeft, splitRowLeft, readRowRight, safeRowRight, scoringScheme, config);
         // debug
         /*
         std::cout << std::endl + "Score : " + splitScore + std::endl; 
@@ -423,19 +423,19 @@ bool filterFusionRecord(const Transcriptome &trx, ProgramOptions& options, const
         */
         if (splitScore >= -options.alignScore) {
           if (splitPos < 0) {
-            splitPos = seqan::toSourcePosition(readRowLeft, seqan::clippedEndPosition(readRowLeft));
+            splitPos = seqan2::toSourcePosition(readRowLeft, seqan2::clippedEndPosition(readRowLeft));
           }
           for (const auto& t1 : tsplit.second) {
             for (const auto& t2 : tsafe.second) {
               TranscriptPos t2copy;
               t2copy.tr = t2.tr;
               t2copy.strand = (t2.strand == Strandedness::FORWARD) ? Strandedness::REVERSE : Strandedness::FORWARD; 
-              int t2pos = seqan::toSourcePosition(safeRowRight, 0);
-              int t2clip= seqan::toSourcePosition(readRowRight, 0); //seqan::clippedBeginPosition(readRowRight));
+              int t2pos = seqan2::toSourcePosition(safeRowRight, 0);
+              int t2clip= seqan2::toSourcePosition(readRowRight, 0); //seqan2::clippedBeginPosition(readRowRight));
               if (forwardRead) {
-                t2copy.pos = t2.pos - seqan::length(saferef) + t2pos + (seqan::length(splitref) - t2clip);
+                t2copy.pos = t2.pos - seqan2::length(saferef) + t2pos + (seqan2::length(splitref) - t2clip);
               } else {
-                t2copy.pos = t2.pos + seqan::length(saferef) - t2pos -1;
+                t2copy.pos = t2.pos + seqan2::length(saferef) - t2pos -1;
               }
               out.push_back({t1, t2copy});
             }
@@ -904,7 +904,7 @@ void processFusions(const Transcriptome &trx, ProgramOptions& options) {
                 }
                 writeGeneInfoToJsonStream(swap);
                 
-                std::string fasta_name = sp.tr1 + "_0:" + std::to_string(tp1) + "_" + sp.tr2 + "_" + std::to_string(tp2) + ":" + std::to_string(seqan::length(seq2));
+                std::string fasta_name = sp.tr1 + "_0:" + std::to_string(tp1) + "_" + sp.tr2 + "_" + std::to_string(tp2) + ":" + std::to_string(seqan2::length(seq2));
                 if (fnames.count(fasta_name) > 0) {
                   continue;
                 } else {
@@ -917,11 +917,11 @@ void processFusions(const Transcriptome &trx, ProgramOptions& options) {
                 firstJsonCommaTrans = false;
                 jsonOut <<"        {\n          \"fasta_record\": \"" << fasta_name <<  "\",\n"
                         <<           "          \"transcriptA\": {\"id\" : \"" << sp.tr1 << "\", \"startPos\" : " << std::to_string((sp.dir1) ? 0 : tp1)
-                        << ", \"endPos\" : " << std::to_string((sp.dir1) ? tp1 : seqan::length(seq1)) << ", \"edit\" : " << std::to_string(ed1) 
+                        << ", \"endPos\" : " << std::to_string((sp.dir1) ? tp1 : seqan2::length(seq1)) << ", \"edit\" : " << std::to_string(ed1) 
                         << ", \"strand\" : " << ((sp.strand1) ? "true" : "false") << "},\n";
                         
                 jsonOut <<           "          \"transcriptB\": {\"id\" : \"" << sp.tr2 << "\", \"startPos\" : " << std::to_string((sp.dir2) ? 0 : tp2)
-                        << ", \"endPos\" : " << std::to_string((sp.dir2) ? tp2 : seqan::length(seq2)) << ", \"edit\" : " << std::to_string(ed2)
+                        << ", \"endPos\" : " << std::to_string((sp.dir2) ? tp2 : seqan2::length(seq2)) << ", \"edit\" : " << std::to_string(ed2)
                         << ", \"strand\" : " << ((sp.strand2) ? "true" : "false") << "},\n"
                         << "          \"support\" : " << std::to_string(t_count) << ",\n"
                         << "          \"reads\" : [";
@@ -937,8 +937,8 @@ void processFusions(const Transcriptome &trx, ProgramOptions& options) {
                 std::copy(readsInTr.begin(), readsInTr.end(), std::back_inserter(readsInGene));
 
                 fastaOut << ">" << fasta_name << "\n"
-                         << seqan::prefix(seq1, tp1)
-                         << seqan::suffix(seq2, tp2)
+                         << seqan2::prefix(seq1, tp1)
+                         << seqan2::suffix(seq2, tp2)
                          << "\n"; 
 
 
@@ -958,8 +958,8 @@ void processFusions(const Transcriptome &trx, ProgramOptions& options) {
               if (sr.type == SplitRecord::PAIR) {
                 for (const auto &t1 : sr.tr1) {
                   for (const auto &t2 : sr.tr2) {
-                    int rlen1 = seqan::length(fr.seq1);
-                    int rlen2 = seqan::length(fr.seq2); 
+                    int rlen1 = seqan2::length(fr.seq1);
+                    int rlen2 = seqan2::length(fr.seq2); 
 
                     const auto & seq1 = trx.seqs.find(t1.tr)->second;
                     const auto & seq2 = trx.seqs.find(t2.tr)->second;
@@ -968,8 +968,8 @@ void processFusions(const Transcriptome &trx, ProgramOptions& options) {
                     bool t2strand = t2.strand == Strandedness::FORWARD;
 
                     // position of split
-                    int tp1 = (t1strand) ? std::min(t1.pos+rlen1, (int)seqan::length(seq1)-1) : std::max(t1.pos-rlen1,0);
-                    int tp2 = (t2strand) ? std::min(t2.pos+rlen2, (int)seqan::length(seq2)-1) : std::max(t2.pos-rlen2,0);
+                    int tp1 = (t1strand) ? std::min(t1.pos+rlen1, (int)seqan2::length(seq1)-1) : std::max(t1.pos-rlen1,0);
+                    int tp2 = (t2strand) ? std::min(t2.pos+rlen2, (int)seqan2::length(seq2)-1) : std::max(t2.pos-rlen2,0);
 
                     // distances to exon boundaries
                     auto ped1 = mapToForwardExon(t1.tr, tp1);
@@ -1077,13 +1077,13 @@ void processFusions(const Transcriptome &trx, ProgramOptions& options) {
 
                 std::string fasta_name;
                 
-                fasta_name = spi.tr1 + "_0:" + std::to_string(spi.pos1) + "_" + spi.tr2 + "_" + std::to_string(spi.pos2) + ":" + std::to_string(seqan::length(seq2));
+                fasta_name = spi.tr1 + "_0:" + std::to_string(spi.pos1) + "_" + spi.tr2 + "_" + std::to_string(spi.pos2) + ":" + std::to_string(seqan2::length(seq2));
                 jsonOut << "        {\n          \"fasta_record\": \"" << fasta_name << "\",\n"
                         <<            "          \"transcriptA\": {\"id\" : \"" << spi.tr1 << "\", \"startPos\" : " << std::to_string((spi.dir1) ? 0 : spi.pos1)
-                        << ", \"endPos\" : " << std::to_string((spi.dir1) ? spi.pos1 : seqan::length(seq1))
+                        << ", \"endPos\" : " << std::to_string((spi.dir1) ? spi.pos1 : seqan2::length(seq1))
                         << ", \"strand\" : " << ((spi.strand1 == Strandedness::FORWARD) ? "true" : "false") << "},\n";
                 jsonOut <<           "          \"transcriptB\": {\"id\" : \"" << spi.tr2 << "\", \"startPos\" : " << std::to_string((spi.dir2) ? 0 : spi.pos2)
-                        << ", \"endPos\" : " << std::to_string((spi.dir2) ? spi.pos2 : seqan::length(seq2))
+                        << ", \"endPos\" : " << std::to_string((spi.dir2) ? spi.pos2 : seqan2::length(seq2))
                         << ", \"strand\" : " << ((spi.strand2 == Strandedness::FORWARD) ? "true" : "false") << "},\n"
                         << "          \"support\" : " << std::to_string(t_count) << ",\n"
                         << "          \"reads\" : [";
@@ -1099,8 +1099,8 @@ void processFusions(const Transcriptome &trx, ProgramOptions& options) {
                 std::copy(readsInTr.begin(), readsInTr.end(), std::back_inserter(readsInGene));
                 
                 fastaOut << ">" << fasta_name << "\n"
-                        << seqan::prefix(seq1, spi.pos1)
-                        << seqan::suffix(seq2, spi.pos2)
+                        << seqan2::prefix(seq1, spi.pos1)
+                        << seqan2::suffix(seq2, spi.pos2)
                         << "\n"; 
               }
             }               
diff --git a/GeneModel.hpp b/GeneModel.hpp
index bc58fc2..39f76ea 100644
--- a/GeneModel.hpp
+++ b/GeneModel.hpp
@@ -89,7 +89,7 @@ struct GeneModel {
 struct Transcriptome {
   std::unordered_map<std::string,GeneModel> genes;
   std::unordered_map<std::string,std::string> trxToGeneId;
-  std::unordered_map<std::string, seqan::CharString> seqs;
+  std::unordered_map<std::string, seqan2::CharString> seqs;
   
   // maps transcript tr and 0-based position trpos
   //      to chr:chrpos in genome mapping to gene gene_id
@@ -254,40 +254,40 @@ void loadTranscriptome(Transcriptome& transcriptome, std::istream &in, const Pro
 
 
 void parseFasta(Transcriptome &transcriptome, const std::string &fasta_fn) {
-  seqan::SeqFileIn seqFileIn(seqan::toCString(fasta_fn));
-  seqan::CharString id;
-  seqan::CharString seq;
+  seqan2::SeqFileIn seqFileIn(seqan2::toCString(fasta_fn));
+  seqan2::CharString id;
+  seqan2::CharString seq;
 
   while(!atEnd(seqFileIn)) {
-    seqan::readRecord(id,seq,seqFileIn);
-    std::string name = std::string(seqan::toCString(id));
+    seqan2::readRecord(id,seq,seqFileIn);
+    std::string name = std::string(seqan2::toCString(id));
     size_t sp = name.find(' ');
     size_t pipe = name.find('|');
-    seqan::toUpper(seq);
+    seqan2::toUpper(seq);
     transcriptome.seqs.insert({name.substr(0,std::min(sp,pipe)), std::move(seq)});
   }  
 }
 
 void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const ProgramOptions& options) {
-  seqan::GffFileIn gtf(gtf_fn.c_str());
-  seqan::GffRecord record;
+  seqan2::GffFileIn gtf(gtf_fn.c_str());
+  seqan2::GffRecord record;
 
   int n = 0;
-  while(!seqan::atEnd(gtf)) {
+  while(!seqan2::atEnd(gtf)) {
     n++;
-    seqan::readRecord(record,gtf);
+    seqan2::readRecord(record,gtf);
     if (record.type == "gene") {
       GeneModel model;
       std::string gene_version;
       for (int i = 0; i < length(record.tagNames); i++) {
         if (record.tagNames[i] == "gene_id") {
-          model.id = seqan::toCString(record.tagValues[i]);
+          model.id = seqan2::toCString(record.tagValues[i]);
         }
         if (record.tagNames[i] == "gene_name") {
-          model.name = seqan::toCString(record.tagValues[i]);
+          model.name = seqan2::toCString(record.tagValues[i]);
         }
         if (record.tagNames[i] == "gene_biotype" || record.tagNames[i] == "gene_type") {
-          std::string val = std::string(seqan::toCString(record.tagValues[i]));
+          std::string val = std::string(seqan2::toCString(record.tagValues[i]));
           //auto &val = record.tagValues[i];
           if (val == "protein_coding") {
             model.type = BioType::PROTEIN;
@@ -298,7 +298,7 @@ void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const Pro
           }
         }
         if (record.tagNames[i] == "gene_version") {
-          gene_version = std::string(seqan::toCString(record.tagValues[i]));
+          gene_version = std::string(seqan2::toCString(record.tagValues[i]));
         }
       }
       if (!gene_version.empty() && model.id.find('.') == std::string::npos) {        
@@ -310,7 +310,7 @@ void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const Pro
       if (options.ignoreProtein) {
         model.type = BioType::PROTEIN;
       }
-      model.chr = seqan::toCString(record.ref);
+      model.chr = seqan2::toCString(record.ref);
       model.start = record.beginPos;
       model.stop = record.endPos;
       if (record.strand == '+') {
@@ -328,12 +328,12 @@ void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const Pro
       std::string gene_id, gene_version, txp_version;
       for (int i = 0; i < length(record.tagNames); i++) {
         if (record.tagNames[i] == "gene_id") {
-          gene_id = seqan::toCString(record.tagValues[i]);
+          gene_id = seqan2::toCString(record.tagValues[i]);
         } else if (record.tagNames[i] == "transcript_id") {
-          model.id = seqan::toCString(record.tagValues[i]);
+          model.id = seqan2::toCString(record.tagValues[i]);
         }
         if (record.tagNames[i] == "transcript_biotype" || record.tagNames[i] == "transcript_type") {
-          std::string val = std::string(seqan::toCString(record.tagValues[i]));
+          std::string val = std::string(seqan2::toCString(record.tagValues[i]));
           //auto &val = record.tagValues[i];
           if (val == "protein_coding") {
             model.type = BioType::PROTEIN;
@@ -343,10 +343,10 @@ void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const Pro
           bioTypeSet = true;
         }   
         if (record.tagNames[i] == "gene_version") {
-          gene_version = std::string(seqan::toCString(record.tagValues[i]));
+          gene_version = std::string(seqan2::toCString(record.tagValues[i]));
         } 
         if (record.tagNames[i] == "transcript_version") {
-          txp_version = std::string(seqan::toCString(record.tagValues[i]));
+          txp_version = std::string(seqan2::toCString(record.tagValues[i]));
         }    
       }
       if (!gene_version.empty() && gene_id.find('.') == std::string::npos) {        
@@ -356,7 +356,7 @@ void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const Pro
         model.id += "." + txp_version;
       }
       if (!bioTypeSet) {
-        std::string source = seqan::toCString(record.source);
+        std::string source = seqan2::toCString(record.source);
         // we need this for Ensembl versions 76 and below, 
         // transcripts don't have transcript_[bio]type set but store this info in the source name ?!?
         if (source == "protein_coding") {
@@ -368,7 +368,7 @@ void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const Pro
       if (options.ignoreProtein) {
         model.type = BioType::PROTEIN;
       }
-      model.chr = seqan::toCString(record.ref);
+      model.chr = seqan2::toCString(record.ref);
       model.start = record.beginPos;
       model.stop = record.endPos;
       if (record.strand == '+') {
@@ -391,15 +391,15 @@ void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const Pro
       std::string txp_version, gene_version;
       for (int i = 0; i < length(record.tagNames); i++) {
          if (record.tagNames[i] == "gene_id") {
-          gene_id = seqan::toCString(record.tagValues[i]);
+          gene_id = seqan2::toCString(record.tagValues[i]);
         } else if (record.tagNames[i] == "transcript_id") {
-          trx_id = seqan::toCString(record.tagValues[i]);
+          trx_id = seqan2::toCString(record.tagValues[i]);
         }
         if (record.tagNames[i] == "gene_version") {
-          gene_version = std::string(seqan::toCString(record.tagValues[i]));
+          gene_version = std::string(seqan2::toCString(record.tagValues[i]));
         } 
         if (record.tagNames[i] == "transcript_version") {
-          txp_version = std::string(seqan::toCString(record.tagValues[i]));
+          txp_version = std::string(seqan2::toCString(record.tagValues[i]));
         }  
       }
       if (!gene_version.empty() && gene_id.find('.') == std::string::npos) {        
@@ -408,7 +408,7 @@ void parseGTF(Transcriptome &transcriptome, const std::string &gtf_fn, const Pro
       if (!txp_version.empty() && trx_id.find('.') == std::string::npos) {        
         trx_id += "." + txp_version;
       }
-      model.chr = seqan::toCString(record.ref);
+      model.chr = seqan2::toCString(record.ref);
       model.start = record.beginPos;
       model.stop = record.endPos;
       if (record.strand == '+') {
diff --git a/main.cpp b/main.cpp
index 6fa83b2..a91524b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -8,50 +8,50 @@
 #include "GeneModel.hpp"
 #include "FilterFusions.hpp"
 
-seqan::ArgumentParser::ParseResult
+seqan2::ArgumentParser::ParseResult
 parseCommandLine(ProgramOptions & options, int argc, char const ** argv) {
 
-  seqan::ArgumentParser parser("pizzly");
+  seqan2::ArgumentParser parser("pizzly");
   // We require one argument.
-  seqan::addArgument(parser, seqan::ArgParseArgument(
-      seqan::ArgParseArgument::STRING, "FUSION"));
+  seqan2::addArgument(parser, seqan2::ArgParseArgument(
+      seqan2::ArgParseArgument::STRING, "FUSION"));
 
   // Define Options
-  seqan::addOption(parser, seqan::ArgParseOption(
+  seqan2::addOption(parser, seqan2::ArgParseOption(
       "k", "", "k-mer size used in kallisto",
-      seqan::ArgParseArgument::INTEGER, "K"));
-  seqan::addOption(parser, seqan::ArgParseOption(
+      seqan2::ArgParseArgument::INTEGER, "K"));
+  seqan2::addOption(parser, seqan2::ArgParseOption(
       "a", "align-score", "Maximum number of mismatches allowed (default: 2)",
-      seqan::ArgParseArgument::INTEGER, "ALIGN_SCORE"));
-  seqan::addOption(parser, seqan::ArgParseOption(
+      seqan2::ArgParseArgument::INTEGER, "ALIGN_SCORE"));
+  seqan2::addOption(parser, seqan2::ArgParseOption(
       "i", "insert-size", "Maximum fragment size of library (default: 400)",
-      seqan::ArgParseArgument::INTEGER, "INSERT_SIZE"));
-  seqan::addOption(parser, seqan::ArgParseOption(
+      seqan2::ArgParseArgument::INTEGER, "INSERT_SIZE"));
+  seqan2::addOption(parser, seqan2::ArgParseOption(
       "o", "output", "Prefix for output files",
-      seqan::ArgParseArgument::STRING, "OUTPUT_PREFIX"));
-  seqan::addOption(parser, seqan::ArgParseOption(
+      seqan2::ArgParseArgument::STRING, "OUTPUT_PREFIX"));
+  seqan2::addOption(parser, seqan2::ArgParseOption(
       "G", "gtf", "Annotation in GTF format",
-      seqan::ArgParseArgument::STRING, "GTF"));
-  seqan::addOption(parser, seqan::ArgParseOption(
+      seqan2::ArgParseArgument::STRING, "GTF"));
+  seqan2::addOption(parser, seqan2::ArgParseOption(
       "C", "cache", "File for caching annotation (created if not present, otherwise reused from previous runs)",
-      seqan::ArgParseArgument::STRING, "cache"));
-  seqan::addOption(parser, seqan::ArgParseOption(
+      seqan2::ArgParseArgument::STRING, "cache"));
+  seqan2::addOption(parser, seqan2::ArgParseOption(
       "F", "fasta", "Fasta reference",
-      seqan::ArgParseArgument::STRING, "FASTA"));
-  seqan::addOption(parser, seqan::ArgParseOption(
+      seqan2::ArgParseArgument::STRING, "FASTA"));
+  seqan2::addOption(parser, seqan2::ArgParseOption(
       "", "ignore-protein", "Ignore any protein coding information in annotation"));
   
 
-  seqan::setRequired(parser, "k");
-  seqan::setRequired(parser, "o");
-  seqan::setRequired(parser, "F");
-  seqan::setVersion(parser, std::string(PIZZLY_VERSION));  
+  seqan2::setRequired(parser, "k");
+  seqan2::setRequired(parser, "o");
+  seqan2::setRequired(parser, "F");
+  seqan2::setVersion(parser, std::string(PIZZLY_VERSION));  
 
   // Parse command line.
-  seqan::ArgumentParser::ParseResult res = seqan::parse(parser, argc, argv);
+  seqan2::ArgumentParser::ParseResult res = seqan2::parse(parser, argc, argv);
 
   // Only extract  options if the program will continue after parseCommandLine()
-  if (res != seqan::ArgumentParser::PARSE_OK)
+  if (res != seqan2::ArgumentParser::PARSE_OK)
       return res;
 
   // Extract option values.    
@@ -63,12 +63,12 @@ parseCommandLine(ProgramOptions & options, int argc, char const ** argv) {
   getOptionValue(options.cache, parser, "cache");
   getOptionValue(options.outprefix, parser, "output");
   getArgumentValue(options.fusionFile, parser, 0);
-  if (seqan::isSet(parser, "ignore-protein")) {
+  if (seqan2::isSet(parser, "ignore-protein")) {
       options.ignoreProtein = true;
   }
 
 
-  return seqan::ArgumentParser::PARSE_OK;
+  return seqan2::ArgumentParser::PARSE_OK;
 
 }
 
@@ -76,12 +76,12 @@ int main(int argc, char const ** argv)
 {
     // Parse the command line.
     ProgramOptions options;
-    seqan::ArgumentParser::ParseResult res = parseCommandLine(options, argc, argv);
+    seqan2::ArgumentParser::ParseResult res = parseCommandLine(options, argc, argv);
 
     // If parsing was not successful then exit with code 1 if there were errors.
     // Otherwise, exit with code 0 (e.g. help was printed).
-    if (res != seqan::ArgumentParser::PARSE_OK)
-        return res == seqan::ArgumentParser::PARSE_ERROR;
+    if (res != seqan2::ArgumentParser::PARSE_OK)
+        return res == seqan2::ArgumentParser::PARSE_ERROR;
 
     // parse GTF file
     Transcriptome trx;
