Code Monkey home page Code Monkey logo

Comments (2)

swillems avatar swillems commented on September 18, 2024 1

Dear @liquidcarbon, thanks for checking in again. Your second approach with "raw" slicing is the route I always take myself as well.

That said, I do understand the confusion with the first approach. From a technical perspective, it boils down to lines

alphatims/alphatims/bruker.py

Lines 1412 to 1413 in f6e55e8

if (return_tof_indices or return_mz_values) and (tof_indices is None):
tof_indices = self.tof_indices[raw_indices]

Since return_tof_indices is True, AlphaTims will slice the tof_indices as requested. However, providing a None slice is the same as a full : or Ellipsis ... slice, hence all elements are returned.

The confusion probably lies more in the conceptual idea of the function. It is intended to convert raw_indices to their actual coordinates. The additional frame_indices and other index options are only intended for performance reasons and to avoid additional computation.

This is somewhat hinted at by the fact that raw_indices are the only accepted non-keyword argument. Probably it is a good idea to remove the default None option to show this is an essential keyword and to update some of the documentation. If you have any suggestions, feel free to make PR into the dev branch. If not, I'll probably get to this myself in the future at some point...

from alphatims.

liquidcarbon avatar liquidcarbon commented on September 18, 2024

I can get around it by asking

data.convert_from_indices(
    raw_indices=data[[1,2], "raw"],
    return_tof_indices=True,
)

Not a big deal - was just wondering if that's expected behaviour.

from alphatims.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.