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

Formatting scan alignments c++ code using clang-Google formatter #76

Open
wants to merge 1 commit into
base: accelerate_preprocess_new
Choose a base branch
from
Open
Show file tree
Hide file tree
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
71 changes: 34 additions & 37 deletions neusomatic/cpp/msa.cpp
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
#include <iostream>
#include <iostream>
#include <fstream>

#include <seqan/store.h>
#include <seqan/realign.h>
#include <seqan/store.h>

#include <fstream>
#include <iostream>

#include <msa_options.h>
#include "msa_options.h"

void MSA(neusomatic::Options const& opt)
{
using namespace seqan;
CharString seqFileName = opt.input().c_str();
SeqFileIn seqFileIn(toCString(seqFileName));
StringSet<CharString> ids;
StringSet<Dna5String> seqs;
try
{
readRecords(ids, seqs, seqFileIn);
}
catch (Exception const & e)
{
std::cout << "ERROR: " << e.what() << std::endl;
return;
}
int n = length(ids);
Align<Dna5String> align;
resize(rows(align), n);
for (int i = 0; i < n; ++i){
assignSource(row(align, i), seqs[i]);
}
void MSA(neusomatic::Options const& opt) {
using namespace seqan;
CharString seqFileName = opt.input().c_str();
SeqFileIn seqFileIn(toCString(seqFileName));
StringSet<CharString> ids;
StringSet<Dna5String> seqs;
try {
readRecords(ids, seqs, seqFileIn);
} catch (Exception const& e) {
std::cout << "ERROR: " << e.what() << std::endl;
return;
}
int n = length(ids);
Align<Dna5String> align;
resize(rows(align), n);
for (int i = 0; i < n; ++i) {
assignSource(row(align, i), seqs[i]);
}

globalMsaAlignment(align, SimpleScore(opt.match_score(), -opt.mismatch_score(), -opt.gap_extension_score(), -opt.gap_open_score()));
globalMsaAlignment(align,
SimpleScore(opt.match_score(), -opt.mismatch_score(),
-opt.gap_extension_score(), -opt.gap_open_score()));

std::ofstream outfile;
outfile.open(opt.output().c_str());
for (int i = 0; i < n; ++i){
outfile << ">" << ids[i] << "\n";
outfile << row(align, i) << "\n";
}
outfile.close();
std::ofstream outfile;
outfile.open(opt.output().c_str());
for (int i = 0; i < n; ++i) {
outfile << ">" << ids[i] << "\n";
outfile << row(align, i) << "\n";
}
outfile.close();
}

int main(int argc, char *argv []) {
int main(int argc, char* argv[]) {
neusomatic::Options opt(argc, argv);
MSA(opt);
return 0;
Expand Down
Loading