Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64133037
PlotChimera.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 24, 19:45
Size
1 KB
Mime Type
text/x-python
Expires
Sun, May 26, 19:45 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17842342
Attached To
rNPTOOLS Nanopore Tools
PlotChimera.py
View Options
#Input Stuff
import
MiscParameters
as
pm
import
numpy
as
np
import
Functions
as
f
import
os
import
matplotlib.pyplot
as
plt
from
tkinter
import
Tk
from
tkinter.filedialog
import
askopenfilenames
from
tkinter.filedialog
import
askopenfilename
from
matplotlib.font_manager
import
FontProperties
fontP
=
FontProperties
()
fontP
.
set_size
(
'small'
)
pm
.
init
(
LoadFiles
=
0
)
root
=
Tk
()
root
.
withdraw
()
os
.
system
(
'''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "python" to true' '''
)
# Load File, empty string prompts a pop.up window for file selection. Else a file-path can be given
LP
=
10e3
root
.
update
()
filenames
=
askopenfilenames
()
root
.
destroy
()
for
filename
in
filenames
:
print
(
filename
)
inp
=
f
.
OpenFile
(
filename
,
ChimeraLowPass
=
LP
,
approxImpulseResponse
=
True
)
folder
=
pm
.
OutputFolder
file
=
os
.
sep
+
str
(
os
.
path
.
split
(
filename
)[
1
][:
-
4
])
print
(
'Number of samples in file: {}'
.
format
(
len
(
inp
[
'i1'
])))
if
not
os
.
path
.
exists
(
folder
):
os
.
makedirs
(
folder
)
fig
=
plt
.
figure
(
1
,
figsize
=
(
16
,
5
))
ax
=
fig
.
add_subplot
(
111
)
ax
.
plot
(
np
.
arange
(
0
,
len
(
inp
[
'i1'
][
100
:]))
/
inp
[
'samplerate'
],
inp
[
'i1'
][
100
:]
*
1e9
)
ax
.
set_ylabel
(
'Current (nA)'
)
ax
.
set_xlabel
(
'Time (s)'
)
#plt.show()
fig
.
savefig
(
'/Volumes/lben/lben-commun/2018 User Data/Publications/Ke-ssdsDNA/raw materials/raw chimera traces/'
+
file
+
'.pdf'
,
transparent
=
True
)
ax
.
clear
()
fig
.
clear
()
Event Timeline
Log In to Comment