[med-svn] [fastaq] 02/03: Revert "Merge tag 'upstream/3.15.0'"

Sascha Steinbiss satta at debian.org
Mon Feb 20 16:45:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

satta pushed a commit to branch master
in repository fastaq.

commit fbcbefdb8d1c46dc72186a52466ecc15216dd975
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Mon Feb 20 16:00:02 2017 +0100

    Revert "Merge tag 'upstream/3.15.0'"
    
    This reverts commit 19d53fa866c939352ccdb9d41ef64980a72835c6, reversing
    changes made to e450819cba920d03c08e34ff8ab056686f488dcc.
---
 README.md                                          |  1 -
 pyfastaq/runners/make_random_contigs.py            |  2 +-
 pyfastaq/runners/sort_by_name.py                   | 14 --------------
 pyfastaq/tasks.py                                  | 12 ------------
 pyfastaq/tests/data/tasks_test_sort_by_name.in.fa  | 16 ----------------
 pyfastaq/tests/data/tasks_test_sort_by_name.out.fa | 16 ----------------
 pyfastaq/tests/tasks_test.py                       |  9 ---------
 scripts/fastaq                                     |  3 +--
 setup.py                                           |  2 +-
 9 files changed, 3 insertions(+), 72 deletions(-)

diff --git a/README.md b/README.md
index 675cb2f..c17c54f 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,6 @@ Available commands
 | scaffolds_to_contigs  | Creates a file of contigs from a file of scaffolds                   |
 | search_for_seq        | Find all exact matches to a string (and its reverse complement)      |
 | sequence_trim         | Trim exact matches to a given string off the start of every sequence |
-| sort_by_name          | Sorts sequences in lexographical (name) order                        |
 | sort_by_size          | Sorts sequences in length order                                      |
 | split_by_base_count   | Split multi sequence file into separate files                        |
 | strip_illumina_suffix | Strips /1 or /2 off the end of every read name                       |
diff --git a/pyfastaq/runners/make_random_contigs.py b/pyfastaq/runners/make_random_contigs.py
index 6b5febb..5337120 100644
--- a/pyfastaq/runners/make_random_contigs.py
+++ b/pyfastaq/runners/make_random_contigs.py
@@ -9,7 +9,7 @@ def run(description):
     parser.add_argument('--name_by_letters', action='store_true', help='Name the contigs A,B,C,... will start at A again if you get to Z')
     parser.add_argument('--prefix', help='Prefix to add to start of every sequence name', default='')
     parser.add_argument('--seed', type=int, help='Seed for random number generator. Default is to use python\'s default', default=None)
-    parser.add_argument('contigs', type=int, help='Number of contigs to make')
+    parser.add_argument('contigs', type=int, help='Nunber of contigs to make')
     parser.add_argument('length', type=int, help='Length of each contig')
     parser.add_argument('outfile', help='Name of output file')
     options = parser.parse_args()
diff --git a/pyfastaq/runners/sort_by_name.py b/pyfastaq/runners/sort_by_name.py
deleted file mode 100644
index f57911f..0000000
--- a/pyfastaq/runners/sort_by_name.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import argparse
-from pyfastaq import tasks
-
-def run(description):
-    parser = argparse.ArgumentParser(
-        description = description,
-        usage = 'fastaq sort_by_name <infile> <outfile>')
-    parser.add_argument('infile', help='Name of input file')
-    parser.add_argument('outfile', help='Name of output file')
-    options = parser.parse_args()
-    tasks.sort_by_name(
-        options.infile,
-        options.outfile
-    )
diff --git a/pyfastaq/tasks.py b/pyfastaq/tasks.py
index b788672..3107672 100644
--- a/pyfastaq/tasks.py
+++ b/pyfastaq/tasks.py
@@ -556,18 +556,6 @@ def sort_by_size(infile, outfile, smallest_first=False):
     utils.close(fout)
 
 
-def sort_by_name(infile, outfile):
-    '''Sorts input sequence file by sort -d -k1,1, writes sorted output file.'''
-    seqs = {}
-    file_to_dict(infile, seqs)
-    #seqs = list(seqs.values())
-    #seqs.sort()
-    fout = utils.open_file_write(outfile)
-    for name in sorted(seqs):
-        print(seqs[name], file=fout)
-    utils.close(fout)
-
-
 def to_fastg(infile, outfile, circular=None):
     '''Writes a FASTG file in SPAdes format from input file. Currently only whether or not a sequence is circular is supported. Put circular=set of ids, or circular=filename to make those sequences circular in the output. Puts coverage=1 on all contigs'''
     if circular is None:
diff --git a/pyfastaq/tests/data/tasks_test_sort_by_name.in.fa b/pyfastaq/tests/data/tasks_test_sort_by_name.in.fa
deleted file mode 100644
index 26c1d8f..0000000
--- a/pyfastaq/tests/data/tasks_test_sort_by_name.in.fa
+++ /dev/null
@@ -1,16 +0,0 @@
->scaffold1
-AGTCA
->scaffold2
-ACGTTT
->scaffold10
-A
->scaffold12
-ACG
->contig1
-AGTCA
->contig2
-ACGTTT
->contig10
-A
->contig12
-ACG
\ No newline at end of file
diff --git a/pyfastaq/tests/data/tasks_test_sort_by_name.out.fa b/pyfastaq/tests/data/tasks_test_sort_by_name.out.fa
deleted file mode 100644
index 662b583..0000000
--- a/pyfastaq/tests/data/tasks_test_sort_by_name.out.fa
+++ /dev/null
@@ -1,16 +0,0 @@
->contig1
-AGTCA
->contig10
-A
->contig12
-ACG
->contig2
-ACGTTT
->scaffold1
-AGTCA
->scaffold10
-A
->scaffold12
-ACG
->scaffold2
-ACGTTT
diff --git a/pyfastaq/tests/tasks_test.py b/pyfastaq/tests/tasks_test.py
index 5db41d4..b77dbf8 100644
--- a/pyfastaq/tests/tasks_test.py
+++ b/pyfastaq/tests/tasks_test.py
@@ -595,15 +595,6 @@ class TestSortBySize(unittest.TestCase):
         self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'tasks_test_sort_by_size.out.rev.fa'), tmpfile, shallow=False))
         os.unlink(tmpfile)
 
-class TestSortByName(unittest.TestCase):
-    def test_sort_by_name(self):
-        '''Test sort_by_name'''
-        infile = os.path.join(data_dir, 'tasks_test_sort_by_name.in.fa')
-        tmpfile = 'tmp.sort_by_name.fa'
-        tasks.sort_by_name(infile, tmpfile)
-        self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'tasks_test_sort_by_name.out.fa'), tmpfile, shallow=False))
-        os.unlink(tmpfile)
-
 
 class TestStripIlluminaSuffix(unittest.TestCase):
     def test_strip_illumina_suffix(self):
diff --git a/scripts/fastaq b/scripts/fastaq
index 881af29..e0c470a 100755
--- a/scripts/fastaq
+++ b/scripts/fastaq
@@ -25,9 +25,8 @@ tasks = {
     'scaffolds_to_contigs':   'Creates a file of contigs from a file of scaffolds',
     'search_for_seq':         'Find all exact matches to a string (and its reverse complement)',
     'sequence_trim':          'Trim exact matches to a given string off the start of every sequence',
-    'sort_by_name':           'Sorts sequences in lexographical (name) order',  
-    'sort_by_size':           'Sorts sequences in length order', 
     'split_by_base_count':    'Split multi sequence file into separate files',
+    'sort_by_size':           'Sorts sequences in length order',
     'strip_illumina_suffix':  'Strips /1 or /2 off the end of every read name',
     'to_boulderio':           'Converts to Boulder-IO format, used by primer3',
     'to_fasta':               'Converts a variety of input formats to nicely formatted FASTA format',
diff --git a/setup.py b/setup.py
index 46f813f..f9a6ed2 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
 
 setup(
     name='pyfastaq',
-    version='3.15.0',
+    version='3.14.0',
     description='Script to manipulate FASTA and FASTQ files, plus API for developers',
     packages = find_packages(),
     author='Martin Hunt',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/fastaq.git



More information about the debian-med-commit mailing list