Skip to content

Commit

Permalink
Added copyright notice
Browse files Browse the repository at this point in the history
  • Loading branch information
weka511 committed Sep 11, 2017
1 parent c139dca commit 00013e3
Show file tree
Hide file tree
Showing 24 changed files with 963 additions and 24 deletions.
15 changes: 15 additions & 0 deletions BA8A.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

import random,math

def FarthestFirstTraversal(data,k,m):
Expand Down
15 changes: 15 additions & 0 deletions BA8B.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

import random,math

def SquaredErrorDistortion(data,k,m):
Expand Down
15 changes: 15 additions & 0 deletions BA8C.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

def trivial_centres(k,m,data):
return [data[i] for i in range(k)]

Expand Down
15 changes: 15 additions & 0 deletions BA8D.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

import numpy as np

def soft_kmeans(k,m,beta,points,N=1,centres=None):
Expand Down
15 changes: 15 additions & 0 deletions BINS.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

def bins(n,m,a,values):
def search(value,imin,imax):
if imin>imax:
Expand Down
15 changes: 15 additions & 0 deletions CORR.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

def revc(dna):
return dna.translate({
ord('A'): 'T',
Expand Down
15 changes: 15 additions & 0 deletions DDEG.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

import DEG

def ddeg(n,M,A):
Expand Down
36 changes: 15 additions & 21 deletions DEG.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

def deg(n,m,A):
degrees=[0 for a in range(n)]
for (a,b) in A:
Expand All @@ -20,24 +35,3 @@ def deg(n,m,A):
#print(A[1:])
print (deg(n,m,A[1:]))
print ('Elapsed: {0} seconds'.format(timeit.default_timer() - start_time))
#A=[
#[1, 2],
#[2, 3],
#[6, 3],
#[5, 6],
#[2, 5],
#[2, 4],
#[4, 1]]

#print (deg(6,7,A))

#6 7
#1 2
#2 3
#6 3
#5 6
#2 5
#2 4
#4 1

#2 4 2 2 2 2
15 changes: 15 additions & 0 deletions FRMT.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

from Bio import Entrez,SeqIO
inputs = 'JN698988 NM_001271262 JN573266 JQ342169 NM_001133698 JX462669 NM_204821 BT149867 JX472277'

Expand Down
14 changes: 14 additions & 0 deletions GBK.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>
Entrez.email = "simon@greenweaves.nz"
handle = Entrez.esearch(db="nucleotide", term='"Zea mays"[Organism] AND rbcL[Gene]')
record = Entrez.read(handle)
Expand Down
15 changes: 15 additions & 0 deletions INS.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

def ins(n,A):
swap=0
for i in range(1,n):
Expand Down
15 changes: 15 additions & 0 deletions INV.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

import timeit

def inv(n,A):
Expand Down
15 changes: 15 additions & 0 deletions LONG.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

def match(s1,s2):
index=-1
for i in range(min(len(s1),len(s2))//2,min(len(s1),len(s2))):
Expand Down
14 changes: 14 additions & 0 deletions MED.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

import random

Expand Down
15 changes: 15 additions & 0 deletions MER.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

def mer(n,A,m,B):
i=0
j=0
Expand Down
15 changes: 15 additions & 0 deletions MS.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

import MER

def ms(n,A):
Expand Down
16 changes: 15 additions & 1 deletion PAR.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

def par(n,A):
prefix=[]
suffix=[A[0]]
Expand All @@ -8,7 +23,6 @@ def par(n,A):
suffix.append(a)
return prefix + suffix

#print(par(9,[7, 2 ,5 ,6, 1, 3, 9, 4, 8]))

if __name__=='__main__':

Expand Down
15 changes: 14 additions & 1 deletion PAR3.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>
def par3(n,A):
prefix=[]
suffix=[]
Expand All @@ -11,7 +25,6 @@ def par3(n,A):
suffix.append(a)
return prefix + mid + suffix

#print(par3(9,[4 ,5, 6, 4 ,1, 2, 5, 7, 4]))

if __name__=='__main__':

Expand Down
15 changes: 15 additions & 0 deletions PTRA.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017 Greenweaves Software Pty Ltd

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>

from Bio.Seq import translate
import sys

Expand Down
Loading

0 comments on commit 00013e3

Please sign in to comment.