Giter Club home page Giter Club logo

icoshift's People

Contributors

mfitzp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

icoshift's Issues

Test fails on numpy 1.9.1

Hi I have some problem running the test.py:

import icoshift
import numpy as np

test = np.array([
[0, 0, 0, 2, 3, 2, 0, 0, 2, 1, 2, np.nan, 3, 4, 2, 3, 2, 0, 2, 3, 2],
[0, 0, 2, 3, 2, 0, 0, 2, 3, 1, 2, np.nan, 3, 4, 3, 2, 0, 2, 3, 2, 0],
[0, 2, 3, 2, 0, 0, 2, 3, 2, 1, 2, np.nan, 3, 4, 2, 0, 2, 3, 2, 0, 1],
])
xCS, ints, ind, target = icoshift.icoshift('average', test)
print '********** PASS 1: average **********'

test = np.array([
[0, 0, 0, 2, 3, 2, 0, 0, 2, 3, 2, np.nan, 0, 0, 2, 3, 2, 0, 2, 3, 2],
[0, 0, 2, 3, 2, 0, 0, 2, 3, 2, 0, np.nan, 0, 2, 3, 2, 0, 2, 3, 2, 0],
[0, 2, 3, 2, 0, 0, 2, 3, 2, 0, 0, np.nan, 2, 3, 2, 0, 2, 3, 2, 0, 1],
])

xCS, ints, ind, target = icoshift.icoshift('median', test)
print '********** PASS 2: median **********'

I get:

ValueError                                Traceback (most recent call last)
<ipython-input-3-729c4e491a6c> in <module>()
      7 [0, 2, 3, 2, 0, 0, 2, 3, 2, 1, 2, np.nan, 3, 4, 2, 0, 2, 3, 2, 0, 1],
      8 ])
----> 9 xCS, ints, ind, target = icoshift.icoshift('average', test)
     10 print '********** PASS 1: average **********'
     11 

/gcdata/gcproj/Luca/noah/lib/python2.7/site-packages/icoshift/icoshift.pyc in icoshift(xt, xp, inter, n, scale, coshift_preprocessing, coshift_preprocessing_max_shift, fill_with_previous, average2_multiplier)
    386         else:
    387             intern_, flag_nan = remove_nan(
--> 388                 ref(inter), cat(0, xt, xp), select, flags=True)
    389             intern_ = vec(intern_.T).T
    390 

/gcdata/gcproj/Luca/noah/lib/python2.7/site-packages/icoshift/icoshift.pyc in remove_nan(b, signal, select, flags)
    994 
    995             c.resize(d.shape)
--> 996             c[count:count + max(a.shape) + 1] = d
    997 
    998             count = count + max(a.shape)

ValueError: could not broadcast input array from shape (4) into shape (3)

Any idea on how to fix it?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Still alive?

Helloi @mfitzp,
this is to ask you if this script is still alive/valid. I´m trying it but I´m finding an issue probably related to versions...
It would be great if you could help me. Thanks

My plan is to use it to align chromatography data (vectors).


ImportError Traceback (most recent call last)
Input In [22], in <cell line: 1>()
----> 1 import icoshift

File ~\AppData\Roaming\Python\Python39\site-packages\icoshift_init_.py:1, in
----> 1 from .icoshift import *

File ~\AppData\Roaming\Python\Python39\site-packages\icoshift\icoshift.py:4, in
2 import numpy
3 import scipy as sp
----> 4 from scipy.stats import nanmean, nanmedian
5 from copy import copy
6 import sys

ImportError: cannot import name 'nanmean' from 'scipy.stats' (C:\ProgramData\Anaconda3\lib\site-packages\scipy\stats_init_.py)

Fix for all allowed alignment methods

This implementation should offer all the same options that exist in the original MATLAB implementation of the algorithm. At present many of the options work, although some combinations have issues. This is an issue to track the progress on implementing anything that does not work but should.

  • 'average' target
  • 'median' target
  • 'max' target
  • 'average2' target
  • 'average2' multiplier average2_multiplier
  • 'max' target
  • all above targets with intervals inter=1...inf
  • co-shift preprocessing
  • co-shift preprocessing with coshift_preprocessing_max_shift
  • co-shift preprocessing with intervals (any)
  • fill_with_previous=False to use np.inf to fill gaps
  • custom scale (in ppm)
  • 'n' maximum shift (specified)
  • 'b' best maximum shift (search for)
  • 'f' fast-search for best maximum shift

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.