Commit 88de92b0 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

Merge branch 'affect'

parents 49c48412 ff31c858
......@@ -12,6 +12,18 @@ BINDIR=..
v: vidjil
###
kmers: cleankmers
make CONFIG="-DDEBUG_KMERS"
nokmers: cleankmers
make
cleankmers:
rm -f vidjil.o core/windowExtractor.o core/segment.o
###
spaced: cleanspaced
make
......@@ -22,11 +34,7 @@ nospaced: cleanspaced
cleanspaced:
rm -f vidjil.o core/tools.o
unsegmented:
rm -f vidjil.o core/segment.o
make CONFIG="-DOUT_UNSEGMENTED"
###
all: $(EXEC)
......
......@@ -207,8 +207,12 @@ int KmerAffectAnalyser<T>::last(const T &affect) const{
template <class T>
string KmerAffectAnalyser<T>::toString() const{
string kmer;
for (size_t i = 0; i < affectations.size(); i++)
for (size_t i = 0; i < affectations.size(); i++) {
kmer += affectations[i].toString();
#ifdef DEBUG_KMERS
kmer += ": "+spaced(seq.substr(i,kms.getS()), kms.getSeed())+"\n";
#endif
}
return kmer;
}
......
......@@ -75,6 +75,11 @@ public:
*/
int getS() const;
/**
* @return the seed used
*/
string getSeed() const;
/**
* @param seq: a sequence
* @param no_revcomp: force not to revcomp the sequence, even if
......@@ -188,6 +193,11 @@ int IKmerStore<T>::getS() const {
return s;
}
template<class T>
string IKmerStore<T>::getSeed() const {
return seed;
}
template<class T>
vector<T> IKmerStore<T>::getResults(const string &seq, bool no_revcomp) {
if ((int)seq.length() < s - 1) {
......
......@@ -31,8 +31,13 @@ WindowsStorage *WindowExtractor::extract(OnlineFasta *reads, IKmerStore<KmerAffe
stats_length[TOTAL_SEG_BUT_TOO_SHORT_FOR_THE_WINDOW] += seg.getSequence().sequence.length() ;
}
if (out_segmented)
if (out_segmented) {
*out_segmented << seg ; // KmerSegmenter output (V/N/J)
if (out_unsegmented)
*out_segmented << seg.getKmerAffectAnalyser()->toString() << endl;
}
} else if (out_unsegmented) {
*out_unsegmented << reads->getSequence();
*out_unsegmented << "#" << segmented_mesg[seg.getSegmentationStatus()] << endl;
......
......@@ -180,13 +180,15 @@ void usage(char *progname)
<< " -f <string> use custom Cost for fine segmenter : format \"match, subst, indels, homo, del_end\" (default "<<VDJ<<" )"<< endl
<< endl
<< "Debug" << endl
<< " -u output unsegmented sequences (default: " << UNSEGMENTED_FILENAME << ")" << endl
<< " and display detailed k-mer affectation both on segmented and on unsegmented sequences" << endl
<< "Output" << endl
<< " -o <dir> output directory (default: " << OUT_DIR << ")" << endl
<< " -p <string> prefix output filenames by the specified string" << endl
<< " -a output all sequences by cluster (" << SEQUENCES_FILENAME << ")" << endl
<< " -x no detailed analysis of each cluster" << endl
<< " -u output unsegmented sequences (default: " << UNSEGMENTED_FILENAME << ")" << endl
<< " -v verbose mode" << endl
<< endl
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment