Comments (3)
Dear @Ovicula,
happy to help you!
- General remark: Please try to avoid pushing to the master-branch directly. This will keep the code cleaner.
- Could you already locate the line of code which raises the error? It's this one: https://github.com/rgiessmann/peaks/blob/master/test/footprint#L407
If you examine the context, you'll note that the variabletrace
is not defined. Compare your function with functiondetermine_factor_numerically
from https://github.com/rgiessmann/peaks/blob/master/footprint.py#L284 -- instead of defining the function's argumenttrace
you named ittrace_list
.
Suggested solution: a) either cycle through all traces in trace_list:
for trace in trace_list:
... (insert the rest of the function here)
or b) rename your arguments from:
def determine_factor_numerically(ref, trace_list, weight_smaller=1, weight_bigger=1, relative_mode=True):
to:
def determine_factor_numerically(ref, trace, weight_smaller=1, weight_bigger=1, relative_mode=True):
Hope I could help you,
Robert
from peaks.
Unfortunately it is not that easy...
For solution a) I get:
File "C:\Users\K\Desktop\Programm\New_data_and_method.py", line 33, in <module> ref = footprint.generate_averaged_negative_control(trace_list,accepted_offset=0.5) File "C:\Users\K\Desktop\Programm\footprint.py", line 213, in generate_averaged_negative_control correct_peaks_with_factor(trace,determine_factor_numerically(conc_0_traces[0],trace)) File "C:\Users\K\Desktop\Programm\footprint.py", line 407, in determine_factor_numerically for trace in trace_list: TypeError: iteration over non-sequence
For solution b) I get:
Traceback (most recent call last): File "C:\Users\K\Desktop\Programm\New_data_and_method.py", line 33, in <module> ref = footprint.generate_averaged_negative_control(trace_list,accepted_offset=0.5) File "C:\Users\K\Desktop\Programm\footprint.py", line 213, in generate_averaged_negative_control correct_peaks_with_factor(trace,determine_factor_numerically(conc_0_traces[0],trace)) File "C:\Users\K\Desktop\Programm\footprint.py", line 404, in determine_factor_numerically rmsd_old = calculate_deviance_for_all_peaks(ref, trace_list,weight_smaller,weight_bigger, relative_mode) NameError: global name 'trace_list' is not defined
If I try
def determine_factor_numerically(ref, trace, trace_list, weight_smaller=1, weight_bigger=1, relative_mode=True)
I get
Traceback (most recent call last): File "C:\Users\K\Desktop\Programm\New_data_and_method.py", line 33, in <module> ref = footprint.generate_averaged_negative_control(trace_list,accepted_offset=0.5) File "C:\Users\K\Desktop\Programm\footprint.py", line 213, in generate_averaged_negative_control correct_peaks_with_factor(trace,determine_factor_numerically(conc_0_traces[0],trace)) TypeError: determine_factor_numerically() takes at least 3 arguments (2 given)
How could I solve that? I really don't know....
Thanks!
from peaks.
Dear @Ovicula ,
now your error is propagating up, through the other levels of code, where you call the function -- please go for solution b), I will discuss it here:
determine_factor_numerically
should be changed to
def determine_factor_numerically(ref, trace, weight_smaller=1, weight_bigger=1, relative_mode=True)
, NB: omitting the trace_list
completely!
As you inserted an argument more than is necessary, this is why python complains with determine_factor_numerically() takes at least 3 arguments (2 given)
.
- If you rename trace_list with trace, please change it accordingly throughout the function's code -- i.e. replace all
trace_list
s withtrace
in the functiondetermine_factor_numerically
.
Does it work now?
Best,
Robert
from peaks.
Related Issues (5)
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 peaks.