walaj / SeqLib

C++ htslib/bwa-mem/fermi interface for interrogating sequence data
http://bioinformatics.oxfordjournals.org/content/early/2016/12/21/bioinformatics.btw741.full.pdf+html
Other
133 stars 36 forks source link

Merge Request for some functionality enhancement #42

Closed wulj2 closed 5 years ago

wulj2 commented 5 years ago

Hello walaj, I have create a pull request of those functionality enhancement I mentioned in https://github.com/walaj/SeqLib/issues/41 Please check whether it's okay to merge these changes.

walaj commented 5 years ago

This is great. I reviewed the changes and think it makes sense.

Before I merge to the main branch, could I suggest that we make the AlignSequence method that takes an UnalignedSequence call the original AlignSequence method, and then add the comments at the end? That way if there needs to be a change to AlignSequence, the two functions don't become out of sync. Something like:

void AlignSequence(const UnalignedSequence& us, BamRecordVector& vec, bool hardclip,
          double keep_sec_with_frac_of_primary_score, int max_secondary) const {

       AlignSequence(us.Seq, us.Name, vec, hardclip, 
               keep_sec_with_frac_of_primary_score, max_secondary);
     for (BamRecordVector::iterator i = vec.begin(); i != vec.end(); ++i)
         if (copy_comment)
                i->AddZTag("BC", us.Com);
}
wulj2 commented 5 years ago

wow, I didn't even think about this genius trick before. That's really a good idea.

walaj commented 5 years ago

Thank you!