Comments (8)
"Deep views" has been deemed acceptable 😎
Now it only needs to be implemented.
from seqan3.
I would prefer the version you proposed with views working on alphabets being automatically recursive. Views operating on alphabets such as complement and translate are clearly not meant to be working on vector-of-vectors by altering the outer range. Which is at least in my opinion also quite clear for the user as the intention is to e.g. translate the inner vectors that actually contain sequence. Having only a _r
version in that case might rather confuse.
from seqan3.
Hm I think we should be consistent with the naming of functionality throughout the library. Otherwise users/developers need to keep in mind the different cases and there might be some that are not so clear.
Side Note: For me the *_r
naming convention is not intuitive. r
could mean a lot, and I think one should be able to start with seqan3 needing as little documentation as possible. What about naming it deep_reverse
, coming from the familiar python functions that operate on a lower level?
from seqan3.
I think reverse
should reverse the outermost list. as for compliment
it should work only on a vector of "complement-able" elements.
from seqan3.
I agree that the commands reverse
, translate
and complement
should only work on the outer range or container, because everything else is unexpected. For instance, consider vector<vector<dna4>> v
and you call v.reverse().complement()
. Then, complement
being implicitly deep, but reverse
not, would cause unintended behaviour.
For operations on every element in a vector we have already the view::for_each
command, or - if we prefer shortcuts - we could add the functions deep_reverse
, deep_translate
and deep_complement
as @smehringer suggested.
from seqan3.
@smehringer I am okay with different naming, but I couldn't find anything on "deep_" in python. Do you have a link?
@temehi Well, the thing is, that we definitely 100% need this functionality for ranges-of-ranges, as well. Just think about you have 1million reads and you want to translate them, it would be super annoying (and inefficient!!) to puzzle the stuff together. This was also standard procedure in SeqAn2. Of course you could translate multiple sequences at the same time...
@joergi-w We are not discussing functions, but views. Even if the views can be used with function-like syntax, the normal way is not function-like.
It is true that we can use view::for_each (actually view::transform
), but it adds unneeded complexity that is difficult to explain.
std::vector<dna4_vector> foobar{"ACGTA"_dna4, "GAGGA"_dna4};
auto v = foobar | ranges::view:transform(auto && in) { return view::translate(std::forward<decltype(in)>(in)); }
This could all be just stuck directly into the view.
On the other hand, if we have a view::deep_translate
will it only work on range-of-range? Or it will also work on range-of-range-of-range? This would make sense, from my POV. But if yes, will it also work on a simple range? Again, if yes, what do we need view::translate
for then?
Also, this applies not only to translate, it affects all views that operate on alphabets, including the to_char
, to_rank
...
Currently I lean strongly towards
- introducing a "deep property" that is explained in detail in the documentation
- some of our views will just have this deep property when it is clear that they couldn't function on range-of-range anyway (e.g.
view::to_char
,view::translate
; and it will be documented - for views that could function on range-of-range, but we want them to be deep, we add a
deep_
version, e.g.view::deep_reverse
orview::reverse_deep
(?)
This way it will "do the right thing" in most cases. In the other cases, people need to know about the property, but views are not trivial anyway, e.g. we need to document, which of the views, provide random access, which are const-iterable et cetera...
from seqan3.
PS: @joergi-w view::for_each
vs view::transform
already illustrates the problem if we don't provide the functionality ourselves. view::for_each
would have worked, but the resulting view is degraded to an input_range, i.e. no random access, no size information... while view::transform
retains the properties of the input.
from seqan3.
Ops, officially there is only deepcopy() but I still think that the keyword deep
is a good indicator for 'lower-level actions'.
from seqan3.
Related Issues (20)
- gcc13: specialization after instantiation
- push_back for aa27 HOT 5
- Bug: bgzf_thread_count not available if zlib not installed
- [Alignment] Wrong alignment score HOT 8
- Pipe notation does not compile with ranges::to HOT 2
- [Alignment] Is there a way to run align_pairwise without traceback? HOT 3
- MacOS - difficulty configuring cmake HOT 3
- char_traits.h:431:56: error: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ HOT 2
- [IO] Typedef for numeric reference ID type, constant for invalid reference ID in SAM/BAM input HOT 2
- Invalid SSL certificate on docs.seqan.de
- How to update an already built FM-Index HOT 2
- [IO] constructors in sam_file_output handle do not forward rvalue references to initialise_header_information() HOT 1
- FASTA IO parses newlines into sequence when alphabet is char
- Running Align Pairwise with linear gap Penalty and faster runtime than for affine gap penalty HOT 3
- [IO] Make `seqan3::sam_file_header::program_info_t` easier to copy HOT 6
- GCC 13 errors HOT 7
- Use OS/system packaged sdsl library HOT 10
- 3.3.0 Release HOT 3
- Tests fail to compile HOT 2
- several same-score pairwise alignments HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seqan3.