cadnano / cadnano2.5 Goto Github PK
View Code? Open in Web Editor NEWPyQt5 version of cadnano
Home Page: http://cadnano.readthedocs.io
License: Other
PyQt5 version of cadnano
Home Page: http://cadnano.readthedocs.io
License: Other
This is a major enhancement to get something that will work with the Qt Event loop
Being no python expert I naively tried to install the official python binaries on OSX El Capitan, which worked.
I then proceeded to try and run:
python pyqt5_check.py
Unfortunately, checker() fails:
AttributeError: 'module' object has no attribute 'sysconfig'
I obviously have no idea why, the error message is rather cryptic.
The line that fails seems to be:
pyroot_path = distutils.sysconfig.BASE_PREFIX
Unsure if this a bug or an issue on my end.
Steps to reproduce for virtualhelix name:
Result:
outliner <class 'cadnano.gui.views.outlinerview.virtualhelixitem.VirtualHelixItem'> - updateModel
Traceback (most recent call last):
File "./cadnano/gui/views/outlinerview/outlinertreewidget.py", line 135, in dataChangedSlot
c_i.updateModel()
File "./cadnano/gui/views/outlinerview/cnoutlineritem.py", line 53, in updateModel
if color != cn_model.getProperty('color'):
File "./cadnano/virtualhelix/virtualhelix.py", line 83, in getProperty
return self._properties[key]
KeyError: 'color'
Abort trap: 6
Steps to reproduce for part name:
Result:
outliner <class 'cadnano.gui.views.outlinerview.nucleicacidpartitem.NucleicAcidPartItem'> - updateModel
Traceback (most recent call last):
File "./cadnano/gui/views/propertyview/abstractproppartitem.py", line 29, in partPropertyChangedSlot
self.setValue(property_key, new_value)
File "./cadnano/gui/views/propertyview/cnpropertyitem.py", line 87, in setValue
current_value = p_i.data(VAL_COL, Qt.DisplayRole)
AttributeError: 'str' object has no attribute 'data'
Abort trap: 6
Am playing with the code on windows 8, python 3.4
The program starts, and I am able (most of the times) to do the design.
But saving doesn't write anything into destination directory.
Shell says:
Traceback (most recent call last):
File "C:\Users\user\Desktop\cadnano2.5-master\cadnano\gui\controllers\documentcontroller.py", line 273, in actionSaveSlot
self.saveFileDialog()
File "C:\Users\user\Desktop\cadnano2.5-master\cadnano\gui\controllers\documentcontroller.py", line 498, in saveFileDialog
self.writeDocumentToFile(fname)
File "C:\Users\user\Desktop\cadnano2.5-master\cadnano\gui\controllers\documentcontroller.py", line 723, in writeDocumentToFile
with open(filename, 'w') as f:
TypeError: invalid file: ('C:/Users/user/Desktop/cadnano2.5-master/EXAMPLES/gg.json', 'python (*.json)')
Apparently filename gets back a list, instead of a single filename.
Getting just the first element fixes the issue.
To reproduce, run from testdev
branch with "-t" flag for tests
$ python3 bin/main.py -t
Output:
['bin/main.py', '-t']
the doc <cadnano.document.Document object at 0x104959c18>
running tests
testFunctional1 (cadnano.tests.functionaltests.FunctionalTests)
docstring for testFunctional1 ... the doc <cadnano.document.Document object at 0x10b328ca8>
ok
testStapleOutput_Gap_Vs_Skip (cadnano.tests.functionaltests.FunctionalTests)
Staple gap output as '?'; staple skip output as '' ... Segmentation fault: 11
Selected 2 scaf strands and pressed "delete" key gave this exception
Traceback (most recent call last):
File "./cadnano/gui/views/pathview/pathselection.py", line 136, in keyPressEvent
self.selectionbox.deleteSelection()
File "./cadnano/gui/views/pathview/pathselection.py", line 470, in deleteSelection
self._item_group.document().deleteSelection()
File "./cadnano/document.py", line 341, in deleteSelection
strand.strandSet().removeStrand(strand)
File "./cadnano/strandset/strandset.py", line 317, in removeStrand
return strandset_idx
NameError: name 'strandset_idx' is not defined
(Maybe this is fixed elsewhere but I'm working in outlinerdev branch)
View names like "Slice" and "Path" will have less meaning over time as we extend capabilities by adding new part types.
Add standard logging
Add a part, then undo:
Traceback (most recent call last):
File "./cadnano/addinstancecmd.py", line 35, in undo
obji.partRemovedSignal.emit(obji)
AttributeError: 'ObjectInstance' object has no attribute 'partRemovedSignal'
Make sure menus are looking good and placed correctly and get rid of redundancies
Oligo modifications (aka "mods") are text strings that can be included in a DNA sequence.
Currently they are exported in separate columns
4[39],5[39],CAATAGCTCATGGT,10,#7300de,/5Biosg/,/3Cy3sp/
So the sequence exported reflects what is in the model, we should instead concatenate the mods and the DNA sequence before export, i.e.
4[39],5[39],/5Biosg/CAATAGCTCATGGT/3Cy3sp/,10,#7300de
Randomly clicking around on some stacked parts and saw this (noting here, but not sure how to reproduce)
Traceback (most recent call last):
File "./cadnano/gui/views/sliceview/emptyhelixitem.py", line 328, in mouseReleaseEvent
self.autoScafMidSeam(strands)
File "./cadnano/gui/views/sliceview/emptyhelixitem.py", line 182, in autoScafMidSeam
strand2 = vh2.scaffoldStrandSet().getStrand(ss_base_low_idx2)
AttributeError: 'NoneType' object has no attribute 'scaffoldStrandSet'
and add additional new feature tests
QTextCursor::setPosition: Position '19' out of range
Steps to reproduce: create some strands, add an insertion, and then apply a squence with Add Seq tool. Something like .
Result:
Traceback (most recent call last):
File "./cadnano/gui/views/pathview/strand/stranditem.py", line 155, in oligoSequenceAddedSlot
self._updateSequenceText()
File "./cadnano/gui/views/pathview/strand/stranditem.py", line 445, in _updateSequenceText
i_items[idx].setSequence(seq_txt)
File "./cadnano/gui/views/pathview/strand/decorators/insertionitem.py", line 241, in setSequence
self._updateSequenceText()
File "./cadnano/gui/views/pathview/strand/decorators/insertionitem.py", line 291, in _updateSequenceText
mat.rotate(-tangAng + angleOffset)
AttributeError: 'QMatrix3x3' object has no attribute 'rotate'
For allowing color maps to be applied to a part and saved
Steps to reproduce: add some scaffold to a part, select & delete it, and then undo.
Traceback (most recent call last):
File "./cadnano/strandset/removestrandcmd.py", line 129, in undo
Strand.setOligo(s5p, oligo)
NameError: name 'Strand' is not defined
read the docs and examples
Since this works so well in Anaconda, maybe a setup.py is worth having
To reproduce: use Add Seq tool to apply sequence. Switch to "Custom" tab and paste in a sequence. Result:
Traceback (most recent call last):
File "./cadnano/gui/views/pathview/strand/endpointitem.py", line 220, in mousePressEvent
getattr(self, tool_method_name)(modifiers, event, self.idx())
File "./cadnano/gui/views/pathview/strand/endpointitem.py", line 274, in addSeqToolMousePress
olgLen, seqLen = self._getActiveTool().applySequence(m_strand.oligo())
File "./cadnano/gui/views/pathview/tools/addseqtool.py", line 144, in applySequence
self.validatedSequenceToApply = str(self.seqBox.toPlainText().toUpper())
AttributeError: 'str' object has no attribute 'toUpper'
To reproduce: using Select tool, shift-click on two adjacent endpoints. Throws exception:
the doc <cadnano.document.Document object at 0x1051458b8>
Traceback (most recent call last):
File "./cadnano/strandset/mergecmd.py", line 96, in redo
Strand.setOligo(strand, olg) # emits strandHasNewOligoSignal
NameError: name 'Strand' is not defined
When trying to delete strands or xovers in dev branch (at 886922f or 5cccc7e), it is only possible to delete the a strand at the 3p end of an oligo. Anything else throws an error with traceback:
Traceback (most recent call last):
File "C:\Users\scholer\Dev\src-repos\cadnano\cadnano2.5\cadnano\gui\views\pathview\pathselection.py", line 135, in keyPressEvent
self.selectionbox.deleteSelection()
File "C:\Users\scholer\Dev\src-repos\cadnano\cadnano2.5\cadnano\gui\views\pathview\pathselection.py", line 469, in deleteSelection
self._item_group.document().deleteSelection()
File "C:\Users\scholer\Dev\src-repos\cadnano\cadnano2.5\cadnano\document.py", line 334, in deleteSelection
Part.removeXover(part, strand, strand3p, useUndo)
AttributeError: type object 'Part' has no attribute 'removeXover'
The issue seems to be exactly the same (and same traceback) whether deleting a strand or an xover.
Adding this to the to-do list, per recent discussion. Currently only the Paint Tool has its own button that lives at the top of the Path view, but it should be possible for all buttons.
Issue is in addseqtool.py
Traceback (most recent call last):
File "./cadnano/gui/views/pathview/tools/addseqtool.py", line 34, in highlightBlock
index = text.indexOf(dnapattern, index + length)
AttributeError: 'str' object has no attribute 'indexOf'
Per @grinner suggestion, switch to python re
_dnapattern = re.compile("[^ACGTacgt]")
...
def highlightBlock(self, text):
invalid_iter = _dnapattern.finditer(text)
for match in invalid_iter:
start, end = match.span()
length = end-start
self.setFormat(start, length, self.format)
self.setCurrentBlockState(0)
# end def
nuff said. Split happens but no xover appears
Got a weird crash when clicking around creating strands in multiple parts. Maybe autoScaf can be triggered on a single helix?
Traceback (most recent call last):
File "./cadnano/gui/views/sliceview/emptyhelixitem.py", line 339, in mouseReleaseEvent
self.autoScafMidSeam(strands)
File "./cadnano/gui/views/sliceview/emptyhelixitem.py", line 193, in autoScafMidSeam
strand2 = vh2.scaffoldStrandSet().getStrand(ss_base_low_idx2)
AttributeError: 'NoneType' object has no attribute 'scaffoldStrandSet'
Abort trap: 6
Make sure sequence can be applied to staples in GUI. It should use the staple/scaffold select button to determine if possible
To reproduce, add new part, click on a sliceview helix, hit undo.
Exception:
the doc <cadnano.document.Document object at 0x1051458b8>
Traceback (most recent call last):
File "./cadnano/part/createvhelixcmd.py", line 40, in undo
vh.virtualHelixRemovedSignal.emit(vh, self._batch)
TypeError: virtualHelixRemovedSignal[QObject] signal has 1 argument(s) but 2 provided
Solution here:
http://stackoverflow.com/questions/22745076/libpng-warning-iccp-known-incorrect-srgb-profile
shows up due to newer libpngs and our non-complient pngs
In current dev (and outlinerdev) branches, invoking StrandSet.removeStrand() - e.g. by marking a strand in the GUI and pressing delete - produces a NameError and traceback in the terminal:
Traceback (most recent call last):
File ".\cadnano\gui\views\pathview\pathselection.py", line 135, in keyPressEvent
self.selectionbox.deleteSelection()
File ".\cadnano\gui\views\pathview\pathselection.py", line 469, in deleteSelection
self._item_group.document().deleteSelection()
File ".\cadnano\document.py", line 348, in deleteSelection
strand.strandSet().removeStrand(strand)
File ".\cadnano\strandset\strandset.py", line 322, in removeStrand
return strandset_idx
NameError: name 'strandset_idx' is not defined
Current dev and outlinerdev branches (and others with commit f47b61 as parent) has a but that prevents applying a custom sequence. Commit f47b61 uses python regex to detect invalid characters, but the method re.find does not exists (AttributeError: 'module' object has no attribute 'find') and should be replaced with re.search.
Holding the AltModifier (Option key on mac) when doing a left mouseclick on an EndpointItem automatically extends it to its drag boundary. This is intended as a timesaving trick.
However, click+dragging with AltModifier somehow attempts to resize further than true the boundary, probably by doing two resize operations in serial.
Traceback (most recent call last):
File "./cadnano/addinstancecmd.py", line 34, in undo
if isinstance(obji.reference(), Part):
AttributeError: 'ObjectInstance' object has no attribute 'reference'
As cadnano is used for more and more things, the whole "scaffolded origami" paradigm doesn't always match up with reality. For instance, some designs may not have a clear "scaffold" vs "staple strands". Since there is nothing in the code preventing sequences to be applied to staple strands rather than scaffold strands, maybe we should open that feature up and allow the user to apply sequences to staple strands. We might want to have a "power user" mode for this. Or we could have the same "scaffold vs staple" selection mode for addseq tool that is currently available in the selection and paint tools. Default would be to have scaffold-selection only, but if the user specifically "stap" mode after pressing the "AddSeq" tool, then we should allow the user to apply sequences to the staples.)
Implementation should be straightforward, assuming we decide to proceed with this. The if m_strand.isScaffold(): (...)
check in stranditem.py
and endpointitem.py
will have to be modified to check against the selection filter (if "scaf" is selected, only apply sequence to scaffold, etc).
The following should be a good point to merge testdev
back into dev
Future enhancements (beyond the scope of this issue)
With multiple parts, the old way of showing a large fixed-size canvas of empty vh items is now takes up too much space. A nice workflow would start with a relatively small default empty lattice, and allow easy dragging of edge outline to resize.
Need to detect minimum drag bounds, otherwise it's possible to hide virtualhelixitems that are in use, or resize an empty part to 0 rows x 0 cols which should never happen.
Traceback (most recent call last):
File "./cadnano/gui/controllers/documentcontroller.py", line 579, in exportStaplesCallback
output = self.activePart().getStapleSequences()
File "./cadnano/part/part.py", line 224, in getStapleSequences
s = s + oligo.sequenceExport()
File "./cadnano/oligo/oligo.py", line 143, in sequenceExport
(vhNum5p, idx5p, vhNum3p, idx3p, seq, len(seq),
NameError: name 'vhNum5p' is not define
It seems when adding vhelix, there’s a change getting made to the model to store the id_num that’s made outside of redo/undo.
Steps to reproduce: add a part and create several vhs in slice view (no need to add strands) in path view. Undo everything and then redo to get back to the same point. Now click elsewhere to add additional vhs and you should see id_nums getting reused.
I did this a few cycles to get the following:
The plugin feature of cadnano is potentially really powerful and could allow cadnano to be extended with many custom features without bloating the main software base.
However, to date, very few cadnano plugin have been published.
Is the plugin feature something that we will continue to support? If so, maybe it would be nice to have a sort of official list/repository with plugins. This would make plugins easier to find, which would also make it easier for potential new plugin developers to learn how to create cadnano plugins.
A first step could simply be a curated page/file in markdown format. If it ever becomes relevant, this could then form the basis for an actual plugin repository (e.g. something like this).
redundancies should be pulled out and hard coded things left in a .py file and everthing go to a configuration (json) file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.