-
Notifications
You must be signed in to change notification settings - Fork 83
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
[MISC] deprecate seqan3::field::seq_qual #2379
Conversation
SGSSGene
commented
Feb 14, 2021
•
edited
Loading
edited
- adds [DEPRECATED] in many places.
- erased mentioning of seq_qual everywhere I could find
- Wrap all usages of seqan3::field::seq_qual
- referenced cookbook to usage of field::seq and field::qual
- referenced cookbook in changelog
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/seqan/seqan3/8QFmD5iMT3RXQcok6VN81MPiShqG |
Codecov Report
@@ Coverage Diff @@
## master #2379 +/- ##
=======================================
Coverage 98.22% 98.22%
=======================================
Files 269 269
Lines 10510 10510
=======================================
Hits 10323 10323
Misses 187 187
Continue to review full report at Codecov.
|
3e55de7
to
1848fcd
Compare
a8c6458
to
409b471
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I'm just wondering why it was decided you should avoid deprecation warnings instead of using the alternative of seqan3::views::zip
and std::views::transform
. Or is that a next PR?
I am not sure what you mean by this. I havn't planned another PR :-) |
@@ -589,9 +592,12 @@ class sequence_file_input | |||
} | |||
//!\} | |||
|
|||
#pragma GCC diagnostic push // avoid deprecation warning of field::seq_qual | |||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||
//!\brief The options are public and its members can be set directly. | |||
sequence_file_input_options<typename traits_type::sequence_legal_alphabet, | |||
selected_field_ids::contains(field::seq_qual)> options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here for example the deprecated field:seq_qual
is being used. It seems to me that it would make more sense to remove the usage and replace it with an alternative (since you are deprecating field:seq_qual
). But you wrap it to avoid deprecation warnings instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx! Yes, this doesn't seem correct. I will look into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay :) what you did does match the issue description but I also found it a bit strange
include/seqan3/io/record.hpp
Outdated
@@ -64,7 +66,7 @@ enum class field | |||
seq, //!< The "sequence", usually a range of nucleotides or amino acids. | |||
id, //!< The identifier, usually a string. | |||
qual, //!< The qualities, usually in Phred score notation. | |||
seq_qual, //!< Sequence and qualities combined in one range. | |||
seq_qual SEQAN3_DEPRECATED_310, //!< [DEPRECATED] Sequence and qualities combined in one range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether
seq_qual SEQAN3_DEPRECATED_310, //!< [DEPRECATED] Sequence and qualities combined in one range. | |
_seq_qual_deprecated, //!< [DEPRECATED] Sequence and qualities combined in one range. | |
seq_qual SEQAN3_DEPRECATED_310 = _seq_qual_deprecated, //!< [DEPRECATED] Sequence and qualities combined in one range. |
include/seqan3/io/record.hpp
Outdated
@@ -108,7 +110,7 @@ enum class field | |||
SEQ SEQAN3_DEPRECATED_310 = seq, //!< Please use the field name in lower case. | |||
ID SEQAN3_DEPRECATED_310 = id, //!< Please use the field name in lower case. | |||
QUAL SEQAN3_DEPRECATED_310 = qual, //!< Please use the field name in lower case. | |||
SEQ_QUAL SEQAN3_DEPRECATED_310 = seq_qual, //!< Please use the field name in lower case. | |||
SEQ_QUAL SEQAN3_DEPRECATED_310 = seq_qual, //!< [DEPRECATED] Please use the field name in lower case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and
SEQ_QUAL SEQAN3_DEPRECATED_310 = seq_qual, //!< [DEPRECATED] Please use the field name in lower case. | |
SEQ_QUAL SEQAN3_DEPRECATED_310 = _seq_qual_deprecated, //!< [DEPRECATED] Please use the field name in lower case. |
will enable us to remove the surrondung #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is a matter of style and taste. To me both solution are valid solution.
I think that the pragma
solution is very spot on, but the _seq_qal_deprecated
is very compact.
You decide :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I've made the experience that opening #pragma GCC diagnostic ...
can hide errors if you span it around complete classes / structs. So I would prefer a more local solution. Can you change it? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :-)
409b471
to
fa5dd72
Compare
Hmm something went wrong with your rebase, can you do it again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small review, I will do the rest after the rebase was successful. I stopped for now, because I had some trouble to see what you or someone else changed.
@@ -650,13 +647,14 @@ class sequence_file_input | |||
std::visit([&] (auto & f) | |||
{ | |||
// read new record | |||
if constexpr (selected_field_ids::contains(field::seq_qual)) | |||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// | |
// read new record |
fa5dd72
to
818189e
Compare
test/snippet/io/sequence_file/sequence_file_output_fields_trait_1.cpp
Outdated
Show resolved
Hide resolved
test/unit/io/sequence_file/sequence_file_format_test_template.hpp
Outdated
Show resolved
Hide resolved
ffa2825
to
e90f489
Compare
e90f489
to
25b51d7
Compare
seqan3::sequence_file_output fout{std::ostringstream{}, | ||
seqan3::format_fasta{}, | ||
seqan3::fields<seqan3::field::id, seqan3::field::seq_qual>{}}; | ||
seqan3::fields<seqan3::field::id, seqan3::field::seq, seqan3::field::qual>{}}; | ||
|
||
for (int i = 0; i < 5; i++) | ||
{ | ||
std::string id{"test_id"}; | ||
// vector of combined data structure: | ||
std::vector<seqan3::qualified<seqan3::dna5, seqan3::phred42>> seq_qual{{'N'_dna5, '7'_phred42}}; | ||
std::vector<seqan3::qualified<seqan3::dna5, seqan3::phred42>> seq_qual{{'N'_dna5, '7'_phred42}, | ||
{'A'_dna5, '1'_phred42}, | ||
{'C'_dna5, '3'_phred42}}; | ||
|
||
auto view_on_seq = seqan3::views::get<0>(seq_qual); | ||
auto view_on_qual = seqan3::views::get<1>(seq_qual); | ||
|
||
// ... | ||
|
||
fout.emplace_back(id, seq_qual); // note also that the order the argumets is now different, because | ||
// or: you specified that ID should be first in the fields template argument | ||
fout.push_back(std::tie(id, seq_qual)); | ||
fout.emplace_back(id, view_on_seq, view_on_qual); // Also note that the order of the arguments is now | ||
// different, because you specified that ID should be | ||
// first in the fields template argument | ||
// or: | ||
fout.push_back(std::tie(id, view_on_seq, view_on_qual)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this snippet really confusing. So we declare an seqan3::sequence_file_output
of type seqan3::format_fasta
which only includes id
and sequence
. I explicit declare that I want to have field::qual
which doesn't really mean anything, since format_fasta
will drop this information?
The snippet itself talks about how the order of the arguments is now different
but I actually don't know what its talking about. It is the same order as everywhere else ?!
I don't think I understand what this snippet is supposed to demonstrate. Any thoughts on this
@marehr @eseiler ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fastq output and not fasta.
The ordering refers to the default seq, id, qual
which should be more clear. (2nd snippet in https://docs.seqan.de/seqan/3-master-user/tutorial_sequence_file.html#autotoc_md213 shows the default order).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx, I didn't get that the default order is different. Also fastq makes a lot more sense. I will change it.
25b51d7
to
61ee307
Compare
fout.emplace_back(id, view_on_seq, view_on_qual); // Also note that the order of the arguments is now | ||
// different, because you specified that ID should be | ||
// first in the fields template argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I analysed the comment too long:
Maybe something along the lines of:
Note that the order of the arguments is different from the default `seq, id, qual`, because you specified that ID should be first in the fields template argument.
- I removed the
Also
because this is the first thing to note. - I don't like the use of
now
in the sentence because there is no point of reference as to what it was before. - For the same reason, I added the default order.
- I also added a period at the end :)
- I think this comment could go to the line above
fout.emplace_back
and use the full length...
- adds [DEPRECATED] in many places. - erased mentioning of seq_qual everywhere I could find
61ee307
to
952fd8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I don't have anything to add :)
952fd8a
to
9e6949e
Compare
9e6949e
to
d7d0b07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!