# HG changeset patch
# User bgruening
# Date 1568133075 14400
# Node ID 2ddc36385d7a121147f228e0be2fab30fd6764f7
# Parent d150ac3d853d7127581aeb33398a74c8a0997ec6
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/split_file_to_collection commit 8d069684e155d2f5b6fae06d14d98ce41321da53"
diff -r d150ac3d853d -r 2ddc36385d7a split_file_to_collection.py
--- a/split_file_to_collection.py Wed Aug 28 10:55:25 2019 -0400
+++ b/split_file_to_collection.py Tue Sep 10 12:31:15 2019 -0400
@@ -140,7 +140,7 @@
new_file_base = [custom_new_file_name, custom_new_file_ext]
newfiles = [
- open(out_dir + "/" + new_file_base[0] + "_" + str(count) + new_file_base[1], "w")
+ open(os.path.join(out_dir, "%s_%06d%s" % (new_file_base[0], count, new_file_base[1])) , "w")
for count in range(0, numnew)
]
@@ -159,7 +159,7 @@
# keep track in loop of number of records in each file
# only used in batch
records_in_file = 0
-
+
# open file
with open(in_file, "r") as file:
record = ""
diff -r d150ac3d853d -r 2ddc36385d7a split_file_to_collection.xml
--- a/split_file_to_collection.xml Wed Aug 28 10:55:25 2019 -0400
+++ b/split_file_to_collection.xml Tue Sep 10 12:31:15 2019 -0400
@@ -50,8 +50,8 @@
--id_column '$split_parms.split_by.id_col'
--match '$split_parms.split_by.match_regex'
--sub '$split_parms.split_by.sub_regex'
- #else
- --numnew '$split_parms.split_by.numnew'
+ #else
+ --numnew '$split_parms.split_by.numnew'
#if $split_parms.split_by.select_allocate.allocate == "random":
--rand
--seed '$split_parms.split_by.rand.seed'
@@ -190,10 +190,10 @@
-
+
-
-
+
+
@@ -203,10 +203,44 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -230,29 +264,29 @@
-
-
-
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
@@ -261,10 +295,10 @@
-
+
-
-
+
+
@@ -274,18 +308,18 @@
-
-
+
+
-
+
-
+
-
-
+
+
@@ -293,10 +327,10 @@
-
+
-
-
+
+
@@ -306,10 +340,10 @@
-
+
-
-
+
+
@@ -320,27 +354,27 @@
-
-
-
+
+
+
.*" for FASTA, or "@.*" for FASTQ.
-The tool has presets for text, tabular data sets (which are split by line), FASTA, FASTQ, and MGF.
-For other data types the text delimiting records can be specified manually using the generic splitter.
+can be speciefied by a regular expression, e.g. ".*" for lines, ">.*" for FASTA, or "@.*" for FASTQ.
+The tool has presets for text, tabular data sets (which are split by line), FASTA, FASTQ, and MGF.
+For other data types the text delimiting records can be specified manually using the generic splitter.
-If splitting by line (or by some other item, like a FASTA entry or an MGF record, the splitting can be either done alternating, in original record order, or at random.
+If splitting by line (or by some other item, like a FASTA entry or an MGF record, the splitting can be either done alternating, in original record order, or at random.
If t records are to be distributed to n new data sets, then the i-th record goes to data set
-* floor(i / t * n) (for batch),
+* floor(i / t * n) (for batch),
* i % n (for alternating), or
* a random data set
@@ -368,11 +402,11 @@
4 2 1 1
= === === ====
-Note that there are no guarantees when splitting at random that every result file will be non-empty, so downstream tools should be able to gracefully handle empty files.
+Note that there are no guarantees when splitting at random that every result file will be non-empty, so downstream tools should be able to gracefully handle empty files.
If a tabular file is used as input, you may choose to split by line or by column. If split by column, a new file is created for each unique value in the column.
In addition, (Python) regular expressions may be used to transform the value in the column to a new value. Caution should be used with this feature, as it could transform all values to the same value, or other unexpected behavior.
-The default regular expression uses each value in the column without modifying it.
+The default regular expression uses each value in the column without modifying it.
]]>
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000000.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000000.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr1 1 0 247249719 chr1
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000001.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000001.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr2 2 0 242951149 chr2
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000002.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000002.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr3 3 0 199501827 chr3
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000003.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000003.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr4 4 0 191273063 chr4
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000004.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000004.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr5 5 0 180857866 chr5
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000005.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000005.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr6 6 0 170899992 chr6
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000006.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000006.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr7 7 0 158821424 chr7
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000007.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000007.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr8 8 0 146274826 chr8
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000008.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000008.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr9 9 0 140273252 chr9
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000009.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000009.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr10 10 0 135374737 chr10
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000010.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000010.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr11 11 0 134452384 chr11
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000011.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000011.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr12 12 0 132349534 chr12
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000012.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000012.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr13 13 0 114142980 chr13
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000013.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000013.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr14 14 0 106368585 chr14
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000014.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000014.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr15 15 0 100338915 chr15
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000015.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000015.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr16 16 0 88827254 chr16
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000016.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000016.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr17 17 0 78774742 chr17
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000017.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000017.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr18 18 0 76117153 chr18
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000018.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000018.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr19 19 0 63811651 chr19
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000019.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000019.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr20 20 0 62435964 chr20
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000020.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000020.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr21 21 0 46944323 chr21
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000021.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000021.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chr22 22 0 49691432 chr22
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000022.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000022.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chrX x 0 154913754 chrx
diff -r d150ac3d853d -r 2ddc36385d7a test-data/chr_000023.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/chr_000023.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,1 @@
+chr - chrY y 0 57772954 chry
diff -r d150ac3d853d -r 2ddc36385d7a test-data/karyotype.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/karyotype.txt Tue Sep 10 12:31:15 2019 -0400
@@ -0,0 +1,24 @@
+chr - chr1 1 0 247249719 chr1
+chr - chr2 2 0 242951149 chr2
+chr - chr3 3 0 199501827 chr3
+chr - chr4 4 0 191273063 chr4
+chr - chr5 5 0 180857866 chr5
+chr - chr6 6 0 170899992 chr6
+chr - chr7 7 0 158821424 chr7
+chr - chr8 8 0 146274826 chr8
+chr - chr9 9 0 140273252 chr9
+chr - chr10 10 0 135374737 chr10
+chr - chr11 11 0 134452384 chr11
+chr - chr12 12 0 132349534 chr12
+chr - chr13 13 0 114142980 chr13
+chr - chr14 14 0 106368585 chr14
+chr - chr15 15 0 100338915 chr15
+chr - chr16 16 0 88827254 chr16
+chr - chr17 17 0 78774742 chr17
+chr - chr18 18 0 76117153 chr18
+chr - chr19 19 0 63811651 chr19
+chr - chr20 20 0 62435964 chr20
+chr - chr21 21 0 46944323 chr21
+chr - chr22 22 0 49691432 chr22
+chr - chrX x 0 154913754 chrx
+chr - chrY y 0 57772954 chry