Skip to content

Commit

Permalink
skip ci
Browse files Browse the repository at this point in the history
  • Loading branch information
BjornFJohansson committed Nov 25, 2016
1 parent 9496f64 commit 469bc6b
Show file tree
Hide file tree
Showing 16 changed files with 846 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,19 @@ then
#git commit -m "processed README.md --> README.rst"
#git tag -d $tagname
#git tag $tagname
if [[ $DRONE=true ]]
if [[ $DRONE = true ]]
then
echo "DRONE: python setup.py sdist --formats=gztar,zip bdist_wheel"
python setup.py sdist --formats=gztar,zip bdist_wheel
elif [[ $TRAVIS=true ]]
elif [[ $TRAVIS = true ]]
then
echo "TRAVIS: python setup.py bdist_dmg"
python setup.py bdist_dmg
elif [[ $APPVEYOR=true ]]||[[ $APPVEYOR=True ]]
elif [[ $APPVEYOR = true ]]||[[ $APPVEYOR = True ]]
then
echo "APPVEYOR: python setup.py bdist_wininst"
python setup.py bdist_wininst
elif [[ $CIRCLECI=true ]]
elif [[ $CIRCLECI = true ]]
then
echo "CIRCLECI: python setup.py sdist --formats=gztar,zip bdist_wheel"
python setup.py sdist --formats=gztar,zip bdist_wheel
Expand Down
1 change: 0 additions & 1 deletion pydna/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ def __init__(self, dsrecs, limit = 25, only_terminal_overlaps=False, max_nodes=N
refresh = False
cached = None

#key = "|".join(sorted([str(r.seguid()) for r in dsrecs]))+str(limit)+str(only_terminal_overlaps)+str(max_nodes)
key = "|".join( [str(r.__hash__()) for r in dsrecs] )+str(limit)+str(only_terminal_overlaps)+str(max_nodes)

if os.environ["pydna_cache"] in ("compare", "cached"):
Expand Down
208 changes: 208 additions & 0 deletions scripts/.ipynb_checkpoints/js-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from IPython.display import Javascript"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"application/javascript": [
"$.getScript('http://d3js.org/d3.v3.min.js')"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Javascript(\"\"\"$.getScript('http://d3js.org/d3.v3.min.js')\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"application/javascript": [
"\n",
"\n",
"// This unhides the output area\n",
"container.show();\n",
"\n",
"// element is the jQuery element we will append to\n",
"var e = element.get(0);\n",
" \n",
"var diameter = 600,\n",
" format = d3.format(\",d\");\n",
"\n",
"var pack = d3.layout.pack()\n",
" .size([diameter - 4, diameter - 4])\n",
" .value(function(d) { return d.size; });\n",
"\n",
"var svg = d3.select(e).append(\"svg\")\n",
" .attr(\"width\", diameter)\n",
" .attr(\"height\", diameter)\n",
" .append(\"g\")\n",
" .attr(\"transform\", \"translate(2,2)\");\n",
"\n",
"d3.json(\"files/flare.json\", function(error, root) {\n",
" var node = svg.datum(root).selectAll(\".node\")\n",
" .data(pack.nodes)\n",
" .enter().append(\"g\")\n",
" .attr(\"class\", function(d) { return d.children ? \"node\" : \"leaf node\"; })\n",
" .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n",
"\n",
" node.append(\"title\")\n",
" .text(function(d) { return d.name + (d.children ? \"\" : \": \" + format(d.size)); });\n",
"\n",
" node.append(\"circle\")\n",
" .attr(\"r\", function(d) { return d.r; });\n",
"\n",
" node.filter(function(d) { return !d.children; }).append(\"text\")\n",
" .attr(\"dy\", \".3em\")\n",
" .style(\"text-anchor\", \"middle\")\n",
" .text(function(d) { return d.name.substring(0, d.r / 3); });\n",
"});\n",
"\n",
"d3.select(self.frameElement).style(\"height\", diameter + \"px\");\n"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Javascript(\"\"\"\n",
"\n",
"// This unhides the output area\n",
"container.show();\n",
"\n",
"// element is the jQuery element we will append to\n",
"var e = element.get(0);\n",
" \n",
"var diameter = 600,\n",
" format = d3.format(\",d\");\n",
"\n",
"var pack = d3.layout.pack()\n",
" .size([diameter - 4, diameter - 4])\n",
" .value(function(d) { return d.size; });\n",
"\n",
"var svg = d3.select(e).append(\"svg\")\n",
" .attr(\"width\", diameter)\n",
" .attr(\"height\", diameter)\n",
" .append(\"g\")\n",
" .attr(\"transform\", \"translate(2,2)\");\n",
"\n",
"d3.json(\"files/flare.json\", function(error, root) {\n",
" var node = svg.datum(root).selectAll(\".node\")\n",
" .data(pack.nodes)\n",
" .enter().append(\"g\")\n",
" .attr(\"class\", function(d) { return d.children ? \"node\" : \"leaf node\"; })\n",
" .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n",
"\n",
" node.append(\"title\")\n",
" .text(function(d) { return d.name + (d.children ? \"\" : \": \" + format(d.size)); });\n",
"\n",
" node.append(\"circle\")\n",
" .attr(\"r\", function(d) { return d.r; });\n",
"\n",
" node.filter(function(d) { return !d.children; }).append(\"text\")\n",
" .attr(\"dy\", \".3em\")\n",
" .style(\"text-anchor\", \"middle\")\n",
" .text(function(d) { return d.name.substring(0, d.r / 3); });\n",
"});\n",
"\n",
"d3.select(self.frameElement).style(\"height\", diameter + \"px\");\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"HTML(\"\"\"\n",
"<style>\n",
"\n",
"circle {\n",
" fill: rgb(31, 119, 180);\n",
" fill-opacity: .25;\n",
" stroke: rgb(31, 119, 180);\n",
" stroke-width: 1px;\n",
"}\n",
"\n",
".leaf circle {\n",
" fill: #ff7f0e;\n",
" fill-opacity: 1;\n",
"}\n",
"\n",
"text {\n",
" font: 10px sans-serif;\n",
"}\n",
"\n",
"</style>\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Encoding=UTF-8
Name=Link to levskaya/BioJSON: Parsers to wrangle the plethora of biological flatfile formats into standard JSON
Type=Link
URL=https://github.com/levskaya/BioJSON
Icon=text-html
75 changes: 75 additions & 0 deletions scripts/experimental/mecplugins_parse_mwg_primers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################################
# __ ____ _______ _
# | \/ \ \ / / ____| (_)
# _ __ __ _ _ __ ___ ___ | \ / |\ \ /\ / / | __ _ __ _ __ _ _ __ ___ ___ _ __ ___
# | '_ \ / _` | '__/ __|/ _ \ | |\/| | \ \/ \/ /| | |_ | | '_ \| '__| | '_ ` _ \ / _ \ '__/ __|
# | |_) | (_| | | \__ \ __/ | | | | \ /\ / | |__| | | |_) | | | | | | | | | __/ | \__ \
# | .__/ \__,_|_| |___/\___| |_| |_| \/ \/ \_____| | .__/|_| |_|_| |_| |_|\___|_| |___/
# | | | |
# |_| |_|
################################################################################################

WIKIDPAD_PLUGIN = (("MenuFunctions",1), ("ToolbarFunctions",1))

import mecplugins_ini

from Bio import SeqIO
from os import linesep
from cStringIO import StringIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import SingleLetterAlphabet

def describeMenuItems(wiki):
return ((mwgtofasta,_(u"mecplugins|DNA Sequence Tools|MWG primers to fasta format") + u"\t", _(u"mwgtofasta")),)

def empty(wiki, evt):
pass

def describeToolbarItems(wiki):
return ()

def mwgtofasta(wiki, evt):

from pyparsing import Word, Literal, printables, LineStart, SkipTo, Combine, nums

raw_string = wiki.getActiveEditor().GetSelectedText()
start, end = wiki.getActiveEditor().GetSelection()

fastaheader = Combine(Literal('>').suppress()+Word(nums).setResultsName("number")+\
Literal('_').suppress())
try:
data, dataStart, dataEnd = fastaheader.scanString(raw_string).next()
except StopIteration:
number = 1
dataStart = end - start
else:
number = int(data.number)+1

wiki.getActiveEditor().SetSelectionByCharPos(start,start+dataStart)

name = Word(printables).setResultsName("name")
seq_start = Literal("5'").suppress()
seq_stop = Literal("3'").suppress()
sequence = Combine(seq_start + SkipTo(seq_stop)).setResultsName("seq")
mwg_primer = LineStart() + name + SkipTo(LineStart()) + sequence

result = mwg_primer.scanString(raw_string)

seqlist = [data for data,dataStart,dataEnd in result]

number+=len(seqlist)

fasta_string = ''

for data in seqlist:
number-=1
s=data.seq.strip("-").replace("\n","").replace(" ","")
fasta_string+=">{number}_{name} ({length}-mer)\n{seq}\n\n".format(number=number,name=data.name,length=len(s),seq=s)

wiki.getActiveEditor().ReplaceSelection(fasta_string)
wiki.getActiveEditor().SetSelectionByCharPos(start, start+len(fasta_string))


Loading

0 comments on commit 469bc6b

Please sign in to comment.