Skip to content

Commit

Permalink
Convert tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Space Robot authored and marcelm committed Nov 28, 2018
1 parent e8e0e44 commit 269f260
Show file tree
Hide file tree
Showing 25 changed files with 4,640 additions and 4,636 deletions.
8 changes: 6 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[*.py]
indent_style = tab
[*.{py,pyx,rst}]
charset=utf-8
end_of_line=lf
insert_final_newline=true
indent_style=space
indent_size=4
30 changes: 15 additions & 15 deletions doc/develop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ Development installation
For development, make sure that you install Cython and tox. We also recommend
using a virtualenv. This sequence of commands should work::

git clone https://github.com/marcelm/cutadapt.git # or clone your own fork
cd cutadapt
python3 -m venv venv
venv/bin/pip3 install Cython pytest nose tox
venv/bin/pip3 install -e .
git clone https://github.com/marcelm/cutadapt.git # or clone your own fork
cd cutadapt
python3 -m venv venv
venv/bin/pip3 install Cython pytest nose tox
venv/bin/pip3 install -e .

Then you can run Cutadapt like this (or activate the virtualenv and omit the
``venv/bin`` part)::

venv/bin/cutadapt --help
venv/bin/cutadapt --help

The tests can then be run like this::

venv/bin/pytest
venv/bin/pytest

Or with tox (but then you will need to have binaries for all tested Python
versions installed)::
Expand All @@ -39,8 +39,8 @@ Development installation (without virtualenv)
Alternatively, if you do not want to use virtualenv, running the following may
work from within the cloned repository::

python3 setup.py build_ext -i
pytest
python3 setup.py build_ext -i
pytest

This requires Cython and pytest to be installed. Avoid this method and use a
virtualenv instead if you can.
Expand Down Expand Up @@ -113,13 +113,13 @@ If this is the first time you attempt to upload a distribution to PyPI, create a
configuration file named ``.pypirc`` in your home directory with the following
contents::

[distutils]
index-servers =
pypi
[distutils]
index-servers =
pypi

[pypi]
username=my-user-name
password=my-password
[pypi]
username=my-user-name
password=my-password

See also `this blog post about getting started with
PyPI <http://peterdowns.com/posts/first-time-with-pypi.html>`_. In particular,
Expand Down
14 changes: 7 additions & 7 deletions doc/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1443,10 +1443,10 @@ If you have paired-end data, trim also read 2 with the reverse complement of the
“TruSeq Universal Adapter”. The full command-line looks as follows::

cutadapt \
-a AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC \
-A AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT \
-o trimmed.1.fastq.gz -p trimmed.2.fastq.gz \
reads.1.fastq.gz reads.2.fastq.gz
-a AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC \
-A AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT \
-o trimmed.1.fastq.gz -p trimmed.2.fastq.gz \
reads.1.fastq.gz reads.2.fastq.gz

See also the :ref:`section about paired-end adapter trimming above <paired-end>`.

Expand All @@ -1456,9 +1456,9 @@ be aware that this sequence occurs multiple times in the human genome and it
could therefore skew your results very slightly at those loci ::

cutadapt \
-a AGATCGGAAGAGC -A AGATCGGAAGAGC \
-o trimmed.1.fastq.gz -p trimmed.2.fastq.gz \
reads.1.fastq.gz reads.2.fastq.gz
-a AGATCGGAAGAGC -A AGATCGGAAGAGC \
-o trimmed.1.fastq.gz -p trimmed.2.fastq.gz \
reads.1.fastq.gz reads.2.fastq.gz

The adapter sequences can be found in the document `Illumina TruSeq Adapters
De-Mystified <http://tucf-genomics.tufts.edu/documents/protocols/TUCF_Understanding_Illumina_TruSeq_Adapters.pdf>`__.
Expand Down
12 changes: 6 additions & 6 deletions doc/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ but only one 3' adapter, then you have two options.
First, you can specify the adapters and also ``--times=2`` (or the short
version ``-n 2``). For example::

cutadapt -g ^TTAAGGCC -g ^AAGCTTA -a TACGGACT -n 2 -o output.fastq input.fastq
cutadapt -g ^TTAAGGCC -g ^AAGCTTA -a TACGGACT -n 2 -o output.fastq input.fastq

This instructs Cutadapt to run two rounds of adapter finding and removal. That
means that, after the first round and only when an adapter was actually found,
Expand All @@ -30,7 +30,7 @@ The second option is to not use the ``-n`` option, but to run Cutadapt twice,
first removing one adapter and then the other. It is easiest if you use a pipe
as in this example::

cutadapt -g ^TTAAGGCC -g ^AAGCTTA input.fastq | cutadapt -a TACGGACT - > output.fastq
cutadapt -g ^TTAAGGCC -g ^AAGCTTA input.fastq | cutadapt -a TACGGACT - > output.fastq


Trim poly-A tails
Expand All @@ -41,16 +41,16 @@ adapter type (``-a``) with an adapter sequence of many repeated ``A``
nucleotides. Starting with version 1.8 of Cutadapt, you can use the
following notation to specify a sequence that consists of 100 ``A``::

cutadapt -a "A{100}" -o output.fastq input.fastq
cutadapt -a "A{100}" -o output.fastq input.fastq

This also works when there are sequencing errors in the poly-A tail. So this
read ::

TACGTACGTACGTACGAAATAAAAAAAAAAA
TACGTACGTACGTACGAAATAAAAAAAAAAA

will be trimmed to::

TACGTACGTACGTACG
TACGTACGTACGTACG

If for some reason you would like to use a shorter sequence of ``A``, you can
do so: The matching algorithm always picks the leftmost match that it can find,
Expand All @@ -59,7 +59,7 @@ used in the adapter sequence. However, sequencing errors may result in shorter
matches than desired. For example, using ``-a "A{10}"``, the read above (where
the ``AAAT`` is followed by eleven ``A``) would be trimmed to::

TACGTACGTACGTACGAAAT
TACGTACGTACGTACGAAAT

Depending on your application, perhaps a variant of ``-a A{10}N{90}`` is an
alternative, forcing the match to be located as much to the left as possible,
Expand Down
164 changes: 82 additions & 82 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,49 @@
MIN_CYTHON_VERSION = '0.28'

if sys.version_info[:2] < (3, 4):
sys.stdout.write('You need at least Python 3.4\n')
sys.exit(1)
sys.stdout.write('You need at least Python 3.4\n')
sys.exit(1)


def no_cythonize(extensions, **_ignore):
"""
Change file extensions from .pyx to .c or .cpp.
Copied from Cython documentation
"""
for extension in extensions:
sources = []
for sfile in extension.sources:
path, ext = os.path.splitext(sfile)
if ext in ('.pyx', '.py'):
if extension.language == 'c++':
ext = '.cpp'
else:
ext = '.c'
sfile = path + ext
sources.append(sfile)
extension.sources[:] = sources
"""
Change file extensions from .pyx to .c or .cpp.
Copied from Cython documentation
"""
for extension in extensions:
sources = []
for sfile in extension.sources:
path, ext = os.path.splitext(sfile)
if ext in ('.pyx', '.py'):
if extension.language == 'c++':
ext = '.cpp'
else:
ext = '.c'
sfile = path + ext
sources.append(sfile)
extension.sources[:] = sources


def check_cython_version():
"""Exit if Cython was not found or is too old"""
try:
from Cython import __version__ as cyversion
except ImportError:
sys.stdout.write(
"ERROR: Cython is not installed. Install at least Cython version " +
str(MIN_CYTHON_VERSION) + " to continue.\n")
sys.exit(1)
if LooseVersion(cyversion) < LooseVersion(MIN_CYTHON_VERSION):
sys.stdout.write(
"ERROR: Your Cython is at version '" + str(cyversion) +
"', but at least version " + str(MIN_CYTHON_VERSION) + " is required.\n")
sys.exit(1)
"""Exit if Cython was not found or is too old"""
try:
from Cython import __version__ as cyversion
except ImportError:
sys.stdout.write(
"ERROR: Cython is not installed. Install at least Cython version " +
str(MIN_CYTHON_VERSION) + " to continue.\n")
sys.exit(1)
if LooseVersion(cyversion) < LooseVersion(MIN_CYTHON_VERSION):
sys.stdout.write(
"ERROR: Your Cython is at version '" + str(cyversion) +
"', but at least version " + str(MIN_CYTHON_VERSION) + " is required.\n")
sys.exit(1)


extensions = [
Extension('cutadapt._align', sources=['src/cutadapt/_align.pyx']),
Extension('cutadapt.qualtrim', sources=['src/cutadapt/qualtrim.pyx']),
Extension('cutadapt._align', sources=['src/cutadapt/_align.pyx']),
Extension('cutadapt.qualtrim', sources=['src/cutadapt/qualtrim.pyx']),
]

cmdclass = versioneer.get_cmdclass()
Expand All @@ -64,28 +64,28 @@ def check_cython_version():


class build_ext(versioneer_build_ext):
def run(self):
# If we encounter a PKG-INFO file, then this is likely a .tar.gz/.zip
# file retrieved from PyPI that already includes the pre-cythonized
# extension modules, and then we do not need to run cythonize().
if os.path.exists('PKG-INFO'):
no_cythonize(extensions)
else:
# Otherwise, this is a 'developer copy' of the code, and then the
# only sensible thing is to require Cython to be installed.
check_cython_version()
from Cython.Build import cythonize
self.extensions = cythonize(self.extensions)
versioneer_build_ext.run(self)
def run(self):
# If we encounter a PKG-INFO file, then this is likely a .tar.gz/.zip
# file retrieved from PyPI that already includes the pre-cythonized
# extension modules, and then we do not need to run cythonize().
if os.path.exists('PKG-INFO'):
no_cythonize(extensions)
else:
# Otherwise, this is a 'developer copy' of the code, and then the
# only sensible thing is to require Cython to be installed.
check_cython_version()
from Cython.Build import cythonize
self.extensions = cythonize(self.extensions)
versioneer_build_ext.run(self)


class sdist(versioneer_sdist):
def run(self):
# Make sure the compiled Cython files in the distribution are up-to-date
from Cython.Build import cythonize
check_cython_version()
cythonize(extensions)
versioneer_sdist.run(self)
def run(self):
# Make sure the compiled Cython files in the distribution are up-to-date
from Cython.Build import cythonize
check_cython_version()
cythonize(extensions)
versioneer_sdist.run(self)


cmdclass['build_ext'] = build_ext
Expand All @@ -94,35 +94,35 @@ def run(self):

encoding_arg = {'encoding': 'utf-8'} if sys.version > '3' else dict()
with open('README.rst', **encoding_arg) as f:
long_description = f.read()
long_description = f.read()

setup(
name='cutadapt',
version=versioneer.get_version(),
author='Marcel Martin',
author_email='[email protected]',
url='https://cutadapt.readthedocs.io/',
description='trim adapters from high-throughput sequencing reads',
long_description=long_description,
license='MIT',
cmdclass=cmdclass,
ext_modules=extensions,
package_dir={'': 'src'},
packages=find_packages('src'),
entry_points={'console_scripts': ['cutadapt = cutadapt.__main__:main']},
install_requires=['dnaio>=0.3', 'xopen>=0.3.2'],
extras_require={
'dev': ['Cython', 'pytest', 'pytest-timeout', 'sphinx', 'sphinx_issues'],
},
python_requires='>=3',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics"
],
name='cutadapt',
version=versioneer.get_version(),
author='Marcel Martin',
author_email='[email protected]',
url='https://cutadapt.readthedocs.io/',
description='trim adapters from high-throughput sequencing reads',
long_description=long_description,
license='MIT',
cmdclass=cmdclass,
ext_modules=extensions,
package_dir={'': 'src'},
packages=find_packages('src'),
entry_points={'console_scripts': ['cutadapt = cutadapt.__main__:main']},
install_requires=['dnaio>=0.3', 'xopen>=0.3.2'],
extras_require={
'dev': ['Cython', 'pytest', 'pytest-timeout', 'sphinx', 'sphinx_issues'],
},
python_requires='>=3',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics"
],
)
Loading

0 comments on commit 269f260

Please sign in to comment.