Coder Social home page Coder Social logo

cadnano2.5's People

Contributors

gitter-badger avatar grinner avatar hadim avatar heerpa avatar nickfong avatar scholer avatar sdouglas avatar

Stargazers

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

Watchers

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

cadnano2.5's Issues

Fix interact mode

This is a major enhancement to get something that will work with the Qt Event loop

Errors trying to run 'python pyqt5_check.py'

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.

Editing 'name' property throws exception

Steps to reproduce for virtualhelix name:

  1. Create a part, and a vh
  2. Select the vh in outlinerview
  3. Edit the vh name in propertyview.

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:

  1. Create a part
  2. Edit the part name in the outlinerview

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

Saving design-files is broken.

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.

testStapleOutput_Gap_Vs_Skip segfaults

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

'strandset_idx' is not defined in strandset.removeStrand

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)

Abstract the Views

View names like "Slice" and "Path" will have less meaning over time as we extend capabilities by adding new part types.

  1. Rename Views according to their location in the interface rather than origami-specific function. I recommend renaming SliceView → FirstView, and PathView → SecondView, etc. I also considered LeftView and RightView, but if we end up adding more views, this won't make sense. We could do View1 and View2 but I think having word names is preferable.
  2. Migrate view-specific buttons to panels inside Views. Again, if we move to abstract the views, then Slice buttons like "First" "Last" (both of which I think we should drop entirely) and "Rnum" are not going to be relevant. Likewise for Path. In general all buttons should probably be dynamically generated per Part. (Maybe we can take that opportunity to avoid the _rc icon convention?)

Button Icon size

  • remove text / make it a preference so images can be bigger
  • make selectable icons bigger

concatenate sequence string with modifications

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

autoscaf bug

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'

Insertion tool edge cases

  1. Add insertion to dsDNA, pick a number, and then click away instead of hitting "Enter", and the insertion does not resolve properly (i.e. copy its value to other strand)
  2. Need to restrict "tab" keypresses, otherwise we get weird behavior.

insertions_bugs

AddSeq to strand with Insertions throws exception

Steps to reproduce: create some strands, add an insertion, and then apply a squence with Add Seq tool. Something like this.

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'

Undo remove strand throws exception

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

add setup.py

Since this works so well in Anaconda, maybe a setup.py is worth having

Error when applying custom scaffold sequence

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'

strand merging is broken

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

Error when deleting strands or xovers

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.

Migrate part-specific buttons into the views

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.

pyqt5 QString issue breaks our QSyntaxHighlighter

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

random autostaple crash

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

First Class staple objects

Make sure sequence can be applied to staples in GUI. It should use the staple/scaffold select button to determine if possible

Can't undo adding a vhelix

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

Deleting a strand produces Error/Traceback

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

Cannot apply custom sequence (re.find attribute error)

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.

click and drag endpointitem with AltModifier causes error

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.

image

dnapart: crash on undo addPart

  1. Click Hc button to add part
  2. Undo
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'

FR: Adding sequences to staple strands

Feature request: Ability to add sequences to staple strands

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).

Isolate non-gui tests for depencency-free continuous integration

The following should be a good point to merge testdev back into dev

  1. port current tests (wherever possible) to run without initializing the qApp
  2. create travis.yml config to run free hosted CI
  3. preserve some gui tests for local testing

Future enhancements (beyond the scope of this issue)

  • Set up our own test server with necessary dependencies, and start using QTest framework for GUI tests.

Make origamipart lattice canvas resizable in slice view

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.

sliceview partitem resizing

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.

export staple sequences throws exception

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

issue with vhelix id_num accounting (arraydev)

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:

vh_id_num

FR: Official plugin repository

Feature request: Official plugin repository

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).

fix styles/preferences.py

redundancies should be pulled out and hard coded things left in a .py file and everthing go to a configuration (json) file.

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.