Skip to content

Commit

Permalink
Merge pull request #192 from HadrienG/dev
Browse files Browse the repository at this point in the history
1.5.1
  • Loading branch information
HadrienG authored Oct 10, 2020
2 parents 7c353e1 + c3d5815 commit 52ad1fb
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 160 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pypi"
future = "*"
numpy = "*"
scipy = "*"
biopython = "*"
biopython = "==1.78"
joblib = "*"
pysam = "==0.15.4"
requests = "*"
Expand Down
245 changes: 127 additions & 118 deletions Pipfile.lock

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions iss/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqUtils import GC
from Bio.Alphabet import IUPAC
from Bio.SeqRecord import SeqRecord
from shutil import copyfileobj

Expand Down Expand Up @@ -131,9 +130,7 @@ def simulate_read(record, ErrorModel, i, cpu_number):
bounds = (forward_start, forward_end)
# create a perfect read
forward = SeqRecord(
Seq(str(sequence[forward_start:forward_end]),
IUPAC.unambiguous_dna
),
Seq(str(sequence[forward_start:forward_end])),
id='%s_%s_%s/1' % (header, i, cpu_number),
description=''
)
Expand All @@ -156,9 +153,7 @@ def simulate_read(record, ErrorModel, i, cpu_number):
bounds = (reverse_start, reverse_end)
# create a perfect read
reverse = SeqRecord(
Seq(rev_comp(str(sequence[reverse_start:reverse_end])),
IUPAC.unambiguous_dna
),
Seq(rev_comp(str(sequence[reverse_start:reverse_end]))),
id='%s_%s_%s/2' % (header, i, cpu_number),
description=''
)
Expand Down
1 change: 0 additions & 1 deletion iss/test/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-

from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
from Bio.SeqRecord import SeqRecord

from iss import download
Expand Down
17 changes: 4 additions & 13 deletions iss/test/test_error_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from iss.error_models import ErrorModel, basic, kde, perfect

from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
from Bio.SeqRecord import SeqRecord
from nose.tools import raises

Expand Down Expand Up @@ -40,9 +39,7 @@ def test_introduce_errors():
err_mod = basic.BasicErrorModel()

read = SeqRecord(
Seq(str('AATGC' * 25),
IUPAC.unambiguous_dna
),
Seq(str('AATGC' * 25)),
id='read_1',
description='test read'
)
Expand All @@ -58,9 +55,7 @@ def test_mut_sequence():
err_mod = basic.BasicErrorModel()

read = SeqRecord(
Seq(str('AAAAA' * 25),
IUPAC.unambiguous_dna
),
Seq(str('AAAAA' * 25)),
id='read_1',
description='test read'
)
Expand All @@ -78,16 +73,12 @@ def test_introduce_indels():
err_mod.del_for[0]['A'] = 1.0
bounds = (5, 130)
read = SeqRecord(
Seq(str('ATATA' * 25),
IUPAC.unambiguous_dna
),
Seq(str('ATATA' * 25)),
id='read_1',
description='test read'
)
ref_genome = SeqRecord(
Seq(str('ATATA' * 100),
IUPAC.unambiguous_dna
),
Seq(str('ATATA' * 100)),
id='ref_genome',
description='test reference'
)
Expand Down
25 changes: 6 additions & 19 deletions iss/test/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from iss.error_models import ErrorModel, basic, kde

from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
from Bio.SeqRecord import SeqRecord
from nose.tools import with_setup, raises

Expand Down Expand Up @@ -39,9 +38,7 @@ def test_cleanup_fail():
def test_simulate_and_save():
err_mod = basic.BasicErrorModel()
ref_genome = SeqRecord(
Seq(str('AAAAACCCCC' * 100),
IUPAC.unambiguous_dna
),
Seq(str('AAAAACCCCC' * 100)),
id='my_genome',
description='test genome'
)
Expand All @@ -52,9 +49,7 @@ def test_simulate_and_save():
def test_simulate_and_save_short():
err_mod = basic.BasicErrorModel()
ref_genome = SeqRecord(
Seq(str('AACCC' * 100),
IUPAC.unambiguous_dna
),
Seq(str('AACCC' * 100)),
id='my_genome',
description='test genome'
)
Expand All @@ -65,9 +60,7 @@ def test_simulate_and_save_short():
def test_small_input():
err_mod = kde.KDErrorModel('data/ecoli.npz')
ref_genome = SeqRecord(
Seq(str('AAAAACCCCC'),
IUPAC.unambiguous_dna
),
Seq(str('AAAAACCCCC')),
id='my_genome',
description='test genome'
)
Expand All @@ -80,9 +73,7 @@ def test_basic():
np.random.seed(42)
err_mod = basic.BasicErrorModel()
ref_genome = SeqRecord(
Seq(str('AAAAACCCCC' * 100),
IUPAC.unambiguous_dna
),
Seq(str('AAAAACCCCC' * 100)),
id='my_genome',
description='test genome'
)
Expand All @@ -97,9 +88,7 @@ def test_kde():
np.random.seed(42)
err_mod = kde.KDErrorModel('data/ecoli.npz')
ref_genome = SeqRecord(
Seq(str('CGTTTCAACC' * 400),
IUPAC.unambiguous_dna
),
Seq(str('CGTTTCAACC' * 400)),
id='my_genome',
description='test genome'
)
Expand All @@ -114,9 +103,7 @@ def test_kde_short():
np.random.seed(42)
err_mod = kde.KDErrorModel('data/ecoli.npz')
ref_genome = SeqRecord(
Seq(str('AAACC' * 100),
IUPAC.unambiguous_dna
),
Seq(str('AAACC' * 100)),
id='my_genome',
description='test genome'
)
Expand Down
2 changes: 1 addition & 1 deletion iss/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.5.0'
__version__ = '1.5.1'

0 comments on commit 52ad1fb

Please sign in to comment.