All Projects → nlgranger → SeqTools

nlgranger / SeqTools

Licence: MPL-2.0 license
A python library to manipulate and transform indexable data (lists, arrays, ...)

Programming Languages

python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
TeX
3793 projects

Projects that are alternatives of or similar to SeqTools

dropEst
Pipeline for initial analysis of droplet-based single-cell RNA-seq data
Stars: ✭ 71 (+69.05%)
Mutual labels:  pipeline, preprocessing
skippa
SciKIt-learn Pipeline in PAndas
Stars: ✭ 33 (-21.43%)
Mutual labels:  pipeline, preprocessing
sparklanes
A lightweight data processing framework for Apache Spark
Stars: ✭ 17 (-59.52%)
Mutual labels:  pipeline, preprocessing
bactmap
A mapping-based pipeline for creating a phylogeny from bacterial whole genome sequences
Stars: ✭ 36 (-14.29%)
Mutual labels:  pipeline, mapping
jsfiddle-github
JSFiddle implementation for interactive JavaScript examples.
Stars: ✭ 16 (-61.9%)
Mutual labels:  mapping
WebRISC-V
WebRISC-V: A Web-Based Education-Oriented RISC-V Pipeline Simulation Environment [PHP]
Stars: ✭ 74 (+76.19%)
Mutual labels:  pipeline
slamkit
SLAM Kit
Stars: ✭ 28 (-33.33%)
Mutual labels:  mapping
doepipeline
A python package for optimizing processing pipelines using statistical design of experiments (DoE).
Stars: ✭ 18 (-57.14%)
Mutual labels:  pipeline
hyperdrive
Extensible streaming ingestion pipeline on top of Apache Spark
Stars: ✭ 31 (-26.19%)
Mutual labels:  pipeline
rikitraki
This repository contains the client code of RikiTraki.com, a map-centric hiking log web application.
Stars: ✭ 16 (-61.9%)
Mutual labels:  mapping
open-solution-googleai-object-detection
Open solution to the Google AI Object Detection Challenge 🍁
Stars: ✭ 46 (+9.52%)
Mutual labels:  pipeline
pypely
Make your data processing easy
Stars: ✭ 17 (-59.52%)
Mutual labels:  pipeline
pipen
pipen - A pipeline framework for python
Stars: ✭ 82 (+95.24%)
Mutual labels:  pipeline
targets-minimal
A minimal example data analysis project with the targets R package
Stars: ✭ 50 (+19.05%)
Mutual labels:  pipeline
r-geo-course
An introductory course on using R for geographic data visualisation and analysis (in Russian).
Stars: ✭ 18 (-57.14%)
Mutual labels:  mapping
pypiper
Python toolkit for building restartable pipelines
Stars: ✭ 34 (-19.05%)
Mutual labels:  pipeline
nanoseq
Nanopore demultiplexing, QC and alignment pipeline
Stars: ✭ 82 (+95.24%)
Mutual labels:  pipeline
smag
Show Me A Graph - Command Line Graphing
Stars: ✭ 78 (+85.71%)
Mutual labels:  pipeline
cloud-native-pipelines
Cloud-native pipelines leveraging Concourse, Pivotal Build Service and Spinnaker to deploy apps
Stars: ✭ 15 (-64.29%)
Mutual labels:  pipeline
Microsoft.SqlServer.Types
a .NET Standard implementation of the spatial types in `Microsoft.SqlServer.Types`
Stars: ✭ 64 (+52.38%)
Mutual labels:  mapping
PyPi package CircleCI Continuous integration Documentation Code quality analysis Tests coverage Citable paper

SeqTools

SeqTools extends the functionalities of itertools to indexable (list-like) objects. Some of the provided functionalities include: element-wise function mapping, reordering, reindexing, concatenation, joining, slicing, minibatching, etc.

SeqTools functions implement on-demand evaluation under the hood: operations and transformations are only applied to individual items when they are actually accessed. A simple but powerful prefetch function is also provided to quickly evaluate elements.

SeqTools originally targets data science, more precisely the data preprocessing stages. Being aware of the experimental nature of this usage, on-demand execution is made as transparent as possible by providing fault-tolerant functions and insightful error message.

Example

Example

>>> def f1(x):
...     return x + 1
...
>>> def f2(x):  # slow and memory heavy transformation
...     time.sleep(.01)
...     return [x for _ in range(500)]
...
>>> def f3(x):
...     return sum(x) / len(x)
...
>>> data = list(range(1000))

Without seqtools, defining the pipeline and reading values looks like so:

>>> tmp1 = [f1(x) for x in data]
>>> tmp2 = [f2(x) for x in tmp1]  # takes 10 seconds and a lot of memory
>>> res = [f3(x) for x in tmp2]
>>> print(res[2])
3.0
>>> print(max(tmp2[2]))  # requires to store 499 500 useless values along
3

With seqtools:

>>> tmp1 = seqtools.smap(f1, data)
>>> tmp2 = seqtools.smap(f2, tmp1)
>>> res = seqtools.smap(f3, tmp2)  # no computations so far
>>> print(res[2])  # takes 0.01 seconds
3.0
>>> print(max(tmp2[2]))  # easy access to intermediate results
3

Batteries included!

The library comes with a set of functions to manipulate sequences:

concatenate
batch
gather
prefetch
interleaving
uniter

and others (suggestions are also welcome).

Installation

pip install seqtools

Documentation

The documentation is hosted at https://seqtools-doc.readthedocs.io.

Contributing and Support

Use the issue tracker to request features, propose improvements or report issues. For questions regarding usage, please send an email.

Related libraries

Joblib, proposes low-level functions with many optimization settings to optimize pipelined transformations. This library notably provides advanced caching mechanisms which are not the primary concern of SeqTool. SeqTool uses a simpler container-oriented interface with multiple utility functions in order to assist fast prototyping. On-demand evaluation is its default behaviour and applies at all layers of a transformation pipeline. In particular, parallel evaluation can be inserted in the middle of the transformation pipeline and won't block the execution to wait for the computation of all elements from the dataset.

SeqTools is conceived to connect nicely to the data loading pipeline of Machine Learning libraries such as PyTorch's torch.utils.data and torchvision.transforms or Tensorflow's tf.data. The interface of these libraries focuses on iterators to access transformed elements, contrary to SeqTools which also provides arbitrary reads via indexing.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].