Skip to content

Commit

Permalink
#91 Deleted unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
weka511 committed May 1, 2024
1 parent b0614b2 commit 12667f9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
8 changes: 0 additions & 8 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ def print_peptide(seq):



def consistent(peptide,spectrum):
def count(element,spect):
return len ([s for s in spect if s==element])
peptide_spectrum=linearSpectrum(peptide)
for element in peptide_spectrum:
if count(element,peptide_spectrum)>count(element,spectrum):
return False
return True

def read_list(file_name):
with open(file_name) as f:
Expand Down
7 changes: 0 additions & 7 deletions rosalind.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ def countMatchesInSpectra(spect1,spect2):
i2+=1
return count

def linearSpectrum(peptide):
def get_pairs():
return [(i,j) for i in range(len(peptide)) for j in range(len(peptide)+1) if i<j]
result=[sum(peptide[i:j]) for (i,j) in get_pairs()]
result.append(0)
result.sort()
return result

def cycloSpectrum1(peptide):
def get_pairs(index_range):
Expand Down

0 comments on commit 12667f9

Please sign in to comment.