Skip to content

Commit

Permalink
Merge pull request #718 from lldelisle/biopython
Browse files Browse the repository at this point in the history
Make it compatiblle with last versions of Biopython
  • Loading branch information
joachimwolff authored Jun 30, 2021
2 parents 75ba115 + 2b1f239 commit 1158a68
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'matplotlib', 'matplotlib.pyplot', 'matplotlib.gridspec', 'matplotlib.ticker',
'matplotlib.textpath', 'matplotlib.patches', 'matplotlib.colors', 'matplotlib.cm',
'mpl_toolkits', 'mpl_toolkits.axisartist', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid1',
'Bio', 'Bio.Seq', 'Bio.Alphabet', 'pyBigWig', 'tables', 'pytables', 'future', 'past', 'past.builtins',
'Bio', 'Bio.Seq', 'pyBigWig', 'tables', 'pytables', 'future', 'past', 'past.builtins',
'future.utils', 'cooler', 'logging', 'unidecode', 'hic2cool', 'hicmatrix', 'hicmatrix.HiCMatrix',
'hicmatrix.lib', 'krbalancing', 'fit_nbinom', 'pybedtools', 'graphviz', 'hyperopt', 'sklearn', 'sklearn.cluster']

Expand Down
2 changes: 1 addition & 1 deletion docs/content/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Requirements
* ipykernel >= 5.3.0
* pysam >= 0.16.*
* intervaltree >= 3.1.*
* biopython < 1.77
* biopython
* pytables >= 3.6.*
* pandas >= 1.1.*
* pybigwig >= 0.3.*
Expand Down
3 changes: 1 addition & 2 deletions hicexplorer/hicBuildMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from intervaltree import IntervalTree, Interval

from Bio.Seq import Seq
from Bio.Alphabet import generic_dna

# own tools
from hicmatrix import HiCMatrix as hm
Expand Down Expand Up @@ -1204,7 +1203,7 @@ def main(args=None):
dangling_sequences[args.restrictionSequence[i]] = {}
dangling_sequences[args.restrictionSequence[i]]['pat_forw'] = args.danglingSequence[i]
dangling_sequences[args.restrictionSequence[i]]['pat_rev'] = str(
Seq(args.danglingSequence[i], generic_dna).reverse_complement())
Seq(args.danglingSequence[i]).reverse_complement())

log.info("dangling sequences to check "
"are {}\n".format(dangling_sequences))
Expand Down
5 changes: 2 additions & 3 deletions hicexplorer/hicFindRestSite.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from functools import partial
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
from hicexplorer._version import __version__

import logging
Expand Down Expand Up @@ -97,7 +96,7 @@ def find_pattern(pattern, fasta_file, out_file):
"""

# get the reverse complement of the pattern
rev_compl = str(Seq(pattern, generic_dna).reverse_complement())
rev_compl = str(Seq(pattern).reverse_complement())

temp = NamedTemporaryFile(suffix=".bed", delete=False, mode='wt')
try:
Expand All @@ -109,7 +108,7 @@ def find_pattern(pattern, fasta_file, out_file):
_open = partial(gzip.open, mode='rt') if encoding == 'gzip' else open

with _open(fasta_file_name) as f:
for record in SeqIO.parse(f, 'fasta', generic_dna):
for record in SeqIO.parse(f, 'fasta'):
# find all the occurrences of pattern
for match in re.finditer(pattern, str(record.seq), re.IGNORECASE):
_ = temp.write('{}\t{}\t{}\t.\t0\t+\n'.format(record.name,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matplotlib-base >= 3.1.*
ipykernel >= 5.3.0
pysam >= 0.16.*
intervaltree >= 3.1.*
biopython < 1.77
biopython
pytables >= 3.6.*
pandas >= 1.1.*
pybigwig >= 0.3.*
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def checkProgramIsInstalled(self, program, args, where_to_download,
"ipykernel >= 5.3.0",
"pysam >= 0.16",
"intervaltree >= 3.1.*",
"biopython < 1.77",
"biopython",
"tables >= 3.6.*",
"pandas >= 1.1.*",
"pyBigWig >= 0.3.*",
Expand Down

0 comments on commit 1158a68

Please sign in to comment.