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

[FEATURE] seqan3::sam_record #2389

Merged
merged 3 commits into from Feb 28, 2021
Merged

Conversation

marehr
Copy link
Member

@marehr marehr commented Feb 17, 2021

Part of seqan/product_backlog#289

This implements

@marehr marehr requested review from a team and eaasna and removed request for a team February 17, 2021 17:14
@vercel
Copy link

vercel bot commented Feb 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/seqan/seqan3/H2c7c6cNSGeR9Nv7A1SCR8D5UVFs
✅ Preview: https://seqan3-git-fork-marehr-ioexplicitrecordtypenr3-seqan.vercel.app

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #2389 (d59e290) into master (6f39b37) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2389   +/-   ##
=======================================
  Coverage   98.20%   98.21%           
=======================================
  Files         266      267    +1     
  Lines       10831    10864   +33     
=======================================
+ Hits        10637    10670   +33     
  Misses        194      194           
Impacted Files Coverage Δ
include/seqan3/io/alignment_file/input.hpp 100.00% <ø> (ø)
include/seqan3/io/alignment_file/record.hpp 100.00% <100.00%> (ø)
include/seqan3/io/record.hpp 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f39b37...d59e290. Read the comment docs.

Copy link
Contributor

@eaasna eaasna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the effort!

Just a small correction and a question

include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
//!\}

//!\brief The identifier, usually a string.
decltype(auto) id() &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain why there are 4 different assignments for each field? The slight differences in syntax are not clear to me

Copy link
Member Author

@marehr marehr Feb 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we want to mimic the way std::get behaves, and it will return

  • id_type && for std::get<id>(sam_record &&)
  • id_type & for std::get<id>(sam_record &)
  • id_type const && for std::get<id>(sam_record const &&)
  • id_type const & for std::get<id>(sam_record const &)

We unfortunately need 4 overloads for this depending on whether the input has the type modifier &&, &, const &&, const &. The return type, here decltype(auto), has the corresponding type modifier hidden within it.

This is a special case, and this is not the norm, so you should not write 4 accessors functions if you write code yourself. In most cases it is fine just to copy the data without having a ref/const-qualified function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation!

@eseiler eseiler self-requested a review February 24, 2021 17:27
Copy link
Member

@eseiler eseiler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just documentation stuff, I'm not sure about all the phrasings either

include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
@marehr marehr requested a review from eseiler February 24, 2021 23:02
@marehr
Copy link
Member Author

marehr commented Feb 24, 2021

@eseiler I added a couple of suggestions, can you go over them and edit and then apply them? You are completely right that seqan3::field::ref_seq aka seqan3::sam_record::reference_sequence isn't populated at all, and I "deleted" it for now.

@eseiler
Copy link
Member

eseiler commented Feb 25, 2021

@eseiler I added a couple of suggestions, can you go over them and edit and then apply them? You are completely right that seqan3::field::ref_seq aka seqan3::sam_record::reference_sequence isn't populated at all, and I "deleted" it for now.

I thought you can construct the alignment_file_input with additional reference information, and then it works?

include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
include/seqan3/io/alignment_file/record.hpp Outdated Show resolved Hide resolved
@marehr
Copy link
Member Author

marehr commented Feb 25, 2021

@eseiler I added a couple of suggestions, can you go over them and edit and then apply them? You are completely right that seqan3::field::ref_seq aka seqan3::sam_record::reference_sequence isn't populated at all, and I "deleted" it for now.

I thought you can construct the alignment_file_input with additional reference information, and then it works?

You are right, I can add this if you want. I thought of this Pr as a reintroduction of existing, working functionality, but this would be more like a new "feature". I'd want to do it in a second PR, because I need to add new test cases for it.

@eseiler
Copy link
Member

eseiler commented Feb 25, 2021

@eseiler I added a couple of suggestions, can you go over them and edit and then apply them? You are completely right that seqan3::field::ref_seq aka seqan3::sam_record::reference_sequence isn't populated at all, and I "deleted" it for now.

I thought you can construct the alignment_file_input with additional reference information, and then it works?

You are right, I can add this if you want. I thought of this Pr as a reintroduction of existing, working functionality, but this would be more like a new "feature". I'd want to do it in a second PR, because I need to add new test cases for it.

Ah, so it works for the alignment_file_record, but not for the sam_record? This is ok for me.

Do you want to rebase?

@marehr
Copy link
Member Author

marehr commented Feb 27, 2021

@eseiler I added a couple of suggestions, can you go over them and edit and then apply them? You are completely right that seqan3::field::ref_seq aka seqan3::sam_record::reference_sequence isn't populated at all, and I "deleted" it for now.

I thought you can construct the alignment_file_input with additional reference information, and then it works?

You are right, I can add this if you want. I thought of this Pr as a reintroduction of existing, working functionality, but this would be more like a new "feature". I'd want to do it in a second PR, because I need to add new test cases for it.

Ah, so it works for the alignment_file_record, but not for the sam_record? This is ok for me.

Do you want to rebase?

I added a backlog issue seqan/product_backlog#292

@eseiler eseiler merged commit be6f2c1 into seqan:master Feb 28, 2021
@marehr marehr deleted the io_explicit_record_type_nr3 branch February 28, 2021 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants