Mercurial > repos > devteam > fastx_barcode_splitter
annotate fastx_barcode_splitter.pl @ 4:015dc921d814 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
author | iuc |
---|---|
date | Tue, 08 May 2018 13:27:14 -0400 |
parents | |
children |
rev | line source |
---|---|
4
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
1 #!/usr/bin/env perl |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
2 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
3 # FASTX-toolkit - FASTA/FASTQ preprocessing tools. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
4 # Copyright (C) 2009-2013 A. Gordon (assafgordon@gmail.com) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
5 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
6 # Lance Parsons (lparsons@princeton.edu) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
7 # 3/21/2011 - Modified to accept separate index file for barcodes |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
8 # 4/6/2011 - Modified to cleanup bad barcode identifiers (esp. useful for Galaxy) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
9 # 4/28/2016 - Modified summary output to remove file paths and add comment |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
10 # character '#' |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
11 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
12 # This program is free software: you can redistribute it and/or modify |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
13 # it under the terms of the GNU Affero General Public License as |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
14 # published by the Free Software Foundation, either version 3 of the |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
15 # License, or (at your option) any later version. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
16 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
17 # This program is distributed in the hope that it will be useful, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
20 # GNU Affero General Public License for more details. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
21 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
22 # You should have received a copy of the GNU Affero General Public License |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
23 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
24 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
25 use strict; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
26 use warnings; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
27 use IO::Handle; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
28 use Data::Dumper; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
29 use Getopt::Long; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
30 use Carp; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
31 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
32 ## |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
33 ## This program splits a FASTQ/FASTA file into several smaller files, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
34 ## Based on barcode matching. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
35 ## |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
36 ## run with "--help" for usage information |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
37 ## |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
38 ## Assaf Gordon <assafgordon@gmail.com> , 11sep2008 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
39 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
40 # Forward declarations |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
41 sub load_barcode_file ($); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
42 sub parse_command_line ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
43 sub match_sequences ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
44 sub mismatch_count($$) ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
45 sub print_results; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
46 sub open_and_detect_input_format; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
47 sub open_index_and_detect_input_format($); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
48 sub read_index_record; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
49 sub read_record; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
50 sub write_record($); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
51 sub usage(); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
52 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
53 # Global flags and arguments, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
54 # Set by command line argumens |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
55 my $barcode_file ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
56 my $barcodes_at_eol = 0 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
57 my $barcodes_at_bol = 0 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
58 my $index_read_file ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
59 my $exact_match = 0 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
60 my $allow_partial_overlap = 0; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
61 my $allowed_mismatches = 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
62 my $newfile_suffix = ''; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
63 my $newfile_prefix ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
64 my $quiet = 0 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
65 my $debug = 0 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
66 my $fastq_format = 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
67 my $index_fastq_format = 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
68 my $read_id_check_strip_characters = 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
69 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
70 # Global variables |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
71 # Populated by 'create_output_files' |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
72 my %filenames; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
73 my %files; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
74 my %counts = ( 'unmatched' => 0 ); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
75 my $barcodes_length; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
76 my @barcodes; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
77 my $input_file_io; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
78 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
79 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
80 # The Four lines per record in FASTQ format. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
81 # (when using FASTA format, only the first two are used) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
82 my $seq_name; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
83 my $seq_bases; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
84 my $seq_name2; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
85 my $seq_qualities; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
86 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
87 # Values used for index read file |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
88 my $index_seq_name; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
89 my $index_seq_bases; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
90 my $index_seq_name2; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
91 my $index_seq_qualities; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
92 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
93 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
94 # Start of Program |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
95 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
96 parse_command_line ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
97 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
98 load_barcode_file ( $barcode_file ) ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
99 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
100 open_and_detect_input_format; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
101 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
102 if (defined $index_read_file) {open_index_and_detect_input_format ( $index_read_file );} |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
103 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
104 match_sequences ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
105 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
106 print_results unless $quiet; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
107 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
108 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
109 # End of program |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
110 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
111 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
112 sub parse_command_line { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
113 my $help; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
114 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
115 usage() if (scalar @ARGV==0); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
116 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
117 my $result = GetOptions ( "bcfile=s" => \$barcode_file, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
118 "eol" => \$barcodes_at_eol, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
119 "bol" => \$barcodes_at_bol, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
120 "idxfile=s" => \$index_read_file, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
121 "idxidstrip=i" => \$read_id_check_strip_characters, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
122 "exact" => \$exact_match, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
123 "prefix=s" => \$newfile_prefix, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
124 "suffix=s" => \$newfile_suffix, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
125 "quiet" => \$quiet, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
126 "partial=i" => \$allow_partial_overlap, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
127 "debug" => \$debug, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
128 "mismatches=i" => \$allowed_mismatches, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
129 "help" => \$help |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
130 ) ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
131 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
132 usage() if ($help); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
133 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
134 die "Error: barcode file not specified (use '--bcfile [FILENAME]')\n" unless defined $barcode_file; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
135 die "Error: prefix path/filename not specified (use '--prefix [PATH]')\n" unless defined $newfile_prefix; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
136 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
137 if (! defined $index_read_file) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
138 if ($barcodes_at_bol == $barcodes_at_eol) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
139 die "Error: can't specify both --eol & --bol\n" if $barcodes_at_eol; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
140 die "Error: must specify either --eol or --bol or --idxfile\n" ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
141 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
142 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
143 elsif ($barcodes_at_bol || $barcodes_at_eol) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
144 die "Error: Must specify only one of --idxfile, --eol, or --bol"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
145 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
146 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
147 die "Error: invalid for value partial matches (valid values are 0 or greater)\n" if $allow_partial_overlap<0; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
148 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
149 $allowed_mismatches = 0 if $exact_match; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
150 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
151 die "Error: invalid value for mismatches (valid values are 0 or more)\n" if ($allowed_mismatches<0); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
152 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
153 die "Error: partial overlap value ($allow_partial_overlap) bigger than " . |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
154 "max. allowed mismatches ($allowed_mismatches)\n" if ($allow_partial_overlap > $allowed_mismatches); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
155 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
156 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
157 exit unless $result; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
158 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
159 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
160 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
161 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
162 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
163 # Read the barcode file |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
164 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
165 sub load_barcode_file ($) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
166 my $filename = shift or croak "Missing barcode file name"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
167 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
168 open BCFILE,"<$filename" or die "Error: failed to open barcode file ($filename)\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
169 while (<BCFILE>) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
170 next if m/^#/; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
171 chomp; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
172 my ($ident, $barcode) = split('\t') ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
173 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
174 $barcode = uc($barcode); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
175 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
176 # Sanity checks on the barcodes |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
177 die "Error: bad data at barcode file ($filename) line $.\n" unless defined $barcode; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
178 die "Error: bad barcode value ($barcode) at barcode file ($filename) line $.\n" |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
179 unless $barcode =~ m/^[AGCT]+$/; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
180 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
181 # Cleanup Identifiers (only allow alphanumeric, replace others with dash '-') |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
182 $ident =~ s/[^A-Za-z0-9]/-/g; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
183 die "Error: bad identifier value ($ident) at barcode file ($filename) line $. (must be alphanumeric)\n" |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
184 unless $ident =~ m/^\w+$/; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
185 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
186 die "Error: badcode($ident, $barcode) is shorter or equal to maximum number of " . |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
187 "mismatches ($allowed_mismatches). This makes no sense. Specify fewer mismatches.\n" |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
188 if length($barcode)<=$allowed_mismatches; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
189 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
190 $barcodes_length = length($barcode) unless defined $barcodes_length; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
191 die "Error: found barcodes in different lengths. this feature is not supported yet.\n" |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
192 unless $barcodes_length == length($barcode); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
193 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
194 push @barcodes, [$ident, $barcode]; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
195 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
196 if ($allow_partial_overlap>0) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
197 foreach my $i (1 .. $allow_partial_overlap) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
198 substr $barcode, ($barcodes_at_bol)?0:-1, 1, ''; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
199 push @barcodes, [$ident, $barcode]; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
200 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
201 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
202 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
203 close BCFILE; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
204 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
205 if ($debug) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
206 print STDERR "barcode\tsequence\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
207 foreach my $barcoderef (@barcodes) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
208 my ($ident, $seq) = @{$barcoderef}; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
209 print STDERR $ident,"\t", $seq ,"\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
210 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
211 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
212 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
213 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
214 # Create one output file for each barcode. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
215 # (Also create a file for the dummy 'unmatched' barcode) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
216 sub create_output_files { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
217 my %barcodes = map { $_->[0] => 1 } @barcodes; #generate a uniq list of barcode identifiers; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
218 $barcodes{'unmatched'} = 1 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
219 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
220 foreach my $ident (keys %barcodes) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
221 my $new_filename = $newfile_prefix . $ident . $newfile_suffix; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
222 $filenames{$ident} = $new_filename; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
223 open my $file, ">$new_filename" or die "Error: failed to create output file ($new_filename)\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
224 $files{$ident} = $file ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
225 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
226 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
227 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
228 sub match_sequences { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
229 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
230 my %barcodes = map { $_->[0] => 1 } @barcodes; #generate a uniq list of barcode identifiers; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
231 $barcodes{'unmatched'} = 1 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
232 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
233 #reset counters |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
234 foreach my $ident ( keys %barcodes ) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
235 $counts{$ident} = 0; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
236 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
237 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
238 create_output_files; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
239 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
240 # Read file FASTQ file |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
241 # split accotding to barcodes |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
242 while ( read_record ) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
243 chomp $seq_name; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
244 chomp $seq_bases; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
245 if (defined $index_read_file) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
246 read_index_record() or die "Error: Unable to read index sequence for sequence name ($seq_name), check to make sure the file lengths match.\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
247 chomp $index_seq_name; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
248 chomp $index_seq_bases; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
249 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
250 # Assert that the read ids match |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
251 my $seq_name_match = &strip_read_id($seq_name); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
252 my $index_seq_name_match = &strip_read_id($index_seq_name); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
253 if ($seq_name_match ne $index_seq_name_match) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
254 die "Error: Index sequence name ($index_seq_name) does not match sequence name ($seq_name)\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
255 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
256 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
257 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
258 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
259 print STDERR "sequence $seq_bases: \n" if $debug; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
260 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
261 my $best_barcode_mismatches_count = $barcodes_length; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
262 my $best_barcode_ident = undef; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
263 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
264 #Try all barcodes, find the one with the lowest mismatch count |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
265 foreach my $barcoderef (@barcodes) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
266 my ($ident, $barcode) = @{$barcoderef}; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
267 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
268 # Get DNA fragment (in the length of the barcodes) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
269 # The barcode will be tested only against this fragment |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
270 # (no point in testing the barcode against the whole sequence) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
271 my $sequence_fragment; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
272 if ($barcodes_at_bol) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
273 $sequence_fragment = substr $seq_bases, 0, $barcodes_length; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
274 } elsif ($barcodes_at_eol) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
275 $sequence_fragment = substr $seq_bases, - $barcodes_length; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
276 } else { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
277 $sequence_fragment = substr $index_seq_bases, 0, $barcodes_length; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
278 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
279 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
280 my $mm = mismatch_count($sequence_fragment, $barcode) ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
281 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
282 # if this is a partial match, add the non-overlap as a mismatch |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
283 # (partial barcodes are shorter than the length of the original barcodes) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
284 $mm += ($barcodes_length - length($barcode)); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
285 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
286 if ( $mm < $best_barcode_mismatches_count ) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
287 $best_barcode_mismatches_count = $mm ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
288 $best_barcode_ident = $ident ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
289 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
290 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
291 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
292 $best_barcode_ident = 'unmatched' |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
293 if ( (!defined $best_barcode_ident) || $best_barcode_mismatches_count>$allowed_mismatches) ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
294 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
295 print STDERR "sequence $seq_bases matched barcode: $best_barcode_ident\n" if $debug; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
296 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
297 $counts{$best_barcode_ident}++; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
298 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
299 #get the file associated with the matched barcode. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
300 #(note: there's also a file associated with 'unmatched' barcode) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
301 my $file = $files{$best_barcode_ident}; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
302 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
303 write_record($file); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
304 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
305 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
306 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
307 # Strip end of readids when matching to avoid mismatch between read 1, 2, 3, etc. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
308 sub strip_read_id { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
309 my $read_id = shift; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
310 my $stripped_read_id = $read_id; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
311 if ($read_id_check_strip_characters) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
312 if ($read_id =~ /@([^:]+):([0-9]+):([^:]+):([0-9]+):([0-9]+):([0-9]+):([0-9]+) ([0-9]+):([YN]):([0-9]+):([ACGT]+){0,1}/) { # CASAVA 1.8+ |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
313 my @parts = split(/ /,$read_id); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
314 $stripped_read_id = $parts[0]; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
315 } else { # CASAVA 1.7 and earlier |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
316 $stripped_read_id = substr($read_id, 0, length($read_id)-$read_id_check_strip_characters); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
317 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
318 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
319 return $stripped_read_id; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
320 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
321 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
322 #Quickly calculate hamming distance between two strings |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
323 # |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
324 #NOTE: Strings must be same length. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
325 # returns number of different characters. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
326 #see http://www.perlmonks.org/?node_id=500235 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
327 sub mismatch_count($$) { length( $_[ 0 ] ) - ( ( $_[ 0 ] ^ $_[ 1 ] ) =~ tr[\0][\0] ) } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
328 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
329 sub print_results |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
330 { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
331 print "# Barcode\tCount\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
332 my $total = 0 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
333 foreach my $ident (sort keys %counts) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
334 print $ident, "\t", $counts{$ident},"\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
335 $total += $counts{$ident}; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
336 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
337 print "total\t",$total,"\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
338 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
339 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
340 sub read_record |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
341 { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
342 $seq_name = $input_file_io->getline(); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
343 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
344 return undef unless defined $seq_name; # End of file? |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
345 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
346 $seq_bases = $input_file_io->getline(); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
347 die "Error: bad input file, expecting line with sequences\n" unless defined $seq_bases; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
348 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
349 # If using FASTQ format, read two more lines |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
350 if ($fastq_format) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
351 $seq_name2 = $input_file_io->getline(); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
352 die "Error: bad input file, expecting line with sequence name2\n" unless defined $seq_name2; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
353 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
354 $seq_qualities = $input_file_io->getline(); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
355 die "Error: bad input file, expecting line with quality scores\n" unless defined $seq_qualities; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
356 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
357 return 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
358 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
359 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
360 sub write_record($) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
361 { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
362 my $file = shift; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
363 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
364 croak "Bad file handle" unless defined $file; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
365 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
366 print $file $seq_name,"\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
367 print $file $seq_bases,"\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
368 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
369 #if using FASTQ format, write two more lines |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
370 if ($fastq_format) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
371 print $file $seq_name2; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
372 print $file $seq_qualities; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
373 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
374 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
375 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
376 sub open_and_detect_input_format |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
377 { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
378 $input_file_io = new IO::Handle; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
379 die "Failed to open STDIN " unless $input_file_io->fdopen(fileno(STDIN),"r"); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
380 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
381 # Get the first characeter, and push it back |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
382 my $first_char = $input_file_io->getc(); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
383 $input_file_io->ungetc(ord $first_char); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
384 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
385 if ($first_char eq '>') { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
386 # FASTA format |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
387 $fastq_format = 0 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
388 print STDERR "Detected FASTA format\n" if $debug; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
389 } elsif ($first_char eq '@') { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
390 # FASTQ format |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
391 $fastq_format = 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
392 print STDERR "Detected FASTQ format\n" if $debug; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
393 } else { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
394 die "Error: unknown file format. First character = '$first_char' (expecting > or \@)\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
395 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
396 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
397 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
398 sub open_index_and_detect_input_format($) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
399 my $filename = shift or croak "Missing index read file name"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
400 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
401 open IDXFILE,"<$filename" or die "Error: failed to open index read file ($filename)\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
402 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
403 # Get the first line, and reset file pointer |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
404 my $first_line = <IDXFILE>; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
405 my $first_char = substr($first_line, 0, 1); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
406 seek(IDXFILE, 0, 0); |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
407 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
408 if ($first_char eq '>') { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
409 # FASTA format |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
410 $index_fastq_format = 0 ; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
411 print STDERR "Detected FASTA format for index file\n" if $debug; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
412 } elsif ($first_char eq '@') { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
413 # FASTQ format |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
414 $index_fastq_format = 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
415 print STDERR "Detected FASTQ format for index file\n" if $debug; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
416 } else { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
417 die "Error: unknown index file format. First character = '$first_char' (expecting > or \@)\n"; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
418 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
419 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
420 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
421 sub read_index_record |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
422 { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
423 $index_seq_name = <IDXFILE>; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
424 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
425 return undef unless defined $index_seq_name; # End of file? |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
426 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
427 $index_seq_bases = <IDXFILE>; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
428 die "Error: bad input file, expecting line with sequences\n" unless defined $index_seq_bases; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
429 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
430 # If using FASTQ format, read two more lines |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
431 if ($index_fastq_format) { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
432 $index_seq_name2 = <IDXFILE>; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
433 die "Error: bad input file, expecting line with sequence name2\n" unless defined $index_seq_name2; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
434 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
435 $index_seq_qualities = <IDXFILE>; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
436 die "Error: bad input file, expecting line with quality scores\n" unless defined $index_seq_qualities; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
437 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
438 return 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
439 } |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
440 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
441 sub usage() |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
442 { |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
443 print<<EOF; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
444 Barcode Splitter, by Assaf Gordon (gordon\@cshl.edu), 11sep2008 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
445 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
446 This program reads FASTA/FASTQ file and splits it into several smaller files, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
447 Based on barcode matching. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
448 FASTA/FASTQ data is read from STDIN (format is auto-detected.) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
449 Output files will be writen to disk. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
450 Summary will be printed to STDOUT. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
451 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
452 usage: $0 --bcfile FILE --prefix PREFIX [--suffix SUFFIX] [--bol|--eol|--idxfile] |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
453 [--mismatches N] [--exact] [--partial N] [--idxidstrip N] |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
454 [--help] [--quiet] [--debug] |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
455 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
456 Arguments: |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
457 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
458 --bcfile FILE - Barcodes file name. (see explanation below.) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
459 --prefix PREFIX - File prefix. will be added to the output files. Can be used |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
460 to specify output directories. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
461 --suffix SUFFIX - File suffix (optional). Can be used to specify file |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
462 extensions. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
463 --bol - Try to match barcodes at the BEGINNING of sequences. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
464 (What biologists would call the 5' end, and programmers |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
465 would call index 0.) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
466 --eol - Try to match barcodes at the END of sequences. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
467 (What biologists would call the 3' end, and programmers |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
468 would call the end of the string.) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
469 --idxfile FILE - Read barcodes from separate index file (fasta or fastq) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
470 NOTE: one of --bol, --eol, --idxfile must be specified, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
471 but not more than one. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
472 --idxidstrip N - When using index file, strip this number of characters |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
473 from the end of the sequence id before matching. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
474 Automatically detects CASAVA 1.8 format and strips at a |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
475 space in the id, use 0 to disable this. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
476 (Default is 1). |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
477 --mismatches N - Max. number of mismatches allowed. default is 1. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
478 --exact - Same as '--mismatches 0'. If both --exact and --mismatches |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
479 are specified, '--exact' takes precedence. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
480 --partial N - Allow partial overlap of barcodes. (see explanation below.) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
481 (Default is not partial matching) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
482 --quiet - Don't print counts and summary at the end of the run. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
483 (Default is to print.) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
484 --debug - Print lots of useless debug information to STDERR. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
485 --help - This helpful help screen. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
486 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
487 Example (Assuming 's_2_100.txt' is a FASTQ file, 'mybarcodes.txt' is |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
488 the barcodes file): |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
489 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
490 \$ cat s_2_100.txt | $0 --bcfile mybarcodes.txt --bol --mismatches 2 \\ |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
491 --prefix /tmp/bla_ --suffix ".txt" |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
492 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
493 Barcode file format |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
494 ------------------- |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
495 Barcode files are simple text files. Each line should contain an identifier |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
496 (descriptive name for the barcode), and the barcode itself (A/C/G/T), |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
497 separated by a TAB character. Example: |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
498 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
499 #This line is a comment (starts with a 'number' sign) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
500 BC1 GATCT |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
501 BC2 ATCGT |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
502 BC3 GTGAT |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
503 BC4 TGTCT |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
504 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
505 For each barcode, a new FASTQ file will be created (with the barcode's |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
506 identifier as part of the file name). Sequences matching the barcode |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
507 will be stored in the appropriate file. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
508 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
509 Running the above example (assuming "mybarcodes.txt" contains the above |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
510 barcodes), will create the following files: |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
511 /tmp/bla_BC1.txt |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
512 /tmp/bla_BC2.txt |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
513 /tmp/bla_BC3.txt |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
514 /tmp/bla_BC4.txt |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
515 /tmp/bla_unmatched.txt |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
516 The 'unmatched' file will contain all sequences that didn't match any barcode. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
517 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
518 Barcode matching |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
519 ---------------- |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
520 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
521 ** Without partial matching: |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
522 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
523 Count mismatches between the FASTA/Q sequences and the barcodes. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
524 The barcode which matched with the lowest mismatches count (providing the |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
525 count is small or equal to '--mismatches N') 'gets' the sequences. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
526 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
527 Example (using the above barcodes): |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
528 Input Sequence: |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
529 GATTTACTATGTAAAGATAGAAGGAATAAGGTGAAG |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
530 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
531 Matching with '--bol --mismatches 1': |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
532 GATTTACTATGTAAAGATAGAAGGAATAAGGTGAAG |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
533 GATCT (1 mismatch, BC1) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
534 ATCGT (4 mismatches, BC2) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
535 GTGAT (3 mismatches, BC3) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
536 TGTCT (3 mismatches, BC4) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
537 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
538 This sequence will be classified as 'BC1' (it has the lowest mismatch count). |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
539 If '--exact' or '--mismatches 0' were specified, this sequence would be |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
540 classified as 'unmatched' (because, although BC1 had the lowest mismatch count, |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
541 it is above the maximum allowed mismatches). |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
542 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
543 Matching with '--eol' (end of line) does the same, but from the other side |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
544 of the sequence. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
545 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
546 ** With partial matching (very similar to indels): |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
547 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
548 Same as above, with the following addition: barcodes are also checked for |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
549 partial overlap (number of allowed non-overlapping bases is '--partial N'). |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
550 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
551 Example: |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
552 Input sequence is ATTTACTATGTAAAGATAGAAGGAATAAGGTGAAG |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
553 (Same as above, but note the missing 'G' at the beginning.) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
554 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
555 Matching (without partial overlapping) against BC1 yields 4 mismatches: |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
556 ATTTACTATGTAAAGATAGAAGGAATAAGGTGAAG |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
557 GATCT (4 mismatches) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
558 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
559 Partial overlapping would also try the following match: |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
560 -ATTTACTATGTAAAGATAGAAGGAATAAGGTGAAG |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
561 GATCT (1 mismatch) |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
562 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
563 Note: scoring counts a missing base as a mismatch, so the final |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
564 mismatch count is 2 (1 'real' mismatch, 1 'missing base' mismatch). |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
565 If running with '--mismatches 2' (meaning allowing upto 2 mismatches) - this |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
566 seqeunce will be classified as BC1. |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
567 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
568 EOF |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
569 |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
570 exit 1; |
015dc921d814
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastx_barcode_splitter commit bbb2e6b6769b03602a8ab97001f88fbec52080a1
iuc
parents:
diff
changeset
|
571 } |