Apply isort (forcing single lines, not sorting by type) via ruff

$ ruff check --fix --select=I \
  --config=lint.isort.force-single-line=true \
  --config=lint.isort.order-by-type=false \
  BioSQL/ Bio/ Tests/ Scripts/ Doc/ setup.py

Using ruff version 0.4.10
This commit is contained in:
ruff-isort
2024-06-26 13:15:44 +09:00
committed by Peter Cock
parent b27836ac26
commit de0bb21fb3
436 changed files with 1702 additions and 1377 deletions

View File

@ -7,7 +7,9 @@
# package.
"""Command line wrapper for the multiple alignment program Clustal Omega."""
from Bio.Application import _Option, _Switch, AbstractCommandline
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class ClustalOmegaCommandline(AbstractCommandline):

View File

@ -7,7 +7,10 @@
"""Command line wrapper for the multiple alignment program Clustal W."""
import os
from Bio.Application import _Option, _Switch, AbstractCommandline
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class ClustalwCommandline(AbstractCommandline):

View File

@ -6,7 +6,10 @@
# package.
"""Command line wrapper for the multiple alignment program DIALIGN2-2."""
from Bio.Application import _Option, _Argument, _Switch, AbstractCommandline
from Bio.Application import _Argument
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class DialignCommandline(AbstractCommandline):

View File

@ -6,7 +6,10 @@
# package.
"""Command line wrapper for the multiple sequence alignment program MSAProbs."""
from Bio.Application import _Argument, _Option, _Switch, AbstractCommandline
from Bio.Application import _Argument
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class MSAProbsCommandline(AbstractCommandline):

View File

@ -6,7 +6,10 @@
# package.
"""Command line wrapper for the multiple alignment programme MAFFT."""
from Bio.Application import _Option, _Switch, _Argument, AbstractCommandline
from Bio.Application import _Argument
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class MafftCommandline(AbstractCommandline):

View File

@ -6,7 +6,9 @@
# package.
"""Command line wrapper for the multiple alignment program MUSCLE."""
from Bio.Application import _Option, _Switch, AbstractCommandline
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class MuscleCommandline(AbstractCommandline):

View File

@ -6,7 +6,9 @@
# package.
"""Command line wrapper for the multiple alignment program PRANK."""
from Bio.Application import _Option, _Switch, AbstractCommandline
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class PrankCommandline(AbstractCommandline):

View File

@ -6,7 +6,10 @@
# package.
"""Command line wrapper for the multiple alignment program PROBCONS."""
from Bio.Application import _Option, _Switch, _Argument, AbstractCommandline
from Bio.Application import _Argument
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class ProbconsCommandline(AbstractCommandline):

View File

@ -6,7 +6,9 @@
# package.
"""Command line wrapper for the multiple alignment program TCOFFEE."""
from Bio.Application import _Option, _Switch, AbstractCommandline
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class TCoffeeCommandline(AbstractCommandline):

View File

@ -10,15 +10,15 @@ We have decided to remove this module in future, and instead recommend
building your command and invoking it via the subprocess module directly.
"""
from ._Muscle import MuscleCommandline
from ._Clustalw import ClustalwCommandline
from ._ClustalOmega import ClustalOmegaCommandline
from ._Prank import PrankCommandline
from ._Mafft import MafftCommandline
from ._Clustalw import ClustalwCommandline
from ._Dialign import DialignCommandline
from ._Mafft import MafftCommandline
from ._MSAProbs import MSAProbsCommandline
from ._Muscle import MuscleCommandline
from ._Prank import PrankCommandline
from ._Probcons import ProbconsCommandline
from ._TCoffee import TCoffeeCommandline
from ._MSAProbs import MSAProbsCommandline
# Make this explicit, then they show up in the API docs
__all__ = (

View File

@ -13,18 +13,18 @@ class, used in the Bio.AlignIO module.
"""
import sys
import collections
import copy
import importlib
import numbers
import sys
import types
import warnings
import numbers
from abc import ABC
from abc import abstractmethod
from itertools import zip_longest
from abc import ABC, abstractmethod
from typing import Dict
try:
import numpy as np
except ImportError:
@ -37,13 +37,17 @@ except ImportError:
from Bio import BiopythonDeprecationWarning
from Bio.Align import _aligncore # type: ignore
from Bio.Align import _pairwisealigner # type: ignore
from Bio.Align import _codonaligner # type: ignore
from Bio.Align import _pairwisealigner # type: ignore
from Bio.Align import substitution_matrices
from Bio.Data import CodonTable
from Bio.Seq import Seq, MutableSeq, reverse_complement, UndefinedSequenceError
from Bio.Seq import MutableSeq
from Bio.Seq import reverse_complement
from Bio.Seq import Seq
from Bio.Seq import translate
from Bio.SeqRecord import SeqRecord, _RestrictedDict
from Bio.Seq import UndefinedSequenceError
from Bio.SeqRecord import _RestrictedDict
from Bio.SeqRecord import SeqRecord
# Import errors may occur here if a compiled _pairwisealigner.c file or
# compiled _codonaligner.c file (_pairwisealigner.pyd or _pairwisealigner.so,
@ -357,6 +361,7 @@ class MultipleSeqAlignment:
"""
if format_spec:
from io import StringIO
from Bio import AlignIO
handle = StringIO()

View File

@ -7,10 +7,16 @@
"""Code for performing calculations on codon alignments."""
import sys
from math import sqrt, erfc, log, floor
from heapq import heapify, heappop, heappush
from collections import Counter
from collections import defaultdict
from heapq import heapify
from heapq import heappop
from heapq import heappush
from itertools import permutations
from collections import defaultdict, Counter
from math import erfc
from math import floor
from math import log
from math import sqrt
import numpy as np

View File

@ -27,8 +27,8 @@ zero-based end position. We can therefore manipulate ``start`` and
"""
import sys
import numpy as np
import numpy as np
from Bio.Align import Alignment
from Bio.Align import interfaces

View File

@ -50,24 +50,23 @@ You are expected to use this module via the Bio.Align functions.
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
import sys
import io
import copy
import array
import copy
import io
import itertools
import struct
import sys
import zlib
from collections import namedtuple
from io import BytesIO
import numpy as np
import numpy as np
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
Field = namedtuple("Field", ("as_type", "name", "comment"))

View File

@ -17,17 +17,17 @@ import re
import struct
import zlib
from Bio.Align import Alignment, Alignments
from Bio.Align import bigbed, maf
from Bio.Align import _aligncore # type: ignore
from Bio.Align.bigbed import AutoSQLTable, Field
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import numpy as np
from Bio.Align import _aligncore # type: ignore
from Bio.Align import Alignment
from Bio.Align import Alignments
from Bio.Align import bigbed
from Bio.Align import maf
from Bio.Align.bigbed import AutoSQLTable
from Bio.Align.bigbed import Field
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
declaration = AutoSQLTable(
"bedMaf",

View File

@ -20,15 +20,19 @@ You are expected to use this module via the Bio.Align functions.
import numpy as np
from Bio.Align import Alignment, Alignments
from Bio.Align import bigbed, psl
from Bio.Align.bigbed import AutoSQLTable, Field
from Bio.Seq import Seq, reverse_complement, UndefinedSequenceError
from Bio.SeqRecord import SeqRecord
from Bio.SeqFeature import SeqFeature, Location
from Bio.Align import Alignment
from Bio.Align import Alignments
from Bio.Align import bigbed
from Bio.Align import psl
from Bio.Align.bigbed import AutoSQLTable
from Bio.Align.bigbed import Field
from Bio.Seq import reverse_complement
from Bio.Seq import Seq
from Bio.Seq import UndefinedSequenceError
from Bio.SeqFeature import Location
from Bio.SeqFeature import SeqFeature
from Bio.SeqIO.InsdcIO import _insdc_location_string
from Bio.SeqRecord import SeqRecord
declaration = AutoSQLTable(
"bigPsl",

View File

@ -21,7 +21,6 @@ positions (like Python) and aligning region sizes.
import numpy as np
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq

View File

@ -29,7 +29,6 @@ You are expected to use this module via the Bio.Align functions.
import numpy as np
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq

View File

@ -17,7 +17,8 @@ from abc import abstractmethod
from typing import Optional
from Bio import StreamModeError
from Bio.Align import Alignments, AlignmentsAbstractBaseClass
from Bio.Align import Alignments
from Bio.Align import AlignmentsAbstractBaseClass
class AlignmentIterator(AlignmentsAbstractBaseClass):

View File

@ -29,13 +29,13 @@ zero-based end position. We can therefore manipulate ``start`` and
``start + size`` as python list slice boundaries.
"""
import shlex
import itertools
import shlex
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq, reverse_complement
from Bio.Seq import reverse_complement
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord

View File

@ -11,7 +11,8 @@ You are expected to use this module via the Bio.Align functions.
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq, reverse_complement
from Bio.Seq import reverse_complement
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord

View File

@ -15,13 +15,12 @@ You are expected to use this module via the Bio.Align functions.
import warnings
from Bio import BiopythonParserWarning
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio import BiopythonParserWarning
class AlignmentIterator(interfaces.AlignmentIterator):
"""GCG MSF alignment iterator."""

View File

@ -20,9 +20,9 @@ import numpy as np
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Nexus import Nexus
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Nexus import Nexus
class AlignmentWriter(interfaces.AlignmentWriter):

View File

@ -14,7 +14,6 @@ from Bio.Align import interfaces
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
_PHYLIP_ID_WIDTH = 10

View File

@ -27,14 +27,19 @@ zero-based end position. We can therefore manipulate ``start`` and
"""
from itertools import chain
import numpy as np
import numpy as np
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq, reverse_complement, UndefinedSequenceError
from Bio.Seq import reverse_complement
from Bio.Seq import Seq
from Bio.Seq import UndefinedSequenceError
from Bio.SeqFeature import CompoundLocation
from Bio.SeqFeature import ExactPosition
from Bio.SeqFeature import SeqFeature
from Bio.SeqFeature import SimpleLocation
from Bio.SeqRecord import SeqRecord
from Bio.SeqFeature import SeqFeature, ExactPosition, SimpleLocation, CompoundLocation
class AlignmentWriter(interfaces.AlignmentWriter):

View File

@ -22,14 +22,16 @@ positions; the parser converts these to zero-based coordinates to be consistent
with Python and other alignment formats.
"""
from itertools import chain
import copy
from itertools import chain
import numpy as np
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq, reverse_complement, UndefinedSequenceError
from Bio.Seq import reverse_complement
from Bio.Seq import Seq
from Bio.Seq import UndefinedSequenceError
from Bio.SeqRecord import SeqRecord

View File

@ -9,6 +9,7 @@
import os
import string
import numpy as np
from Bio.File import as_handle

View File

@ -11,9 +11,11 @@ This module contains a parser for tabular output from BLAST run with the
FASTA alignment tools using the '-m 8CB' or '-m 8CC' arguments.
"""
import re
import enum
import re
import numpy as np
from Bio.Align import Alignment
from Bio.Align import interfaces
from Bio.Seq import Seq

View File

@ -305,6 +305,7 @@ handle.name: {handle.name}
key, value = (s.strip() for s in line[2:].split(": ", 1))
else:
import warnings
from Bio import BiopythonParserWarning
# Seen in lalign36, specifically version 36.3.4 Apr, 2011

View File

@ -34,7 +34,6 @@ A 1-column wide alignment would have ``start == end``.
"""
import os
from itertools import islice
try:

View File

@ -78,7 +78,6 @@ the annotation attribute of each record::
"""
import re
from typing import List
from Bio.Align import MultipleSeqAlignment
@ -88,7 +87,6 @@ from Bio.SeqRecord import SeqRecord
from .Interfaces import AlignmentIterator
from .Interfaces import SequentialAlignmentWriter
XMFA_HEADER_REGEX = re.compile(
r"> (?P<id>\d+):(?P<start>\d+)-(?P<end>\d+) (?P<strand>[+-]) (?P<name>.*)"
)

View File

@ -309,6 +309,7 @@ class MsfIterator(AlignmentIterator):
seqs[idx] = s + "-" * (aln_length - len(s))
if padded:
import warnings
from Bio import BiopythonParserWarning
warnings.warn(

View File

@ -14,14 +14,15 @@ as this offers more than just accessing the alignment or its
sequences as SeqRecord objects.
"""
from typing import IO, Iterator, Optional
from typing import IO
from typing import Iterator
from typing import Optional
from Bio.Align import MultipleSeqAlignment
from Bio.AlignIO.Interfaces import AlignmentWriter
from Bio.Nexus import Nexus
from Bio.SeqRecord import SeqRecord
# You can get a couple of example files here:
# http://www.molecularevolution.org/resources/fileformats/

View File

@ -44,7 +44,6 @@ from Bio.SeqRecord import SeqRecord
from .Interfaces import AlignmentIterator
from .Interfaces import SequentialAlignmentWriter
_PHYLIP_ID_WIDTH = 10
_NO_DOTS = "PHYLIP format no longer allows dots in sequence"

View File

@ -29,15 +29,13 @@ with the subprocess module.
import os
import platform
import sys
import subprocess
import re
import subprocess
import sys
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn(
"""\
The Bio.Application modules and modules relying on it have been deprecated.

View File

@ -32,7 +32,9 @@ We have decided to remove this module in future, and instead recommend
building your command and invoking it via the subprocess module directly.
"""
from Bio.Application import _Option, AbstractCommandline, _Switch
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class _NcbibaseblastCommandline(AbstractCommandline):

View File

@ -20,16 +20,16 @@ Variables:
"""
import warnings
from io import StringIO
import time
import warnings
from io import StringIO
from urllib.parse import urlencode
from urllib.request import build_opener, install_opener
from urllib.request import urlopen
from urllib.request import HTTPPasswordMgrWithDefaultRealm, HTTPBasicAuthHandler
from urllib.request import build_opener
from urllib.request import HTTPBasicAuthHandler
from urllib.request import HTTPPasswordMgrWithDefaultRealm
from urllib.request import install_opener
from urllib.request import Request
from urllib.request import urlopen
from Bio import BiopythonWarning
from Bio._utils import function_with_previous

View File

@ -32,9 +32,9 @@ Parameters Holds information from the parameters.
import xml.sax
from xml.sax.handler import ContentHandler
from Bio.Align import MultipleSeqAlignment
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Align import MultipleSeqAlignment
def fmt_(value, format_spec="%s", default_str="<unknown>"):

View File

@ -22,29 +22,28 @@ Variables:
"""
import warnings
import io
import textwrap
import time
import warnings
from collections import UserList
from urllib.parse import urlencode
from urllib.request import build_opener
from urllib.request import HTTPBasicAuthHandler
from urllib.request import HTTPPasswordMgrWithDefaultRealm
from urllib.request import install_opener
from urllib.request import Request
from urllib.request import urlopen
from xml.parsers import expat
import numpy as np
from collections import UserList
from urllib.parse import urlencode
from urllib.request import build_opener, install_opener
from urllib.request import urlopen
from urllib.request import HTTPPasswordMgrWithDefaultRealm, HTTPBasicAuthHandler
from urllib.request import Request
from xml.parsers import expat
from Bio import BiopythonWarning
from Bio import StreamModeError
from Bio.Align import Alignment, Alignments
from Bio.Blast import _writers
from Bio._utils import function_with_previous
from Bio.Align import Alignment
from Bio.Align import Alignments
from Bio.Blast import _writers
email = None
tool = "biopython"

View File

@ -14,18 +14,23 @@ The BLAST XML DTD file is available on the NCBI site at:
https://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd
"""
import os.path
import html
import os.path
from collections import deque
from typing import Callable
from typing import Dict
from xml.parsers import expat
from typing import Dict, Callable
from Bio.Blast import Record, Hit, HSP
from Bio.Seq import Seq, reverse_complement
from Bio.SeqRecord import SeqRecord
from Bio.SeqFeature import SeqFeature, SimpleLocation
from Bio.Align import Alignment
from Bio import Entrez
from Bio.Align import Alignment
from Bio.Blast import Hit
from Bio.Blast import HSP
from Bio.Blast import Record
from Bio.Seq import reverse_complement
from Bio.Seq import Seq
from Bio.SeqFeature import SeqFeature
from Bio.SeqFeature import SimpleLocation
from Bio.SeqRecord import SeqRecord
class DTDHandler:

View File

@ -1,6 +1,7 @@
import html
import codecs
from abc import ABC, abstractmethod
import html
from abc import ABC
from abc import abstractmethod
from Bio.Seq import UndefinedSequenceError

View File

@ -13,9 +13,11 @@ using Scripts/update_ncbi_codon_table.py
Last updated at Version 4.4 (May 2019)
"""
from Bio.Data import IUPACData
from typing import Dict
from typing import List
from typing import Optional
from typing import Dict, List, Optional
from Bio.Data import IUPACData
unambiguous_dna_by_name = {}
unambiguous_dna_by_id = {}

View File

@ -16,7 +16,9 @@ We have decided to remove this module in future, and instead recommend
building your command and invoking it via the subprocess module directly.
"""
from Bio.Application import _Option, _Switch, AbstractCommandline
from Bio.Application import _Option
from Bio.Application import _Switch
from Bio.Application import AbstractCommandline
class _EmbossMinimalCommandLine(AbstractCommandline):

View File

@ -40,18 +40,16 @@ with parsing the DTD, and the other half with the XML itself.
import os
import warnings
from collections import Counter
from xml.parsers import expat
from io import BytesIO
import xml.etree.ElementTree as ET
from collections import Counter
from io import BytesIO
from urllib.parse import urlparse
from urllib.request import urlopen
from xml.parsers import expat
from xml.sax.saxutils import escape
from urllib.request import urlopen
from urllib.parse import urlparse
from Bio import StreamModeError
# The following four classes are used to add a member .attributes to integers,
# strings, lists, and dictionaries, respectively.

View File

@ -127,12 +127,14 @@ Functions:
"""
import io
import time
import warnings
import io
from urllib.error import URLError, HTTPError
from urllib.error import HTTPError
from urllib.error import URLError
from urllib.parse import urlencode
from urllib.request import urlopen, Request
from urllib.request import Request
from urllib.request import urlopen
from Bio import BiopythonDeprecationWarning
from Bio._utils import function_with_previous

View File

@ -6,9 +6,8 @@
"""Code for calling and parsing ScanProsite from ExPASy."""
# Importing these functions with leading underscore as not intended for reuse
from urllib.request import urlopen
from urllib.parse import urlencode
from urllib.request import urlopen
from xml.sax import handler
from xml.sax.expatreader import ExpatParser

View File

@ -17,8 +17,8 @@ Functions:
"""
import io
from urllib.request import urlopen
from urllib.error import HTTPError
from urllib.request import urlopen
def get_prodoc_entry(

View File

@ -11,12 +11,12 @@ Bio.File defines private classes used in Bio.SeqIO and Bio.SearchIO for
indexing files. These are not intended for direct use.
"""
import os
import collections.abc
import contextlib
import itertools
import collections.abc
from abc import ABC, abstractmethod
import os
from abc import ABC
from abc import abstractmethod
try:
import sqlite3

View File

@ -27,17 +27,16 @@ Feature Table Documentation:
# for more details of this format, and an example.
# Added by Ying Huang & Iddo Friedberg
import warnings
import re
import sys
import warnings
from collections import defaultdict
from typing import List
from Bio import BiopythonParserWarning
from Bio.File import as_handle
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio import BiopythonParserWarning
from typing import List
class InsdcScanner:

View File

@ -43,15 +43,15 @@ import warnings
from Bio import BiopythonParserWarning
from Bio.Seq import Seq
from Bio.SeqFeature import Location
from Bio.SeqFeature import LocationParserError
from Bio.SeqFeature import Reference
from Bio.SeqFeature import SeqFeature
from Bio.SeqFeature import SimpleLocation
from Bio.SeqFeature import LocationParserError
from .Scanner import GenBankScanner
# other Bio.GenBank stuff
from .utils import FeatureValueCleaner
from .Scanner import GenBankScanner
# Constants used to parse GenBank header lines
GENBANK_INDENT = 12

View File

@ -34,18 +34,21 @@ reportlab's renderPM module installed you can also use PNG etc.
"""
# reportlab
from reportlab.graphics.shapes import ArcPath
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.shapes import Line
from reportlab.graphics.shapes import Rect
from reportlab.graphics.shapes import String
from reportlab.graphics.shapes import Wedge
from reportlab.graphics.widgetbase import Widget
from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.pdfbase.pdfmetrics import stringWidth
from reportlab.graphics.shapes import Drawing, String, Line, Rect, Wedge, ArcPath
from reportlab.graphics.widgetbase import Widget
from Bio.Graphics import _write
from Bio.Graphics.GenomeDiagram import _Colors
_color_trans = _Colors.ColorTranslator()
@ -538,6 +541,7 @@ def _spring_layout(desired, minimum, maximum, gap=0):
if equal_step < gap:
import warnings
from Bio import BiopythonWarning
warnings.warn("Too many labels to avoid overlap", BiopythonWarning)

View File

@ -21,8 +21,11 @@ categories to be coloured).
# standard library
import colorsys # colour format conversions
from math import log, exp, floor, pi
import random # for jitter values
from math import exp
from math import floor
from math import log
from math import pi
class ColorSpiral:

View File

@ -12,16 +12,19 @@ two variables in a traditional scatter plot.
"""
# reportlab
from reportlab.lib import colors
from reportlab.graphics.charts.lineplots import LinePlot
from reportlab.graphics.charts.markers import makeEmptyCircle
from reportlab.graphics.charts.markers import makeEmptySquare
from reportlab.graphics.charts.markers import makeFilledCircle
from reportlab.graphics.charts.markers import makeFilledDiamond
from reportlab.graphics.charts.markers import makeFilledSquare
from reportlab.graphics.charts.markers import makeSmiley
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.shapes import String
from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.graphics.shapes import Drawing, String
from reportlab.graphics.charts.markers import makeEmptySquare, makeFilledSquare
from reportlab.graphics.charts.markers import makeFilledDiamond, makeSmiley
from reportlab.graphics.charts.markers import makeFilledCircle, makeEmptyCircle
from Bio.Graphics import _write

View File

@ -17,7 +17,6 @@ from reportlab.lib import colors
from Bio.Graphics.BasicChromosome import ChromosomeSegment
from Bio.Graphics.BasicChromosome import TelomereSegment
# --- constants
# This is a default color scheme based on the light spectrum.
# Based on my vague recollections from biology, this is our friend ROY G. BIV

View File

@ -17,15 +17,16 @@ Reportlab is used for producing the graphical output.
# standard library
import math
from reportlab.graphics.charts.barcharts import BarChartProperties
from reportlab.graphics.charts.barcharts import VerticalBarChart
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.shapes import String
from reportlab.graphics.widgetbase import TypedPropertyCollection
from reportlab.lib import colors
# reportlab
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.graphics.shapes import Drawing, String
from reportlab.graphics.charts.barcharts import VerticalBarChart
from reportlab.graphics.charts.barcharts import BarChartProperties
from reportlab.graphics.widgetbase import TypedPropertyCollection
from Bio.Graphics import _write

View File

@ -34,12 +34,14 @@ like SeqFeatures.
# ReportLab imports
from reportlab.lib import pagesizes
from reportlab.lib import colors
from reportlab.graphics.shapes import Polygon
from math import pi, sin, cos
from itertools import islice
from math import cos
from math import pi
from math import sin
from reportlab.graphics.shapes import Polygon
from reportlab.lib import colors
from reportlab.lib import pagesizes
################################################################################
# METHODS

View File

@ -15,18 +15,28 @@
# ReportLab imports
from reportlab.graphics.shapes import Drawing, String, Group, Line, Circle, Polygon
from reportlab.lib import colors
from math import cos
from math import pi
from math import sin
from reportlab.graphics.shapes import ArcPath
from reportlab.graphics.shapes import Circle
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.shapes import Group
from reportlab.graphics.shapes import Line
from reportlab.graphics.shapes import Polygon
from reportlab.graphics.shapes import String
from reportlab.lib import colors
from ._AbstractDrawer import _stroke_and_fill_colors
# GenomeDiagram imports
from ._AbstractDrawer import AbstractDrawer, draw_polygon, intermediate_points
from ._AbstractDrawer import _stroke_and_fill_colors
from ._AbstractDrawer import AbstractDrawer
from ._AbstractDrawer import draw_polygon
from ._AbstractDrawer import intermediate_points
from ._FeatureSet import FeatureSet
from ._GraphSet import GraphSet
from math import pi, cos, sin
class CircularDrawer(AbstractDrawer):
"""Object for drawing circular diagrams.

View File

@ -28,12 +28,12 @@ except ImportError:
# This is an optional part of ReportLab, so may not be installed.
renderPM = None
from ._LinearDrawer import LinearDrawer
from ._CircularDrawer import CircularDrawer
from ._Track import Track
from Bio.Graphics import _write
from ._CircularDrawer import CircularDrawer
from ._LinearDrawer import LinearDrawer
from ._Track import Track
def _first_defined(*args):
"""Return the first non-null argument (PRIVATE)."""

View File

@ -25,11 +25,11 @@ the diagram: http://www.reportlab.com
"""
# GenomeDiagram
from ._Feature import Feature
# Builtins
import re
from ._Feature import Feature
class FeatureSet:
"""FeatureSet object."""

View File

@ -23,10 +23,10 @@ the diagram: http://www.reportlab.com
# ReportLab imports
from reportlab.lib import colors
from math import sqrt
from reportlab.lib import colors
class GraphData:
"""Graph Data.

View File

@ -22,18 +22,28 @@ the diagram: http://www.reportlab.com
# ReportLab imports
from reportlab.graphics.shapes import Drawing, Line, String, Group, Polygon
from math import ceil
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.shapes import Group
from reportlab.graphics.shapes import Line
from reportlab.graphics.shapes import Polygon
from reportlab.graphics.shapes import String
from reportlab.lib import colors
from ._AbstractDrawer import _stroke_and_fill_colors
# GenomeDiagram imports
from ._AbstractDrawer import AbstractDrawer, draw_box, draw_arrow
from ._AbstractDrawer import draw_cut_corner_box, _stroke_and_fill_colors
from ._AbstractDrawer import intermediate_points, angle2trig, deduplicate
from ._AbstractDrawer import AbstractDrawer
from ._AbstractDrawer import angle2trig
from ._AbstractDrawer import deduplicate
from ._AbstractDrawer import draw_arrow
from ._AbstractDrawer import draw_box
from ._AbstractDrawer import draw_cut_corner_box
from ._AbstractDrawer import intermediate_points
from ._FeatureSet import FeatureSet
from ._GraphSet import GraphSet
from math import ceil
class LinearDrawer(AbstractDrawer):
"""Linear Drawer.

View File

@ -16,14 +16,14 @@
# Local imports, to make these classes available directly under the
# Bio.Graphics.GenomeDiagram namespace:
from ._Diagram import Diagram
from ._Track import Track
from ._FeatureSet import FeatureSet
from ._GraphSet import GraphSet
from ._CrossLink import CrossLink
from ._Colors import ColorTranslator
from ._CrossLink import CrossLink
from ._Diagram import Diagram
from ._Feature import Feature
from ._FeatureSet import FeatureSet
from ._Graph import GraphData
from ._GraphSet import GraphSet
from ._Track import Track
__all__ = (
"Diagram",

View File

@ -43,7 +43,9 @@ def _write(drawing, output_file, format, dpi=72):
No return value.
"""
from reportlab.graphics import renderPS, renderPDF, renderSVG
from reportlab.graphics import renderPDF
from reportlab.graphics import renderPS
from reportlab.graphics import renderSVG
try:
from reportlab.graphics import renderPM

View File

@ -11,11 +11,11 @@
import copy
import math
import random
from collections import defaultdict
import warnings
from collections import defaultdict
from Bio.Seq import Seq
from Bio import BiopythonDeprecationWarning
from Bio.Seq import Seq
warnings.warn(
"The 'Bio.HMM.MarkovModule' module is deprecated and will be "

View File

@ -24,11 +24,11 @@ This aims to estimate two parameters:
import math
import warnings
from Bio import BiopythonDeprecationWarning
# local stuff
from .DynamicProgramming import ScaledDPAlgorithms
from Bio import BiopythonDeprecationWarning
warnings.warn(
"The 'Bio.HMM.Trainer' module is deprecated and will be removed "
"in a future release of Biopython. Consider using the hmmlearn "

View File

@ -15,7 +15,6 @@ import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn(
"The 'Bio.HMM.Utilities' module is deprecated and will be "
"removed in a future release of Biopython. Consider using the "

View File

@ -15,8 +15,10 @@ Classes:
- Record - A representation of a KEGG Ligand/Compound.
"""
from Bio.KEGG import _default_wrap, _struct_wrap, _wrap_kegg, _write_kegg
from Bio.KEGG import _default_wrap
from Bio.KEGG import _struct_wrap
from Bio.KEGG import _wrap_kegg
from Bio.KEGG import _write_kegg
# Set up line wrapping rules (see Bio.KEGG._wrap_kegg)
name_wrap = [0, "", (" ", "$", 1, 1), ("-", "$", 1, 1)]

View File

@ -13,8 +13,10 @@ Classes:
- Record - Holds the information from a KEGG Enzyme record.
"""
from Bio.KEGG import _default_wrap, _struct_wrap, _wrap_kegg, _write_kegg
from Bio.KEGG import _default_wrap
from Bio.KEGG import _struct_wrap
from Bio.KEGG import _wrap_kegg
from Bio.KEGG import _write_kegg
# Set up line wrapping rules (see Bio.KEGG._wrap_kegg)
rxn_wrap = [

View File

@ -15,8 +15,9 @@ Classes:
"""
from Bio.KEGG import _default_wrap, _wrap_kegg, _write_kegg
from Bio.KEGG import _default_wrap
from Bio.KEGG import _wrap_kegg
from Bio.KEGG import _write_kegg
# Set up line wrapping rules (see Bio.KEGG._wrap_kegg)
name_wrap = [0, "", (" ", "$", 1, 1), ("-", "$", 1, 1)]

View File

@ -18,12 +18,15 @@ Functions:
"""
from io import StringIO
from xml.etree import ElementTree
from io import StringIO
from Bio.KEGG.KGML.KGML_pathway import Component, Entry, Graphics
from Bio.KEGG.KGML.KGML_pathway import Pathway, Reaction, Relation
from Bio.KEGG.KGML.KGML_pathway import Component
from Bio.KEGG.KGML.KGML_pathway import Entry
from Bio.KEGG.KGML.KGML_pathway import Graphics
from Bio.KEGG.KGML.KGML_pathway import Pathway
from Bio.KEGG.KGML.KGML_pathway import Reaction
from Bio.KEGG.KGML.KGML_pathway import Relation
def read(handle):
@ -174,6 +177,7 @@ class KGMLParser:
else:
# This should warn us of any unimplemented tags
import warnings
from Bio import BiopythonParserWarning
warnings.warn(

View File

@ -23,9 +23,9 @@ Classes:
"""
import time
import xml.etree.ElementTree as ET
from itertools import chain
from xml.dom import minidom
import xml.etree.ElementTree as ET
# Pathway

View File

@ -30,8 +30,9 @@ Nucleic Acids Res. 28, 29-34 (2000).
"""
import io
from urllib.request import urlopen
import time
from urllib.request import urlopen
from Bio._utils import function_with_previous

View File

@ -20,6 +20,7 @@ instead.
"""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn(

View File

@ -23,6 +23,7 @@ MarkovModel Holds the description of a markov model
"""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn(

View File

@ -10,8 +10,8 @@ Uses Improved Iterative Scaling.
"""
# TODO Define terminology
from functools import reduce
import warnings
from functools import reduce
try:
import numpy as np

View File

@ -29,6 +29,7 @@ Functions:
"""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn(

View File

@ -12,22 +12,20 @@ Based upon 'NEXUS: An extensible file format for systematic information'
Maddison, Swofford, Maddison. 1997. Syst. Biol. 46(4):590-621
"""
from functools import reduce
import copy
import math
import random
import sys
import warnings
from functools import reduce
from Bio import BiopythonDeprecationWarning
from Bio import BiopythonWarning
from Bio import File
from Bio.Data import IUPACData
from Bio.Seq import Seq
from Bio import BiopythonDeprecationWarning, BiopythonWarning
from Bio.Nexus.StandardData import StandardData
from Bio.Nexus.Trees import Tree
from Bio.Seq import Seq
INTERLEAVE = 70
SPECIAL_COMMANDS = [

View File

@ -16,7 +16,9 @@ Subclassed by Nexus.Trees to store phylogenetic trees.
Bug reports to Frank Kauff (fkauff@biologie.uni-kl.de)
"""
from typing import Dict, List, Optional
from typing import Dict
from typing import List
from typing import Optional
class ChainException(Exception):

View File

@ -16,8 +16,8 @@ nodes).
import random
import re
import sys
from . import Nodes
from . import Nodes
PRECISION_BRANCHLENGTH = 6
PRECISION_SUPPORT = 6

View File

@ -9,16 +9,18 @@
import copy
import sys
from typing import Optional, TYPE_CHECKING, TypeVar
import warnings
from typing import Optional
from typing import TYPE_CHECKING
from typing import TypeVar
import numpy as np
import Bio.PDB.Atom
from Bio.Data import IUPACData
from Bio.PDB.Entity import DisorderedEntityWrapper
from Bio.PDB.PDBExceptions import PDBConstructionWarning
from Bio.PDB.vectors import Vector
from Bio.Data import IUPACData
if TYPE_CHECKING:
from Bio.PDB.Residue import Residue

View File

@ -7,11 +7,12 @@
"""Chain class, used in Structure objects."""
from typing import Optional
from typing import TYPE_CHECKING
from Bio.PDB.Entity import Entity
from Bio.PDB.internal_coords import IC_Chain
from typing import Optional, TYPE_CHECKING
if TYPE_CHECKING:
from Bio.PDB.Model import Model
from Bio.PDB.Residue import Residue

View File

@ -90,17 +90,18 @@ The dssp data returned for a single residue is a tuple in the form:
"""
import re
import os
from io import StringIO
import re
import subprocess
import warnings
from io import StringIO
from Bio.Data.PDBData import protein_letters_3to1
from Bio.Data.PDBData import residue_sasa_scales
from Bio.PDB.AbstractPropertyMap import AbstractResiduePropertyMap
from Bio.PDB.MMCIF2Dict import MMCIF2Dict
from Bio.PDB.PDBExceptions import PDBException
from Bio.PDB.PDBParser import PDBParser
from Bio.Data.PDBData import protein_letters_3to1, residue_sasa_scales
from Bio.PDB.MMCIF2Dict import MMCIF2Dict
# Match C in DSSP
_dssp_cys = re.compile("[a-z]")

View File

@ -13,8 +13,8 @@ This module is used internally by the Bio.PDB.extract() function.
import re
import warnings
from Bio.PDB.PDBIO import PDBIO
from Bio import BiopythonWarning
from Bio.PDB.PDBIO import PDBIO
_hydrogen = re.compile("[123 ]*H.*")

View File

@ -10,10 +10,16 @@ It is a simple container class, with list and dictionary like properties.
"""
import warnings
from collections import deque
from copy import copy
from typing import TYPE_CHECKING, Any, Dict, Generic, List, Optional, TypeVar, Union
from typing import Any
from typing import Dict
from typing import Generic
from typing import List
from typing import Optional
from typing import TYPE_CHECKING
from typing import TypeVar
from typing import Union
import numpy as np

View File

@ -44,11 +44,9 @@ The library files can be found in directory 'fragment_data'.
import numpy as np
from Bio.SVDSuperimposer import SVDSuperimposer
from Bio.PDB.PDBExceptions import PDBException
from Bio.PDB.Polypeptide import PPBuilder
from Bio.SVDSuperimposer import SVDSuperimposer
# fragment file (lib_SIZE_z_LENGTH.txt)
# SIZE=number of fragments

View File

@ -11,7 +11,8 @@ import warnings
from math import pi
from Bio.PDB.AbstractPropertyMap import AbstractPropertyMap
from Bio.PDB.Polypeptide import CaPPBuilder, is_aa
from Bio.PDB.Polypeptide import CaPPBuilder
from Bio.PDB.Polypeptide import is_aa
from Bio.PDB.vectors import rotaxis

View File

@ -5,15 +5,15 @@
"""mmCIF parsers."""
import numpy as np
import warnings
from Bio.File import as_handle
import numpy as np
from Bio.File import as_handle
from Bio.PDB.MMCIF2Dict import MMCIF2Dict
from Bio.PDB.StructureBuilder import StructureBuilder
from Bio.PDB.PDBExceptions import PDBConstructionException
from Bio.PDB.PDBExceptions import PDBConstructionWarning
from Bio.PDB.StructureBuilder import StructureBuilder
class MMCIFParser:

View File

@ -5,11 +5,11 @@
"""Model class, used in Structure objects."""
from typing import TYPE_CHECKING
from Bio.PDB.Entity import Entity
from Bio.PDB.internal_coords import IC_Chain
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from Bio.PDB.Chain import Chain
from Bio.PDB.Structure import Structure

View File

@ -20,15 +20,14 @@ use naccess -y, naccess -h or naccess -w to include HETATM records
"""
import os
import tempfile
import shutil
import subprocess
import tempfile
import warnings
from Bio.PDB.AbstractPropertyMap import AbstractAtomPropertyMap
from Bio.PDB.AbstractPropertyMap import AbstractResiduePropertyMap
from Bio.PDB.PDBIO import PDBIO
from Bio.PDB.AbstractPropertyMap import (
AbstractResiduePropertyMap,
AbstractAtomPropertyMap,
)
def run_naccess(
@ -199,6 +198,7 @@ class NACCESS_atomic(AbstractAtomPropertyMap):
if __name__ == "__main__":
import sys
from Bio.PDB.PDBParser import PDBParser
p = PDBParser()

View File

@ -11,7 +11,9 @@
import numpy as np
from Bio.PDB.PDBExceptions import PDBException
from Bio.PDB.Selection import unfold_entities, entity_levels, uniqueify
from Bio.PDB.Selection import entity_levels
from Bio.PDB.Selection import unfold_entities
from Bio.PDB.Selection import uniqueify
class NeighborSearch:

View File

@ -10,15 +10,14 @@ import warnings
# Exceptions and Warnings
from Bio import BiopythonWarning
# Allowed Elements
from Bio.Data.IUPACData import atom_weights
from Bio.PDB.PDBExceptions import PDBIOException
# To allow saving of chains, residues, etc..
from Bio.PDB.StructureBuilder import StructureBuilder
# Allowed Elements
from Bio.Data.IUPACData import atom_weights
_ATOM_FORMAT_STRING = (
"%s%5i %-4s%c%3s %c%4i%c %8.3f%8.3f%8.3f%s%6.2f %4s%2s%2s\n"
)

View File

@ -44,7 +44,9 @@ import re
import shutil
import sys
from concurrent.futures import ThreadPoolExecutor
from typing import List, Optional, Tuple
from typing import List
from typing import Optional
from typing import Tuple
from urllib.request import Request
from urllib.request import urlcleanup
from urllib.request import urlopen

View File

@ -10,7 +10,10 @@ See https://pdbml.wwpdb.org/.
"""
from os import PathLike
from typing import Dict, Union, Tuple, TextIO
from typing import Dict
from typing import TextIO
from typing import Tuple
from typing import Union
from xml.etree import ElementTree
from xml.etree.ElementTree import Element

View File

@ -10,13 +10,10 @@ import warnings
import numpy as np
from Bio.File import as_handle
from Bio.PDB.parse_pdb_header import _parse_pdb_header_list
from Bio.PDB.PDBExceptions import PDBConstructionException
from Bio.PDB.PDBExceptions import PDBConstructionWarning
from Bio.PDB.StructureBuilder import StructureBuilder
from Bio.PDB.parse_pdb_header import _parse_pdb_header_list
# If PDB spec says "COLUMNS 18-20" this means line[17:20]

View File

@ -9,38 +9,35 @@
import re
from datetime import date
from io import StringIO
from typing import List
from typing import Optional
from typing import Set
from typing import TextIO
from typing import Tuple
from typing import Union
import numpy as np
from Bio import SeqIO
from Bio.Data.PDBData import protein_letters_1to3
from Bio.File import as_handle
from Bio.PDB.StructureBuilder import StructureBuilder
from Bio.PDB.ic_data import dihedra_primary_defaults
from Bio.PDB.ic_data import dihedra_secondary_defaults
from Bio.PDB.ic_data import dihedra_secondary_xoxt_defaults
from Bio.PDB.ic_data import hedra_defaults
from Bio.PDB.ic_data import ic_data_backbone
from Bio.PDB.ic_data import ic_data_sidechains
from Bio.PDB.internal_coords import AtomKey
from Bio.PDB.internal_coords import Dihedron
from Bio.PDB.internal_coords import Edron
from Bio.PDB.internal_coords import Hedron
from Bio.PDB.internal_coords import IC_Chain
from Bio.PDB.internal_coords import IC_Residue
from Bio.PDB.parse_pdb_header import _parse_pdb_header_list
from Bio.PDB.PDBExceptions import PDBException
from Bio.Data.PDBData import protein_letters_1to3
from Bio.PDB.internal_coords import (
IC_Residue,
IC_Chain,
Edron,
Hedron,
Dihedron,
AtomKey,
)
from Bio.PDB.ic_data import (
ic_data_backbone,
ic_data_sidechains,
hedra_defaults,
dihedra_primary_defaults,
dihedra_secondary_defaults,
dihedra_secondary_xoxt_defaults,
)
from typing import TextIO, Set, List, Tuple, Union, Optional
from Bio.PDB.Structure import Structure
from Bio.PDB.Residue import Residue
from Bio import SeqIO
from Bio.PDB.Structure import Structure
from Bio.PDB.StructureBuilder import StructureBuilder
# @profile

View File

@ -16,8 +16,8 @@ Comput Appl Biosci 1997 , 13:291-295
ftp://ftp.lmcp.jussieu.fr/pub/sincris/software/protein/p-sea/
"""
import subprocess
import os
import subprocess
from Bio.PDB.Polypeptide import is_aa

View File

@ -52,16 +52,15 @@ last residues) have been shown as M (methionine) by the get_sequence method.
import warnings
from Bio.Data.PDBData import nucleic_letters_3to1
from Bio.Data.PDBData import nucleic_letters_3to1_extended
from Bio.Data.PDBData import protein_letters_3to1
from Bio.Data.PDBData import protein_letters_3to1_extended
from Bio.PDB.PDBExceptions import PDBException
from Bio.PDB.vectors import calc_dihedral, calc_angle
from Bio.PDB.vectors import calc_angle
from Bio.PDB.vectors import calc_dihedral
from Bio.Seq import Seq
# Sorted by 1-letter code
aa3, aa1 = zip(*sorted(protein_letters_3to1.items(), key=lambda x: x[1]))
standard_aa_names = aa3

View File

@ -7,10 +7,12 @@
"""Residue class, used by Structure objects."""
from Bio.PDB.PDBExceptions import PDBConstructionException
from Bio.PDB.Entity import Entity, DisorderedEntityWrapper
from typing import TYPE_CHECKING
from typing import TypeVar
from typing import TYPE_CHECKING, TypeVar
from Bio.PDB.Entity import DisorderedEntityWrapper
from Bio.PDB.Entity import Entity
from Bio.PDB.PDBExceptions import PDBConstructionException
if TYPE_CHECKING:
from Bio.PDB.Atom import Atom

View File

@ -57,13 +57,12 @@ import warnings
import numpy as np
from Bio import BiopythonWarning
from Bio.PDB import PDBParser
from Bio.PDB import Selection
from Bio.PDB.AbstractPropertyMap import AbstractPropertyMap
from Bio.PDB.Polypeptide import is_aa
from Bio import BiopythonWarning
# Table 1: Atom Type to radius
_atomic_radii = {
# atom num dist Rexplicit Runited-atom

View File

@ -36,17 +36,17 @@ hydrogen bonds is at <https://www.thingiverse.com/thing:3957471>.
"""
# import re
from Bio.File import as_handle
from Bio.PDB.PDBExceptions import PDBException
import numpy as np # type: ignore
from Bio.PDB.internal_coords import IC_Residue, IC_Chain
from Bio.File import as_handle
from Bio.PDB.internal_coords import IC_Chain
from Bio.PDB.internal_coords import IC_Residue
from Bio.PDB.PDBExceptions import PDBException
# from Bio.PDB.Structure import Structure
# from Bio.PDB.Residue import Residue
from Bio.PDB.vectors import homog_scale_mtx
import numpy as np # type: ignore
def _scale_residue(res, scale, scaleMtx):
if res.internal_coord:

Some files were not shown because too many files have changed in this diff Show More